8000 Features in the data · Issue #71 · shokru/mlfactor.github.io · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Features in the data #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
qucqu opened this issue Aug 30, 2021 · 2 comments
Open

Features in the data #71

qucqu opened this issue Aug 30, 2021 · 2 comments

Comments

@qucqu
Copy link
qucqu commented Aug 30, 2021

In 5.1.3 Illustration, I try to use your code and data to compute Lasso as you did in your book:

library(glmnet)
y_penalized <- data_ml$R1M_Usd # Dependent variable
x_penalized <- data_ml %>% # Predictors
dplyr::select(all_of(features)) %>% as.matrix()
fit_lasso <- glmnet(x_penalized, y_penalized, alpha = 1) # Model alpha = 1: LASSO

in dplyr::select(all_of(features)) %>% as.matrix(), since there is no "features" in your data, I cannot repeate your compution. Is the data in github is not the one you used in your book?

Thanks and regards,
Mike

@shokru
Copy link
Owner
shokru commented Aug 30, 2021

Dear Mike,

sorry for the inconvenience. The set of features is defined in Chapter 2 as:
features <- colnames(data_ml[3:95])

With this it should work.
Best,

Guillaule

@qucqu
Copy link
Author
qucqu commented Aug 30, 2021

Dear Guillaule,

Many thanks for your quick response! It really solve my problem.

With Best Regards,
Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0