Uncategorized

python – Is there a way to have a multiple linear regression (and other machine learning models) predict a GeoPandas multipolygon?


I have a geodatabase with polygons that represent the spread of California wildfires between years (rougly) 1900-2013. I am trying to create a linear regression model that can take temperatures (floats) recorded during the previous year and predict the Shapely MultiPolygon of where a fire would spread to given those temperatures. The geodatabase is stored as a GeoPandas GeoDataFrame in my code.

I have not been able to find any library or package that allows you to train a model to predict a Polygon.

I have tried Pysal:

train_X = fire_X.iloc[train].values
train_y = fire_y.iloc[train].values
test_X = fire_X.iloc[test].values
test_y = fire_y.iloc[test].values

model = spreg.OLS(y=train_y, x=train_X)

where fire_X has the temperature data and fire_y is just the geometry column from the Geodatabase, which resulted in
TypeError: unsupported operand type(s) for +: 'MultiPolygon' and 'MultiPolygon'

sklearn regression also didn’t work. Is this even possible?



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *