R how to relate datasets with multiple predictor values to a single target value for prediction?



I have a dataset which predictors contains monthly temperature values for particular year and my target variable has only one value per year. Now to make prediction how can i relate monthly 12 values with single yearly output value?


Hi @Niteshdm

I’ll suggest you to create separate columns for the temperature of each month and assign them all with the single yearly value. This will represent a row in your data.

This will be best suited if you need to make predictions at the end of each year rather than end of each month.



Hi @sauravkaushik8

Thanks for writing back, my problem is i want predict one value with 12 values. i.e by observing 12 values of each month i want to predict a single value as output per year.

For example i’m predicting crop yield(Target) which will be a single value per year, the predictors are weather parameters during whole year so how can i relate single value target with multiple value predictors?


Hi @Niteshdm
You have one typical problem of prediction, Y=F(12 temperature) so as explained by @sauravkaushik8 you build the vector of the 12 temperature of you year in one function and it predicts. Now which function? I am sure it is you question . Personally I always start with linear model and then check the residual for interaction or other.
Hope this help