Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anhquan0412 committed Jul 15, 2024
1 parent bef1b6e commit 643c6a3
Show file tree
Hide file tree
Showing 6 changed files with 2,949 additions and 521 deletions.
26 changes: 12 additions & 14 deletions nbs/02_ml_helpers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"> multi_class='multinomial', solver='newton-cg',\n",
"> penalty=None, max_iter=10000, return_coef=False)\n",
"\n",
"Perform Sklearn logistic regression, then print coefficients and classification report\n",
"*Perform Sklearn logistic regression, then print coefficients and classification report*\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
Expand All @@ -157,7 +157,7 @@
"> multi_class='multinomial', solver='newton-cg',\n",
"> penalty=None, max_iter=10000, return_coef=False)\n",
"\n",
"Perform Sklearn logistic regression, then print coefficients and classification report\n",
"*Perform Sklearn logistic regression, then print coefficients and classification report*\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
Expand Down Expand Up @@ -215,15 +215,15 @@
"text/markdown": [
"---\n",
"\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L71){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L67){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### run_multinomial_statmodel\n",
"\n",
"> run_multinomial_statmodel (X_trn:pandas.core.frame.DataFrame,\n",
"> y_trn:pandas.core.series.Series|numpy.ndarray,\n",
"> add_constant=True)\n",
"\n",
"Perform multinominal logit from statsmodel, then print results and classification report\n",
"*Perform multinominal logit from statsmodel, then print results and classification report*\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
Expand All @@ -234,15 +234,15 @@
"text/plain": [
"---\n",
"\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L71){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L67){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### run_multinomial_statmodel\n",
"\n",
"> run_multinomial_statmodel (X_trn:pandas.core.frame.DataFrame,\n",
"> y_trn:pandas.core.series.Series|numpy.ndarray,\n",
"> add_constant=True)\n",
"\n",
"Perform multinominal logit from statsmodel, then print results and classification report\n",
"*Perform multinominal logit from statsmodel, then print results and classification report*\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
Expand Down Expand Up @@ -329,11 +329,9 @@
" \n",
" # plot residual plot\n",
" plot_residuals(_model,X_trn,y_trn,X_test,y_test,\n",
" is_fit=True,\n",
" qqplot=True)\n",
" else:\n",
" plot_residuals(_model,X_trn,y_trn,\n",
" is_fit=True,\n",
" qqplot=True)\n",
"\n",
" # For classification\n",
Expand Down Expand Up @@ -376,7 +374,7 @@
"text/markdown": [
"---\n",
"\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L90){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L86){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### run_sklearn_model\n",
"\n",
Expand All @@ -403,7 +401,7 @@
"text/plain": [
"---\n",
"\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L90){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L86){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### run_sklearn_model\n",
"\n",
Expand Down Expand Up @@ -497,7 +495,7 @@
"text/markdown": [
"---\n",
"\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L189){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L183){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### tune_sklearn_model\n",
"\n",
Expand All @@ -508,7 +506,7 @@
"> random_cv_iter=None, scoring=None, seed=42,\n",
"> rank_show=10, show_split_scores=True)\n",
"\n",
"Perform either Sklearn's Grid Search or Randomized Search (based on random_cv_iter) of the model using param_grid\n",
"*Perform either Sklearn's Grid Search or Randomized Search (based on random_cv_iter) of the model using param_grid*\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
Expand All @@ -527,7 +525,7 @@
"text/plain": [
"---\n",
"\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L189){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"[source](https://github.com/anhquan0412/that-ml-library/blob/main/that_ml_library/ml_helpers.py#L183){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
"\n",
"### tune_sklearn_model\n",
"\n",
Expand All @@ -538,7 +536,7 @@
"> random_cv_iter=None, scoring=None, seed=42,\n",
"> rank_show=10, show_split_scores=True)\n",
"\n",
"Perform either Sklearn's Grid Search or Randomized Search (based on random_cv_iter) of the model using param_grid\n",
"*Perform either Sklearn's Grid Search or Randomized Search (based on random_cv_iter) of the model using param_grid*\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
Expand Down
3,435 changes: 2,933 additions & 502 deletions nbs/03_chart_plotting.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions nbs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ website:
sidebar:
contents:
- index.ipynb
- 00_end_to_end_example.ipynb
- 01_data_preprocess.ipynb
- 02_ml_helpers.ipynb
- 03_chart_plotting.ipynb
Expand Down
4 changes: 2 additions & 2 deletions settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
### Python library ###
repo = that-ml-library
lib_name = %(repo)s
version = 0.0.5
min_python = 3.8
version = 0.0.6
min_python = 3.9
license = apache2
black_formatting = False

Expand Down
2 changes: 1 addition & 1 deletion that_ml_library/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.5"
__version__ = "0.0.6"
2 changes: 0 additions & 2 deletions that_ml_library/ml_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,9 @@ def run_sklearn_model(model_name:str, # sklearn's Machine Learning model to try.

# plot residual plot
plot_residuals(_model,X_trn,y_trn,X_test,y_test,
is_fit=True,
qqplot=True)
else:
plot_residuals(_model,X_trn,y_trn,
is_fit=True,
qqplot=True)

# For classification
Expand Down

0 comments on commit 643c6a3

Please sign in to comment.