Skip to content

Commit

Permalink
Fix notebooks ...
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhessam88 committed Jul 17, 2024
1 parent 42dd964 commit 472b91a
Show file tree
Hide file tree
Showing 19 changed files with 5,845 additions and 3,674 deletions.
1,513 changes: 1,081 additions & 432 deletions examples/quick-starts/classification/GLMNetCVClassifier.ipynb

Large diffs are not rendered by default.

1,289 changes: 760 additions & 529 deletions examples/quick-starts/classification/XGBoostCVClassifier.ipynb

Large diffs are not rendered by default.

1,153 changes: 695 additions & 458 deletions examples/quick-starts/classification/XGBoostClassifier.ipynb

Large diffs are not rendered by default.

750 changes: 371 additions & 379 deletions examples/quick-starts/metrics/BinaryClassificationMetrics.ipynb

Large diffs are not rendered by default.

213 changes: 112 additions & 101 deletions examples/quick-starts/metrics/RegressionMetrics.ipynb

Large diffs are not rendered by default.

703 changes: 371 additions & 332 deletions examples/quick-starts/optimization/XGBoostBayesianOptimizer.ipynb

Large diffs are not rendered by default.

333 changes: 186 additions & 147 deletions examples/quick-starts/optimization/XGBoostHyperOptimizer.ipynb

Large diffs are not rendered by default.

1,265 changes: 921 additions & 344 deletions examples/quick-starts/regression/GLMNetCVRegressor.ipynb

Large diffs are not rendered by default.

664 changes: 417 additions & 247 deletions examples/quick-starts/regression/XGBoostCVRegressor.ipynb

Large diffs are not rendered by default.

457 changes: 314 additions & 143 deletions examples/quick-starts/regression/XGBoostRegressor.ipynb

Large diffs are not rendered by default.

515 changes: 277 additions & 238 deletions examples/quick-starts/selection/XGBoostFeatureSelector.ipynb

Large diffs are not rendered by default.

176 changes: 88 additions & 88 deletions examples/quick-starts/utils/add_noisy_features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,48 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# `utils.add_noisy_features`"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": 2,
"source": [
"import slickml\n",
"\n",
"print(f\"Loaded SlickML Version = {slickml.__version__}\")"
],
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Loaded SlickML Version = 0.2.0\n"
"Loaded SlickML Version = 0.2.1\n"
]
}
],
"metadata": {}
"source": [
"import slickml\n",
"\n",
"print(f\"Loaded SlickML Version = {slickml.__version__}\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"source": [
"from slickml.utils import add_noisy_features\n",
"\n",
"help(add_noisy_features)"
],
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function add_noisy_features in module slickml.utils._transform:\n",
"\n",
Expand Down Expand Up @@ -88,31 +84,27 @@
]
}
],
"metadata": {}
"source": [
"from slickml.utils import add_noisy_features\n",
"\n",
"help(add_noisy_features)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 1: `add_noisy_features` with `pandas.DataFrame` as the input data"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": 4,
"source": [
"import pandas as pd\n",
"\n",
"df = pd.DataFrame(\n",
" {\n",
" \"foo\": [1, 2, 3, 4, 5],\n",
" }\n",
")\n",
"df"
],
"metadata": {
"scrolled": true
},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": [
"<div>\n",
Expand Down Expand Up @@ -170,24 +162,28 @@
"4 5"
]
},
"execution_count": 4,
"metadata": {},
"execution_count": 4
"output_type": "execute_result"
}
],
"metadata": {
"scrolled": true
}
"source": [
"import pandas as pd\n",
"\n",
"df = pd.DataFrame(\n",
" {\n",
" \"foo\": [1, 2, 3, 4, 5],\n",
" }\n",
")\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 5,
"source": [
"df_noisy = add_noisy_features(df)\n",
"df_noisy"
],
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": [
"<div>\n",
Expand Down Expand Up @@ -251,32 +247,29 @@
"4 5 3"
]
},
"execution_count": 5,
"metadata": {},
"execution_count": 5
"output_type": "execute_result"
}
],
"metadata": {}
"source": [
"df_noisy = add_noisy_features(df)\n",
"df_noisy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example 2: `add_noisy_features` with `numpy.ndarray` as the input data"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": 6,
"source": [
"import numpy as np\n",
"\n",
"np.random.seed(1367)\n",
"X = np.random.rand(4, 3)\n",
"X"
],
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"array([[0.88614473, 0.04571154, 0.66280713],\n",
Expand All @@ -285,22 +278,25 @@
" [0.64470859, 0.91519028, 0.26689842]])"
]
},
"execution_count": 6,
"metadata": {},
"execution_count": 6
"output_type": "execute_result"
}
],
"metadata": {}
"source": [
"import numpy as np\n",
"\n",
"np.random.seed(1367)\n",
"X = np.random.rand(4, 3)\n",
"X"
]
},
{
"cell_type": "code",
"execution_count": 7,
"source": [
"X_noisy = add_noisy_features(X)\n",
"X_noisy"
],
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": [
"<div>\n",
Expand Down Expand Up @@ -378,47 +374,53 @@
"3 0.644709 0.915190 0.266898 0.713585 0.103395 0.767115"
]
},
"execution_count": 7,
"metadata": {},
"execution_count": 7
"output_type": "execute_result"
}
],
"metadata": {}
"source": [
"X_noisy = add_noisy_features(X)\n",
"X_noisy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### TODO: Example 3: `add_noisy_features` with `List[List[float]]` as the input data"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": 8,
"source": [
"X = [\n",
" [1, 2, 3],\n",
" [4, 5, 6],\n",
" [7, 8, 9],\n",
"]\n",
"X"
],
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"[[1, 2, 3], [4, 5, 6], [7, 8, 9]]"
]
},
"execution_count": 8,
"metadata": {},
"execution_count": 8
"output_type": "execute_result"
}
],
"metadata": {}
"source": [
"X = [\n",
" [1, 2, 3],\n",
" [4, 5, 6],\n",
" [7, 8, 9],\n",
"]\n",
"X"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"# This feature is currently not implemented;\n",
"# https://github.com/slickml/slick-ml/issues/107\n",
Expand All @@ -427,23 +429,24 @@
"# Uncomment below once the feature is implemented\n",
"# X_noisy = add_noisy_features(X)\n",
"# X_noisy"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Feel free to add your favorite `Example` via a `pull-request`.\n",
"### More details can be found in our [Contributing Document](https://github.com/slickml/slick-ml/blob/master/CONTRIBUTING.md)."
],
"metadata": {}
]
}
],
"metadata": {
"interpreter": {
"hash": "07bad374b921cdabaf2ef6a1d4ae5a7996d892e7452f8d9d13efced363d002df"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3.9.12 64-bit ('.venv': poetry)"
"display_name": "Python 3.9.12 64-bit ('.venv': poetry)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -455,12 +458,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"interpreter": {
"hash": "07bad374b921cdabaf2ef6a1d4ae5a7996d892e7452f8d9d13efced363d002df"
"version": "3.9.18"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading

0 comments on commit 472b91a

Please sign in to comment.