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
sparse matrices and train #31
Comments
This is an excellent idea |
Feel free to take a whack at it =] On Mon, Jul 21, 2014 at 1:52 PM, Zach Mayer notifications@github.com
|
I didn't hear anything from you, so I've checked in some changes to make The changes were pretty minor but there were a few complications. The On Mon, Jul 21, 2014 at 3:42 PM, Max Kuhn mxkuhn@gmail.com wrote:
|
Regression tests between the current devel version and 6.0-30 show no differences in the model results between versions. I've added a test case in the glmnet test file but other tests would be good. I'm also testing out string kernels for SVM models too. |
Thanks for grabbing this— a kaggle competition has been eating up all my free time lately =D |
As far as I can tell, things work fine. I'm going to close this. |
How can I use sparse matrix with caret and glmnet for classification problem? My response is in binary format [0,1] and train function says that this is actually a regression problem :) If I set metric to RMSE it throws a warning: My data is converted to sparse matrix with |
I think the first issue is the format of your outcome. Make it a factor with levels that are valid R variables (e.g. "yes"/"no") so that If you are still having issues after that, send us an example that we can test with. I'm going to be out of commission from shoulder surgery starting Monday so you might not get a response back from me in the short term. |
Yikes! Good luck with the surgery Max! @leakyMirror If you post a reproducible example ( |
Thanks for all your work on this package Max and zachmayer! Caret's great. I've also been trying to use sparse matrices with the output from the train method and am similarly running into forced conversion of my sparse matrices into non-sparse matrices. I'm running caret_6.0-41 and R version 3.1.2 (2014-10-31). If I run:
this is slightly slower than
Due to, based on profiling, the use of as.matrix in caret's implementation of predict. However, the following is very fast:
due to, as I understand it, predict being called from the 'glmnet' package rather than 'caret'. (I know this last formulation will not carry out preprocessing, etc.). Am I doing something wrong, or is predict(trainObj) still coercing newdata to a non-sparse form? I did not train on a sparse matrix, using one at prediction time. Please let me know if I can provide a toy example and thanks again for the excellent package! |
@zachmayer @topepo sorry for crossposting. Can you have a look whats going wrong here: text2vec-classification-with-caret-problems. How to feed sparse matrices ( |
Hello everyone, I just discovered this amazing Thanks!! |
hello @topepo, can you please confirm caret can finally work with sparse matrices and glmnet? thanks!! |
See here.
This should be feasible now that
x
andy
are carried along separately throughtrain
.The text was updated successfully, but these errors were encountered: