Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for catboost inference #299

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JeroenVerstraelen
Copy link
Contributor

No description provided.

:return: The predicted value.
"""
return predict_catboost(data=self, model=model)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openeo/processes.py is a generated file

# Do not edit this file directly.
# It is automatically generated.

so it's nor recommended to manually add processes here (they will be removed with the next update)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as predict_catboost is not an official process, we can not put it here

a job id (``str``) or a :py:class:`RESTJob` instance of a batch job that saved a single model.
:param dimension: dimension along which to apply the ``reduce_dimension`` process.

.. versionadded:: 0.10.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version will be 0.10.1


:param model: a :py:class:`MlModel` (e.g. loaded from :py:meth:`~openeo.Connection.load_ml_model`)
or a reference to such a model: a URL (``str``) to a STAC Item (implementing the `ml-model` extension)
a job id (``str``) or a :py:class:`RESTJob` instance of a batch job that saved a single model.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see latest doc of predict_random_forest for a cleaner parameter description:

:param model: a reference to a trained model, one of
- a :py:class:`MlModel` instance (e.g. loaded from :py:meth:`Connection.load_ml_model`)
- a :py:class:`RESTJob` instance of a batch job that saved a single random forest model
- a job id (``str``) of a batch job that saved a single random forest model
- a STAC item URL (``str``) to load the random forest from.
(The STAC Item must implement the `ml-model` extension.)

if not isinstance(model, MlModel):
model = MlModel.load_ml_model(connection=self.connection, id=model)
from openeo.processes import predict_catboost
reducer = lambda data, context: predict_catboost(data=data, model=context)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead use

from openeo.processes import process
reducer = lambda data, context: process('predict_catboost', data=data, model=model)

@soxofaan
Copy link
Member

It's probably better to avoid model-specific predict processes like predict_catboost, and just work with generic predict_class and predict_probabilities.
see discussion at Open-EO/openeo-processes#368
let's wait for decision there before proceeding here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support for catboost, inference only
2 participants