Skip to content

Conversation

@imjbassi
Copy link

Metadata

Details

This PR updates the simple_flows_and_runs_tutorial.py example to use SklearnExtension.model_to_flow() instead of manually creating an OpenMLFlow object.

Why this change is necessary:

The OpenMLFlow class docstring states:

"Flows should not be generated manually, but by the function openml.flows.create_flow_from_model"

However, the tutorial was showing manual flow creation. This PR aligns the tutorial with the recommended approach by using the sklearn extension's model_to_flow() method, which automatically extracts all metadata and hyperparameters from the model.

Changes made:

  • Added from openml_sklearn import SklearnExtension import
  • Replaced manual OpenMLFlow() construction with extension.model_to_flow(clf)
  • Updated parameter extraction to use knn_flow.parameters from the auto-generated flow

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.

[DOC] Update Example for Converting Model to Flow

1 participant