This file contains 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
border: no | |
license: gpl-3.0 |
This file contains 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
border: no | |
license: gpl-3.0 |
This file contains 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
border: no | |
license: gpl-3.0 |
This file contains 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
let GetImages = | |
(url as text) => | |
let | |
Protocol = Uri.Parts(url)[Scheme], | |
PathName = Uri.Parts(url)[Path], | |
Host = Uri.Parts(url)[Host], | |
Source = Text.From(Text.FromBinary(Web.Contents(url))), | |
GetTag = (Counter as number) => | |
let | |
CurrentTag = Text.BetweenDelimiters(Text.BetweenDelimiters(Source, "<img", ">", Counter), "src=""", """"), |
This file contains 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
library(pacman) | |
p_load(tidytext, wordcloud, janeaustenr, dplyr) | |
data("stop_words") | |
ppdf <- data.frame(prideprejudice, stringsAsFactors = FALSE) | |
# create a word cloud | |
create_word_cloud <- function(dat, col_name, exclude = "", max.words = 50, colors = "#034772", ...){ | |
col <- deparse(substitute(col_name)) | |
dat %>% |
This file contains 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
let Table.Imputer = | |
(table as table, columnName as text, strategy as text, optional axis as number) as table => | |
let | |
InputTable = Table.AddIndexColumn(table, "index", 0, 1), | |
imputeList = | |
let | |
list = Table.Column(InputTable,columnName) | |
in | |
list, | |
imputeColumn = |
This file contains 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
let Table.GetDummies = | |
(sourceTable as table, columnName as text) as table => | |
let | |
distinctTable = | |
let | |
source = Table.AddKey(Table.Distinct(Table.FromList(Table.Column(sourceTable, columnName), Splitter.SplitByNothing(), null, null, ExtraValues.Error)),{"Column1"},false), | |
addIndex = Table.AddIndexColumn(source, "index", 0, 1) | |
in | |
addIndex, | |
origTable = |
This file contains 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
let | |
List.MinMaxScaler = (initialList as list, optional outputRange as list) as list => | |
let | |
featureRange = if outputRange is null then {0,1} else outputRange, | |
list = List.Buffer(initialList), | |
count = List.Count(list), | |
min = List.Min(list), | |
max = List.Max(list), | |
a = featureRange{0}, | |
b = featureRange{1}, |
This file contains 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
let | |
List.RandomSelection = (sourceList as list) as text => | |
let | |
Selection = sourceList{Number.RoundDown(Number.RandomBetween(0, List.Count(sourceList)))} | |
in | |
Selection, | |
DefineDocs = [ | |
Documentation.Name = " List.RandomSelection", | |
Documentation.Description = " Randomly select a value from a list.", |
This file contains 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
let | |
List.StandardScaler = (initialList as list) as list => | |
let | |
list = List.Buffer(initialList), | |
count = List.Count(list), | |
sd = List.StandardDeviation(list), | |
m = List.Average(list), | |
Scaler = List.Generate( | |
()=> [n = 0], | |
each [n] < count, |
OlderNewer