Skip to content

Instantly share code, notes, and snippets.

@xiaowei1234
Created November 8, 2018 00:24
Show Gist options
  • Save xiaowei1234/e2bfa888c1cba39e8ffc7b9d7f70ce7b to your computer and use it in GitHub Desktop.
Save xiaowei1234/e2bfa888c1cba39e8ffc7b9d7f70ce7b to your computer and use it in GitHub Desktop.
sklearn2pmml pipe
pl = PMMLPipeline([
('featureUnion', featureU)
, ('impute', Imputer(strategy='median'))
, ('standardize', StandardScaler())
# , ('interactions', PolynomialFeatures(include_bias=False))
# , ('clf', SGDClassifier(alpha=0.008, l1_ratio=0.13, max_iter=450,loss='log'
# ,penalty='elasticnet', n_iter=None, tol=None))# alpha = 0.8
, ('clf', LogisticRegression(penalty='l2', max_iter=500, C=0.8))
])
pl.fit(X, y)
sklearn2pmml(pl, '../outputs/pmml_file.pmml', with_repr=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment