In this blog, lets talk about multi target variables. In a generic machine learning model prediction scenario, where we will have input features and single target variable.
Input Feature | Output Feature |
---|---|
x1 , x2 , x3 , x4… | y |
Assigning multiple target variables would throw an error on linear regression ,Since it is incompatible with multiple target variable.
Input Feature | Output Feature |
---|---|
x1 , x2 , x3 , x4….. | y1 , y2 , y3 , y4 ….. |
Linear regression expect the output target variable to be a single value. But in a multiple target variable scenario, it is an array of multiple target variables. Hence it throws an error.
We can use random forest to predict Mutiple target variables. The training methodology and syntax remains identical. The output target will be an array. This array contains multiple target variables to be predicted.
Theres’s a difference in the internal algorithm during multi target than that from single target variable. For this particular example, let’s consider a regression problem.
Let’s discuss of two method that is:
Stacked single target.
Ensemble of regressor chain.
Image from Springer Article by Grigorios Tsoumakas , William Groves , Ioannis Vlahavas
The input variable is trained to predict the first variable Y1 from the Target variable array. This creates a predictor output function h1.
This procedure is carried out on every variable from the target variable array. Their corresponding predictor output functions h1 , h2 ….hm.
Next stage is the meta - variable generation, The input X is passed to the predictor function, which predicts an intermediate value i.e
The name suggests, there is a chain pattern in predicting the multi target variable.
We have unwraped the working of Multi Target Prediction in Machine Learning. Please find the resources below for additive information.