# Year/Month as a feature in Random Forest Classifier

I need to include a Maturity Date feature in my scikit-learn RandomForestClassifier model.

Since the day is too specific, I'm thinking of having a number with the format YYYYMM.

Any issues with this approach? Are there best practices to have dates as features?

• Often it's better to normalize, but how are the maturity dates being used? Is this bonds or home loans or something like that? Jul 12 at 20:30
• Yes, those are maturities of home loans. Probably instead of using the date it's better to have a number such "pending months" Jul 12 at 20:35
• Depending on what kind of thing we're classifying here, it's going to be more likely that home loans maturity date would be better encoded as a normalized months until maturity or normalized maturity date, e.g., 0 is your earliest maturity and 1 is your latest maturity, 0.5 is halfway in between, etc. It's less likely that you would want to encode as a categorical. Is this for like prepay curves or prob. of default or loss severity or something? Jul 13 at 23:18