Mercurial > repos > bgruening > run_jupyter_job
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f4619200cb0a |
---|---|
1 # Train a model. | |
2 from sklearn.datasets import load_iris | |
3 from sklearn.ensemble import RandomForestClassifier | |
4 from sklearn.model_selection import train_test_split | |
5 | |
6 iris = load_iris() | |
7 X, y = iris.data, iris.target | |
8 X, y = X[:20], y[:20] | |
9 loss = list() | |
10 X_train, X_test, y_train, y_test = train_test_split(X, y) | |
11 clr = RandomForestClassifier(n_estimators=5) | |
12 clr.fit(X_train, y_train) | |
13 clr.score(X_test, y_test) |