Created
March 2, 2021 02:24
-
-
Save AnyISalIn/b88399849966228e2ceedb57c3b6c8b9 to your computer and use it in GitHub Desktop.
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
import pandas | |
import numpy as np | |
from scipy.stats import randint | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.datasets import make_classification | |
rng = np.random.RandomState(0) | |
X, y = make_classification(n_samples=100000000, n_features=500, random_state=rng) | |
with open('input', 'w') as f: | |
f.write(str(X[0])) | |
f.write("\n") | |
f.write(str(y[0])) | |
print(X[0]) | |
print(y[0]) | |
from sklearn2pmml.pipeline import PMMLPipeline | |
pipeline = PMMLPipeline([ | |
("classifier", RandomForestClassifier(n_jobs=40)) | |
]) | |
pipeline.fit(X, y) | |
from sklearn2pmml import sklearn2pmml | |
sklearn2pmml(pipeline, "rf-1b.pmml", with_repr = True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment