[R] Preparing dataset for glmnet: factors to dummies

Mark Difford mark_difford at yahoo.co.uk
Wed Feb 2 08:50:37 CET 2011


Hi Frank,

>> I believe that glmnet scales variables by their standard deviations. 
>> This would not be appropriate for categorical predictors.

That's an excellent point, which many are likely to forget (including me)
since one is using a model matrix. The default argument is to standardize
inputs, but there is an option to turn it off. (One could then standardize
continuous inputs on different scales oneself.)

Regards, Mark.
-- 
View this message in context: http://r.789695.n4.nabble.com/Preparing-dataset-for-glmnet-factors-to-dummies-tp3250791p3253538.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list