How do I use Classification Learner with datetime value predictors?

I have a large table of sensor data that I would like to run through a binary classification tree. Some of my column variables in the table are dates, which I would like to specify as possible predictors. I tried importing into the Classification Learner as datetime values. It didn't work, and it was marked as "unsuitable".
How do I use datetime values as predictors in Classification Learner App?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 9월 13일
편집: MathWorks Support Team 2024년 9월 13일

1 개 추천

The Classification Learner App does not currently support datetime values. Our developers have been made aware of this issue and will consider it for future releases.
As a workaround, it is recommended to convert the datetime values using the "datenum" function. This simply converts the datetime value into a double that represents a serial date number. Please refer to the example code below:
>> table.date_1 = datenum(table.date_1)
Documentation for "datenum" function:

추가 답변 (0개)

카테고리

제품

릴리스

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by