library(doParallel)
registerDoParallel(4)
train_lasso <- function(data) {
recency <- (data$Recency^3) - min(data$Recency^3)
volume <- (data$NormVolume) - min(data$NormVolume)
short_entropy <- (data$CloseRollingEntropy5) - min(data$CloseRollingEntropy5)
short_vola <- (data$CloseRollingVola5) - min(data$CloseRollingVola5)
w <- volume - short_entropy
glmnet::cv.glmnet(
data %>% select(-IntradayPerf) %>% as.matrix(),
data %>% pull(IntradayPerf) %>% c(),
# weight = w - min(w),
nfolds = 2^8,
parallel = TRUE,
type.gaussian = "covariance"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.