Re: [Rd] sparse.model.matrix Generates Non-Existent Factor Levels if Ord.factor Columns Present

2018-02-08 Thread Dario Strbenac
Good day, The intention is to convert the dataset into a format suitable for the random forest classifier implemented by the CRAN package xgboost. The input data is required to be transformed into one-hot format using the sparse.discrim.matrix function, as specified by the package's vignette of

Re: [Rd] sparse.model.matrix Generates Non-Existent Factor Levels if Ord.factor Columns Present

2018-02-08 Thread Ben Bolker
color and clarity are ordered factors, so sparse.model.matrix is generating orthogonal-polynomial contrasts (see ?contr.poly). This is by design ... what are you trying to do? Are you interested in fac2sparse? On 18-02-07 11:00 PM, Dario Strbenac wrote: > Good day, > > Sometimes, sparse.mo