From dstr7320 at uni.sydney.edu.au  Fri Feb  9 01:00:11 2018
From: dstr7320 at uni.sydney.edu.au (Dario Strbenac)
Date: Fri, 9 Feb 2018 00:00:11 +0000
Subject: [Rd] 
 sparse.model.matrix Generates Non-Existent Factor Levels if
 Ord.factor Columns Present
In-Reply-To: <8514e60d-e80b-456f-a9fa-150f70a808d7@gmail.com>
References: <SYAPR01MB2909E2D69C15EAAC96F7C6E5CDF30@SYAPR01MB2909.ausprd01.prod.outlook.com>,
 <8514e60d-e80b-456f-a9fa-150f70a808d7@gmail.com>
Message-ID: <SYAPR01MB29097AC9E88583C9F37C062CCDF30@SYAPR01MB2909.ausprd01.prod.outlook.com>

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 URL https://cran.r-project.org/web/packages/xgboost/vignettes/discoverYourData.html I did not know to read the help page for contr.poly after reading the sparse.discrim.matrix help page. Perhaps there could be a helpful mention added to it?

--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia


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