This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' A word vector is a giant matrix of words, and each word contains a numeric array that represents the semantic | |
#' meaning of that word. This is useful so we can discover relationships and analogies between words programmatically. | |
#' The classic example is "king" minus "man" plus "woman" is most similar to "queen" | |
# function definition -------------------------------------------------------------------------- | |
# input .txt file, exports list of list of values and character vector of names (words) | |
proc_pretrained_vec <- function(p_vec) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generic data dictionary creation using base-R | |
#' a couple notes: this could of course be done much faster using | |
#' third party packages, but I like to provide base-R solutions before | |
#' branching out into packages just in case they aren't available | |
#' | |
#' Also, this could be done in a much less verbose and modular way, | |
#' but I did want to also demonstrate the "Functional Programming" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# references: | |
# https://rud.is/b/2016/02/14/making-faceted-heatmaps-with-ggplot2/ | |
# This is basically the TL;DR and it also uses a built-in dataset to foster reproducibility | |
library(ggplot2) | |
library(viridis) | |
gg <- ggplot(airquality, aes(x=Day, y=Month, fill=Temp)) | |
gg <- gg + geom_tile(color='White', size=0.1) |
NewerOlder