100123
153
95
25
9
100124
155
100
26
14
100125
155
110
21
12
100126
162
90
22
7
AlteryxFullUpdate <<- FALSE
library(dplyr)
library(plyr)
dta.obj <- read.Alteryx("#1", mode="data.frame")
constants.obj <- read.Alteryx("#2", mode="data.frame")
dta2.obj <- read.Alteryx("#3", mode="data.frame")
overlap = intersect(names(dta.obj), names(constants.obj))
dta.obj = dta.obj[overlap] + constants.obj[overlap]
overlap2 = intersect(names(dta2.obj), names(constants.obj))
dta2.obj = dta2.obj[overlap2] + constants.obj[overlap2]
# Write output
write.Alteryx(dta.obj,1)
write.Alteryx(dta2.obj,2)
100123
2
7
1
1
100124
2
7
1
1
100125
2
7
1
1
100126
2
7
1
1
AlteryxFullUpdate <<- FALSE
# Read model and data input
model <- read.Alteryx("#1", mode="data.frame") #1
model <- unserializeObject(as.character(model$Object))
data <- read.Alteryx("#2", mode="data.frame") #2
constants <- read.Alteryx("#3", mode="data.frame") #3
# Extract variable names
the.coefs <- model$coefficients
the.coefs <- as.list(names(the.coefs))
the.coefs <- as.list(the.coefs[-1])
the.coefs <- c("ID","Weight", the.coefs)
data <- data[ , (names(data) %in% the.coefs)]
data2 <- constants[ , (names(constants) %in% the.coefs)] #constants of sig vars
# Write output
write.Alteryx(data,1)
write.Alteryx(data2,2)
Home
advanced
True
True
True
True
True
True
False
Linear_Regression_342
Weight
Height,Age
False
False
False
0.5
5
lambda_1se
1
0.5
False
5
3
1
1x
Linear_Regression_342
True
False
True
False
1x
Local Model
Score
False
2
False
False
95
True
256000
{"Name":"","Owner":"","Status":"","Id":"","LastDeployment":"","LastUpdated":"","LatestVersion":"","ActiveVersion":"","NumReplications":"","NumVersions":""}
Home
advanced
True
True
True
True
True
True
False
Linear_Regression_345
Weight
Height,Age
False
False
False
0.5
5
lambda_1se
1
0.5
False
5
3
1
1x
Linear_Regression_345
Horizontal
sample