APSIMInitiative / APSIM710

APSIM
https://www.apsim.info
30 stars 47 forks source link

Connect Python model to APSIM #2136

Open dakneeshahaha opened 2 years ago

dakneeshahaha commented 2 years ago

Good day.

The main objective of our study is to create a Machine Learning (ML) model using LightGBM that can forecast rice yields simulated through APSIM.

We already built a LightGBM ML model using Python to forecast rice yield based on historical environmental data (e.g., climate, soil fertility). Is there a way to connect our Python code (LightGBM model) to APSIM 7.10?

Or is there any other way you can recommend on how we can simulate rice yield forecasts in APSIM based on our model?

We are open to any suggestions and recommendations.

Thank you very much for your time!

peter-devoil commented 2 years ago

I think this is one of those "which one on top" questions.

You can certainly run apsim from python while setting parameters before the run - there are issues elsewhere here that describe it

Unfortunately, nobody's got around to writing an python module that can interact with an apsim simulation while in progression, though there are a few other language integrations such as C#, R. Once you have interaction, you can do things like suck up water, intercept radiation, pull in met data etc. But that may not be what your ML model wants to do.

Alternatively, you could just use the rice model already in apsim :)

P

dakneeshahaha commented 2 years ago

Thanks for answering my previous question, Peter.

We're conducting a study on rice yield here in the Philippines using APSIM. But the Soil and Irrigation data are extremely limited in the Philippines. All we have regarding Soil data are the area's soil's Nitrogen (as Organic Matter) rating, the pH rating, the potassium rating, and the phosphorus rating. As well as the overall General Fertility Rating.

General Soil Fertility Rating_per province in the Philippines

How can we implement this limited Soil data on APSIM's rice (Oryza) model? Since there are very many soil parameters that we cannot leave blank.

We are open to any suggestions and recommendations. Or do you have any expert we can consult?

Thank you very much for your time!

peter-devoil commented 2 years ago

I'll ask around, as there were some apsim people working there in the nineties, but most are in retirement now. @DonaldGaydon may have some suggestions too.