# Building a machine learning model to predict crop yields based on environmental data

I have a dataset containing data on temperature, precipitation and soybean yields for a farm for 10 years (2005 - 2014). I would like to predict yields for 2015 based on this data.

Please note that the dataset has DAILY values for temperature and precipitation, but only 1 value per year for the yield, since harvesting of crop happens at end of growing season of crop.

I want to build a regression or some other machine learning based model to predict 2015 yields, based on a regression/some other model derived by studying the relation between yields and temperature and precipitation in previous years.

I am familiar with performing machine learning using scikit-learn. However, not sure how to represent this problem. The tricky part here is that temperature and precipitation are daily but yield is just 1 value per year.

How do I approach this?

• even i'm trying to build a model to predict crop yield. Could you please share the details about the approach you are following? – Nitz Feb 8 '17 at 11:34
• Were you able to get a complete answer. If no, please let me know and I will be happy to write a detailed answer on how to go about it given I work in the same domain – 89_Simple Jun 8 '18 at 14:07
• @Crop89, that would be great! looking forward to your answer – user308827 Jun 8 '18 at 23:22
• Have you figured it out? I'm facing the same problem. Could you share the details if you have worked it out? much thanks – eric huang Oct 12 '18 at 2:00

• I was not addressing the specifics of sklearn, but since you asked, you want to be using the sklearn.cross_validation methods with "Label" in the name, such as sklearn.cross_validation.LabelKFold. – Emre Jan 4 '16 at 0:33