I'm familiar with using trigonometric functions to transform cyclic variables for use as features in training a model (most commonly hour of the day or month of the year); I'm now trying to figure out the best way of doing this for using these types of variables as the target for my model. (Imagine a model predicting the month when a particular event is most likely to occur, for instance). Neither using a strictly-increasing representation (so that January, 2018 is close to December, 2017 but very far from January, 2017) nor treating the month as a categorical variable is ideal, but the trigonometric encoding done for features requires both sin
and cos
parts to have a unique representation of each month, so using one of the two isn't a workable approach either. Is there a better option that I'm missing?
$\begingroup$
$\endgroup$
1
-
$\begingroup$ You can still do the sin/cos trick, but use a bivariate model. $\endgroup$– shadowtalkerCommented Oct 9, 2018 at 22:59
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
1
The relevant terminology is "multi-output" or "multi-target" regression/classification. A survey article from a few years ago has some good discussion. This functionality is implemented in many packages (for instance, in sklearn (where it extends the functionality of other regressors, rather than being an independent implementation) and in R.
-
$\begingroup$ Keras‘ functional API also provides a good way to model multi-targets. See this post for a minimal example: datascience.stackexchange.com/a/64350/71442 $\endgroup$– PeterCommented Dec 7, 2019 at 12:07