{ "cells": [ { "cell_type": "markdown", "id": "cac88086-1bc3-4916-809f-85e7e94f8fe0", "metadata": {}, "source": [ "## Renku MLS Plug-in demo" ] }, { "cell_type": "markdown", "id": "2b928da5-636d-463c-a081-98586cf8c468", "metadata": {}, "source": [ "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", "metadata": {}, "source": [ "See `src/train.py` for the demonstration training file." ] }, { "cell_type": "code", "execution_count": 18, "id": "4b06791b-a3c2-45db-a788-69c8c39d0cf0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "You chose the RandomForestClassifier model.\n", "Accuracy: 1.0\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/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.\n", " from pandas import MultiIndex, Int64Index\n" ] } ], "source": [ "%%bash\n", "cd ../ # Return to the main repository\n", "python src/train.py data/wine/wine.data label RandomForestClassifier models/RFC" ] }, { "cell_type": "code", "execution_count": 19, "id": "c6544915-fda6-4728-92a4-faa27acb2be0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "You chose the LinearSVC model.\n", "Accuracy: 0.9152542372881356\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/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.\n", " from pandas import MultiIndex, Int64Index\n", "/opt/conda/lib/python3.9/site-packages/sklearn/svm/_base.py:1206: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n", " warnings.warn(\n" ] } ], "source": [ "%%bash\n", "cd ../ # Return to the main repository\n", "python src/train.py data/wine/wine.data label LinearSVC models/SVC" ] }, { "cell_type": "code", "execution_count": 20, "id": "7d2b84bb-0c7d-4095-8af5-83ff05e50c4f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "You chose the XGBClassifier model.\n", "[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.\n", "Accuracy: 0.9830508474576272\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/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.\n", " from pandas import MultiIndex, Int64Index\n", "/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].\n", " warnings.warn(label_encoder_deprecation_msg, UserWarning)\n" ] } ], "source": [ "%%bash\n", "cd ../ # Return to the main repository\n", "python src/train.py data/wine/wine.data label XGBClassifier models/XGB" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.6" } }, "nbformat": 4, "nbformat_minor": 5 }