Closed amine-aboufirass closed 4 years ago
If I remember correctly, I used the first call to predict_proba (on a tiny window of data) to check what the output dimensions of the result will be, i.e. the number of classes with probabilities without using the training data. This is so when writing windows of data with rasterio, the raster metadata can be correctly set with the correct number of bands before opening a file for writing.
Hi @stevenpawley thanks for your response. Couldn't you simply get that from the estimator that is passed into your predict_proba
method? Something like estimator.classes_.shape[0]
would work I think?
Good point, I forgot about that. I'll update the predict methods in the next commit.
Can I ask what is the point of line 836 in
raster.py
? This line appears to call thepredict_proba
method fromsklearn
, but then uses the result only to extract itsdtype
andshape
. The result is never written into or included in the returnedRaster
object.The function
predict_proba
inpyspatialml
'sRaster
appears to callsklearn
'spredict_proba
a second time in line 1095 under_probfun
and I think this gets written into the result. I think I understand why it is called this second time. I am confused as to why it gets called in line 836.