From 14a3a6f1820228968603097d9fe12b61db97789b Mon Sep 17 00:00:00 2001 From: androiddrew Date: Sat, 26 Mar 2022 13:50:54 -0400 Subject: [PATCH] Saving work --- scikit_learn_ex/output/.gitignore | 2 -- scikit_learn_ex/train.py | 22 ---------------------- sklearn_ex/README.md | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 scikit_learn_ex/output/.gitignore delete mode 100644 scikit_learn_ex/train.py diff --git a/scikit_learn_ex/output/.gitignore b/scikit_learn_ex/output/.gitignore deleted file mode 100644 index 53ce133..0000000 --- a/scikit_learn_ex/output/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pkl -*.onnx \ No newline at end of file diff --git a/scikit_learn_ex/train.py b/scikit_learn_ex/train.py deleted file mode 100644 index 224907c..0000000 --- a/scikit_learn_ex/train.py +++ /dev/null @@ -1,22 +0,0 @@ -from turtle import pd -import joblib as jl - -from sklearn.datasets import load_iris -from sklearn.model_selection import train_test_split -from sklearn.ensemble import RandomForestClassifier - -def main(): - # Use iris dataset - iris = load_iris() - X, y = iris.data, iris.target - X_train, X_test, y_train, y_test = train_test_split(X, y) - clr = RandomForestClassifier() - # Fit - clr.fit(X_train, y_train) - # Serialize the classifier to pickle file - jl.dump(clr, "./output/model.pkl", compress=9) - -if __name__ == "__main__": - print("Building iris model...") - main() - print("Model trained and dumped as pickle file.") \ No newline at end of file diff --git a/sklearn_ex/README.md b/sklearn_ex/README.md index 24b737a..e92a051 100644 --- a/sklearn_ex/README.md +++ b/sklearn_ex/README.md @@ -19,7 +19,7 @@ python convert_to_onnx.py ./output/model.pkl Make inferences ``` - +python onnx_infer.py ./output/clr_model.onnx ``` ## Model