Datagran allows you to upload a python Scikit-Learn trained model.

To do so, go to your project and select Models.

Screen Shot 2021-10-13 at 1.21.36 PM.png

Then upload your trained model into Datagran:

Screen Shot 2021-10-13 at 1.21.55 PM.png

Code example for a trained model Dump:

from sklearn import svm
from sklearn import datasets
clf = svm.SVC()
X, y= datasets.load_iris(return_X_y=True), y)

import pickle
s = pickle.dumps(clf)
open("dump.pkl", "wb").write(s)

Code example for a Scikit-Learn Pipeline dump. With a pipeline dump it will allow you to include code that transforms your data for your model:

from sklearn.svm import SVC
from sklearn.preprocessing import StandardScaler
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
import pickle

X, y = make_classification(random_state=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
pipe = Pipeline([('scaler', StandardScaler()), ('svc', SVC())]), y_train)
    "pipeline.pkl", "wb"

Once you upload your model you can use it in our Pipelines Section dragging and dropping the Custom Model Operator shown below:

Screen Shot 2021-12-17 at 11.43.37 AM.png

Once you run your Custom Model you will get an output for your predictions table like so: