This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with X_train, X_test, Y_train, Y_test | |
from sklearn_pandas import DataFrameMapper | |
from sklearn2pmml import PMMLPipeline, sklearn2pmml | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.preprocessing import FunctionTransformer | |
def is_adult(x): return x > 18 | |
clf = PMMLPipeline([ | |
("mapper", DataFrameMapper([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with X_train, X_test, Y_train, Y_test | |
import dill | |
from sklearn_pandas import DataFrameMapper | |
from sklearn.pipeline import Pipeline | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.preprocessing import FunctionTransformer | |
def is_adult(x): return x > 18 | |
clf = Pipeline([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run this anywhere and change the pipeline.pk path | |
import dill | |
from pandas import read_csv | |
url = "https://raw.githubusercontent.com/baatout/ml-in-prod/master/pima-indians-diabetes.csv" | |
features = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age'] | |
label = 'label' | |
dataframe = read_csv(url, names=features + [label]) | |
X = dataframe[features] | |
Y = dataframe[label] |
OlderNewer