Skip to content

Conversation

@Omswastik-11
Copy link

@Omswastik-11 Omswastik-11 commented Dec 24, 2025

initially

import sklearn
import openml

clf = KNeighborsClassifier(n_neighbors=3)
clf.fit(X_train, y_train)

# Verbose manual flow construction required
knn_flow = openml.flows.OpenMLFlow(
    model=clf,
    name="CustomKNeighborsClassifier",
    description="A custom KNeighborsClassifier flow for OpenML.",
    external_version=f"{sklearn.__version__}",
    language="English",
    tags=["openml_tutorial_knn"],
    dependencies=f"{sklearn.__version__}",
    parameters={k: str(v) for k, v in knn_parameters.items()},
    parameters_meta_info={
        "n_neighbors": {"description": "number of neighbors to use", "data_type": "int"}
    },
    components={},
)
knn_flow.publish()

API

from sklearn.neighbors import KNeighborsClassifier
import openml_sklearn  # Register the extension
import openml

clf = KNeighborsClassifier(n_neighbors=3)

openml.publish(clf)

@Omswastik-11 Omswastik-11 changed the title [ENH] improve publish api for users [ENH] Simplified Publish API with Automatic Type Recognition Dec 24, 2025
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

I get this is a draft still, some early comments.

  • works for flows only, I would recommend to try for at least two different object types to see the dispatching challenge there.
  • do the extension checking inside publish and not in the usage example

@Omswastik-11
Copy link
Author

Omswastik-11 commented Dec 25, 2025

Thanks @fkiraly !!
I checked on flow , datset , task . it is working correctly but in run it is getting some server side issues.

Task 1 failed: https://test.openml.org/api/v1/xml/data/features/1 returned code 274: No features found. Additionally, dataset processed with error - None

@Omswastik-11 Omswastik-11 requested a review from fkiraly December 25, 2025 08:07
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.

2 participants