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
AWSTemplateFormatVersion: "2010-09-09" | |
Description: This template creates resources for Flowise application | |
Parameters: | |
Stage: | |
Description: Prefix of resource names | |
Type: String | |
Default: flowise |
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
=CONCAT( | |
CHAR(48+MOD(RANDBETWEEN(49,84),75)), | |
CHAR(48+MOD(RANDBETWEEN(49,84),75)), | |
CHAR(48+MOD(RANDBETWEEN(49,84),75)), | |
CHAR(48+MOD(RANDBETWEEN(49,84),75)), | |
CHAR(48+MOD(RANDBETWEEN(49,84),75)), | |
CHAR(48+MOD(RANDBETWEEN(49,84),75)) | |
) |
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
eval_classifier <- function(trained_model, test_data) { | |
outcome_var <- as.character( | |
trained_model$terms[[2]] | |
) | |
y_test <- test_data[[outcome_var]] | |
# make predictions and probailities on the test set | |
y_pred <- predict(trained_model, test_data, type = "raw") |
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
#load the mutual information library | |
library(mpmi) | |
#define normalised continuous mutual information, bias corrected | |
ncmi<-function(cts,...){ | |
MIunnorm<-cmi(cts,...) | |
MIbcmiself<-diag(MIunnorm$bcmi) | |
MIbcminorm<-outer(MIbcmiself,MIbcmiself,FUN = "*") | |
MInormed<-MIunnorm$bcmi / sqrt(MIbcminorm) | |
colnames(MInormed)<-colnames(cts) |
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
#Efficient fuzzy match of two data frames by one common column | |
library(dplyr) | |
library(fuzzyjoin) | |
library(stringdist) | |
eff_fuzzy_match<-function(data_frame_A, | |
data_frame_B, | |
by_what, | |
choose_p = 0.1, | |
choose_max_dist = 0.4, |
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
#Make Example Data | |
df_a<-data.frame(A = c(1:9,11), B = letters[1:10], C = sample(1:4,10,replace = T)) | |
df_b<-data.frame(A = c(1:10,1:10), B = letters[c(1:5,10,9,8,7,5,6:15)], C = sample(1:4,20,replace = T)) | |
order_of_importance<-c("A"="A","B"="B") | |
#Define Recursive Join Function | |
recursive_join<-function(left_df,right_df,variable_order){ |
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
library(stringdist) | |
library(dplyr) | |
#Example Data Frame to find and correct typos in | |
my_df<-data.frame(BIRTH = c(1,1,2,3,1,5,3,3,1), | |
NAME = c("Luke","Luke","Leia","Han","Ben","Lando","Han","Ham","Luke"), | |
SURNAME = c("Skywalker","Skywalker","Organa","Solo","Solo","Calrissian","Solo","Solo","Wkywalker"), | |
random_value = c(1,2,3,7,1,3,4,4,9)) | |
#Concatenate the birthday and name columns |
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
library(ggplot2) | |
library(grid) | |
library(lubridate) | |
# Create some data to play with. Two time series with offset timestamp. | |
df1 <- data.frame(DateTime = ymd("2010-07-01") + c(0:8760) * hours(2), series1 = rnorm(8761)) | |
df2 <- data.frame(DateTime = ymd("2011-07-01") + c(0:8760) * hours(2), series1 = rnorm(8761)) | |
# Create the two plots. | |
plotme <- function(inputdf,titletext,whatcolor){ |