SuperDuperDB/superduperdb

[MISC] Fixing the Code to Train and Evaluate Sklearn Model

Closed this issue · 0 comments

We would like the code below to work for clear training and evaluating Sklearn models

from sklearn.linear_model import LogisticRegression
from superduperdb.ext.sklearn.model import SklearnTrainer, Estimator
from superduperdb.ext.sklearn import SklearnTrainer
from superduperdb import Validation

# Create a Logistic Regression model
model = LogisticRegression()
model = Estimator(
    object=model,
    identifier='my-model',
    trainer=SklearnTrainer(),
    validation=Validation(
        key=('X', 'y'),
        datasets=[Dataset('my-valid', Collection('clt').find())],
        metrics=[Metric('acc', my_accuracy_function)]
    ),
)