custom Features, scikit-learn
Currently the custom features workflow is not compatible with the use of scikit-learn models. Although, only the classification step need to be refactored.
A first approach can be to look at the actual code use to classify pixels thanks to scikit models : skClassifier.py#L382
function_partial = partial(do_predict, model=model, scaler=scaler)
classification_dir = os.path.join(output_path, "classif")
feat_stack, feat_labels, _ = generate_features(...)
logger.info("producing {}".format(out_classif))
(predicted_proba, _, transform, epsg,
masks) = rasterU.insert_external_function_to_pipeline(
feat_stack,
...
number_of_chunks=number_of_chunks,
targeted_chunk=targeted_chunk,
...)
the partial function is the predict() function coming from scikit-learn. Maybe this function could contains the custom features computation and the prediction stage.