Mercurial > repos > bgruening > run_jupyter_job
diff test-data/scikit-script.py @ 0:f4619200cb0a draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/jupyter_job commit f945b1bff5008ba01da31c7de64e5326579394d6"
author | bgruening |
---|---|
date | Sat, 11 Dec 2021 17:56:38 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/scikit-script.py Sat Dec 11 17:56:38 2021 +0000 @@ -0,0 +1,13 @@ +# Train a model. +from sklearn.datasets import load_iris +from sklearn.ensemble import RandomForestClassifier +from sklearn.model_selection import train_test_split + +iris = load_iris() +X, y = iris.data, iris.target +X, y = X[:20], y[:20] +loss = list() +X_train, X_test, y_train, y_test = train_test_split(X, y) +clr = RandomForestClassifier(n_estimators=5) +clr.fit(X_train, y_train) +clr.score(X_test, y_test)