Commit 2623c0f5 authored by Gavin Lee's avatar Gavin Lee
Browse files

add renku mls commands to notebooks

parent 0556f447
Pipeline #310424 passed with stage
in 13 seconds
%% Cell type:markdown id:cac88086-1bc3-4916-809f-85e7e94f8fe0 tags:
## Renku MLS Plug-in demo
%% Cell type:markdown id:2b928da5-636d-463c-a081-98586cf8c468 tags:
This plug-in allows you to compare across different `renku run` iterations in terms of pre-defined metrics.
%% Cell type:markdown id:a13b4e8a-660f-402a-8e53-72b68b198985 tags:
See `src/train.py` for the demonstration training file.
%% Cell type:code id:4b06791b-a3c2-45db-a788-69c8c39d0cf0 tags:
``` python
%%bash
cd ../ # Return to the main repository
python src/train.py data/wine/wine.data label RandomForestClassifier models/RFC
renku run -- python src/train.py data/wine/wine.data label RandomForestClassifier models/RFC
```
%%%% Output: stream
You chose the RandomForestClassifier model.
Accuracy: 1.0
Info: Adding these files to Git LFS:
models/RFC
To disable this message in the future, run:
renku config set show_lfs_message False
%%%% Output: stream
/opt/conda/lib/python3.9/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
from pandas import MultiIndex, Int64Index
%% Cell type:code id:c6544915-fda6-4728-92a4-faa27acb2be0 tags:
``` python
%%bash
cd ../ # Return to the main repository
python src/train.py data/wine/wine.data label LinearSVC models/SVC
renku run -- python src/train.py data/wine/wine.data label LinearSVC models/SVC
```
%%%% Output: stream
You chose the LinearSVC model.
Accuracy: 0.9152542372881356
Accuracy: 0.8305084745762712
%%%% Output: stream
/opt/conda/lib/python3.9/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
from pandas import MultiIndex, Int64Index
/opt/conda/lib/python3.9/site-packages/sklearn/svm/_base.py:1206: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.
warnings.warn(
%% Cell type:code id:7d2b84bb-0c7d-4095-8af5-83ff05e50c4f tags:
``` python
%%bash
cd ../ # Return to the main repository
python src/train.py data/wine/wine.data label XGBClassifier models/XGB
renku run -- python src/train.py data/wine/wine.data label XGBClassifier models/XGB
```
%%%% Output: stream
You chose the XGBClassifier model.
[01:12:17] WARNING: ../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.
[02:52:22] WARNING: ../src/learner.cc:1115: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.
Accuracy: 0.9830508474576272
Info: Adding these files to Git LFS:
models/XGB
To disable this message in the future, run:
renku config set show_lfs_message False
%%%% Output: stream
/opt/conda/lib/python3.9/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
from pandas import MultiIndex, Int64Index
/opt/conda/lib/python3.9/site-packages/xgboost/sklearn.py:1224: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
warnings.warn(label_encoder_deprecation_msg, UserWarning)
%% Cell type:markdown id:9dab8308-6b91-4338-ab33-d44cb6e15459 tags:
## View the leaderboard
%% Cell type:code id:42914a63-4354-461f-8f1d-54a5c647d41d tags:
``` python
! cd ../; renku mls leaderboard
```
%%%% Output: stream
+----------------------------------+-------------------------------------------------+-----------------------------------------+--------------------+
| Run ID | Model | Inputs | accuracy |
+----------------------------------+-------------------------------------------------+-----------------------------------------+--------------------+
| 83dbed2912bd440e97681720ac2b588e | sklearn.ensemble._forest.RandomForestClassifier | ['data/wine/wine.data', 'src/train.py'] | 1.0 |
| 150a59441ca54dfcba3365db804fab99 | xgboost.sklearn.XGBClassifier | ['data/wine/wine.data', 'src/train.py'] | 0.9830508474576272 |
| 148fc15412a7430e9268849c8bb1df84 | sklearn.svm._classes.LinearSVC | ['data/wine/wine.data', 'src/train.py'] | 0.8305084745762712 |
+----------------------------------+-------------------------------------------------+-----------------------------------------+--------------------+
%% Cell type:markdown id:5e6e8e44-ce99-40fd-a11e-3225f28bb7ff tags:
## View the hyper-parameters in each of the models
%% Cell type:code id:879cf6b8-890a-43d3-8034-5ed3dfa2b71e tags:
``` python
! cd ../; renku mls params
```
%%%% Output: stream
+----------------------------------+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Run ID | Model | Hyper-Parameters |
+----------------------------------+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 148fc15412a7430e9268849c8bb1df84 | sklearn.svm._classes.LinearSVC | {"C": "1.0", "dual": "true", "fit_intercept": "true", "intercept_scaling": "1", "loss": "squared_hinge", "max_iter": "1000", "multi_class": "ovr", "penalty": "l2", "tol": "0.0001", "verbose": "0"} |
| 150a59441ca54dfcba3365db804fab99 | xgboost.sklearn.XGBClassifier | {"base_score": "0.5", "booster": "gbtree", "colsample_bylevel": "1", "colsample_bynode": "1", "colsample_bytree": "1", "enable_categorical": "false", "gamma": "0", "gpu_id": "-1", "interaction_constraints": "", "learning_rate": "0.300000012", "max_delta_step": "0", "max_depth": "6", "min_child_weight": "1", "missing": "nan", "monotone_constraints": "()", "n_estimators": "100", "n_jobs": "8", "num_parallel_tree": "1", "objective": "multi:softprob", "predictor": "auto", "random_state": "0", "reg_alpha": "0", "reg_lambda": "1", "subsample": "1", "tree_method": "exact", "use_label_encoder": "true", "validate_parameters": "1"} |
| 83dbed2912bd440e97681720ac2b588e | sklearn.ensemble._forest.RandomForestClassifier | {"bootstrap": "true", "ccp_alpha": "0.0", "criterion": "gini", "max_features": "auto", "min_impurity_decrease": "0.0", "min_samples_leaf": "1", "min_samples_split": "2", "min_weight_fraction_leaf": "0.0", "n_estimators": "100", "oob_score": "false", "verbose": "0", "warm_start": "false"} |
+----------------------------------+-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment