From 34f704c8fe4c66856d0273f49039f2d9d922feee Mon Sep 17 00:00:00 2001 From: jdvala <24193355+jdvala@users.noreply.github.com> Date: Sat, 19 Feb 2022 11:12:52 +0100 Subject: [PATCH] Add rich based console output --- .gitignore | 1 + README.md | 75 +++++++++++++++--------------- requirements/prod.txt | 2 +- src/lazytext/_repo_version.py | 2 +- src/lazytext/create_table.py | 86 +++++++++++++++++++---------------- src/lazytext/supervised.py | 82 +++++++++++++++++---------------- 6 files changed, 131 insertions(+), 117 deletions(-) diff --git a/.gitignore b/.gitignore index cedf6ab..83cf83a 100644 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ dask-worker-space # virtualenv .venv venv/ +env/ ENV/ # Spyder project settings diff --git a/README.md b/README.md index c12e8f1..826be7e 100644 --- a/README.md +++ b/README.md @@ -90,42 +90,45 @@ lazy_text = LazyTextPredict( models = lazy_text.fit(x_train, x_test, y_train, y_test) -Label Analysis -| Classes | Weights | -|--------------------:|---------------------:| -| tech | 0.8725490196078431 | -| politics | 1.1528497409326426 | -| sport | 1.0671462829736211 | -| entertainment | 0.8708414872798435 | -| business | 1.1097256857855362 | - - Result Analysis -| Model | Accuracy | Balanced Accuracy | F1 Score | Custom Metric Score | Time Taken | -| ----------------------------: | -------------------:| -------------------:| -------------------:| -------------------:| -------------------:| -| AdaBoostClassifier | 0.7260479041916168 | 0.717737172132769 | 0.7248335989941609 | NA | 1.829047679901123 | -| BaggingClassifier | 0.8817365269461078 | 0.8796633962363677 | 0.8814695332332374 | NA | 3.5215072631835938 | -| BernoulliNB | 0.9535928143712575 | 0.9505929193425733 | 0.9533647387436917 | NA | 0.020041465759277344| -| CalibratedClassifierCV | 0.9760479041916168 | 0.9760018220340847 | 0.9755904096436046 | NA | 0.4990670680999756 | -| ComplementNB | 0.9760479041916168 | 0.9752329192546583 | 0.9754237510855159 | NA | 0.013598203659057617| -| DecisionTreeClassifier | 0.8532934131736527 | 0.8473956671194278 | 0.8496464898940103 | NA | 0.478792667388916 | -| DummyClassifier | 0.2155688622754491 | 0.2 | 0.07093596059113301 | NA | 0.008046865463256836| -| ExtraTreeClassifier | 0.7275449101796407 | 0.7253518459908658 | 0.7255575847020816 | NA | 0.026398658752441406| -| ExtraTreesClassifier | 0.9655688622754491 | 0.9635363285903302 | 0.9649837485086689 | NA | 1.6907336711883545 | -| GradientBoostingClassifier | 0.9565868263473054 | 0.9543725191544354 | 0.9554606292723953 | NA | 39.16400766372681 | -| KNeighborsClassifier | 0.938622754491018 | 0.9370053693959814 | 0.9367294513157219 | NA | 0.14803171157836914 | -| LinearSVC | 0.9745508982035929 | 0.974262691599302 | 0.9740343976103922 | NA | 0.10053229331970215 | -| LogisticRegression | 0.968562874251497 | 0.9668995859213251 | 0.9678778814908909 | NA | 2.9565982818603516 | -| LogisticRegressionCV | 0.9715568862275449 | 0.9708896757262861 | 0.971147482393915 | NA | 109.64091444015503 | -| MLPClassifier | 0.9760479041916168 | 0.9753381642512078 | 0.9752912960666735 | NA | 35.64296746253967 | -| MultinomialNB | 0.9700598802395209 | 0.9678795721187026 | 0.9689200656860745 | NA | 0.024427413940429688| -| NearestCentroid | 0.9520958083832335 | 0.9499045135454718 | 0.9515097876015481 | NA | 0.024636268615722656| -| NuSVC | 0.9670658682634731 | 0.9656159420289855 | 0.9669719954040374 | NA | 8.287142515182495 | -| PassiveAggressiveClassifier | 0.9775449101796407 | 0.9772388820754925 | 0.9770812340935414 | NA | 0.10332632064819336 | -| Perceptron | 0.9775449101796407 | 0.9769254658385094 | 0.9768161404324825 | NA | 0.07216000556945801 | -| RandomForestClassifier | 0.9625748502994012 | 0.9605135542632081 | 0.9624462948504477 | NA | 1.2427525520324707 | -| RidgeClassifier | 0.9775449101796407 | 0.9769254658385093 | 0.9769176825464448 | NA | 0.17272400856018066 | -| SGDClassifier | 0.9700598802395209 | 0.9695007868373973 | 0.969787370271274 | NA | 0.13134551048278809 | -| SVC | 0.9715568862275449 | 0.9703778467908902 | 0.9713021262026043 | NA | 8.388679027557373 | + Label Analysis +┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ +┃ Classes ┃ Weights ┃ +┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ +│ business │ 0.8725490196078431 │ +│ sport │ 1.1528497409326426 │ +│ politics │ 1.0671462829736211 │ +│ entertainment │ 0.8708414872798435 │ +│ tech │ 1.1097256857855362 │ +└───────────────┴────────────────────┘ + Result Analysis +┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓ +┃ Model ┃ Accuracy ┃ Balanced Accuracy ┃ F1 Score ┃ Custom Metric Score ┃ Time Taken ┃ +┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩ +│ AdaBoostClassifier │ 0.7260479041916168 │ 0.717737172132769 │ 0.7248335989941609 │ NA │ 1.4244091510772705 │ +│ BaggingClassifier │ 0.8817365269461078 │ 0.8796633962363677 │ 0.8814695332332374 │ NA │ 2.422576904296875 │ +│ BernoulliNB │ 0.9535928143712575 │ 0.9505929193425733 │ 0.9533647387436917 │ NA │ 0.015914201736450195 │ +│ CalibratedClassifierCV │ 0.9760479041916168 │ 0.9760018220340847 │ 0.9755904096436046 │ NA │ 0.36926722526550293 │ +│ ComplementNB │ 0.9760479041916168 │ 0.9752329192546583 │ 0.9754237510855159 │ NA │ 0.009947061538696289 │ +│ DecisionTreeClassifier │ 0.8532934131736527 │ 0.8473956671194278 │ 0.8496464898940103 │ NA │ 0.34440088272094727 │ +│ DummyClassifier │ 0.2155688622754491 │ 0.2 │ 0.07093596059113301 │ NA │ 0.005555868148803711 │ +│ ExtraTreeClassifier │ 0.7275449101796407 │ 0.7253518459908658 │ 0.7255575847020816 │ NA │ 0.018934965133666992 │ +│ ExtraTreesClassifier │ 0.9655688622754491 │ 0.9635363285903302 │ 0.9649837485086689 │ NA │ 1.2101161479949951 │ +│ GradientBoostingClassifier │ 0.9550898203592815 │ 0.9526333887196529 │ 0.9539060578037555 │ NA │ 30.256237030029297 │ +│ KNeighborsClassifier │ 0.938622754491018 │ 0.9370053693959814 │ 0.9367294513157219 │ NA │ 0.12071108818054199 │ +│ LinearSVC │ 0.9745508982035929 │ 0.974262691599302 │ 0.9740343976103922 │ NA │ 0.11713886260986328 │ +│ LogisticRegression │ 0.968562874251497 │ 0.9668995859213251 │ 0.9678778814908909 │ NA │ 0.8916082382202148 │ +│ LogisticRegressionCV │ 0.9715568862275449 │ 0.9708896757262861 │ 0.971147482393915 │ NA │ 37.82431483268738 │ +│ MLPClassifier │ 0.9760479041916168 │ 0.9753381642512078 │ 0.9752912960666735 │ NA │ 30.700589656829834 │ +│ MultinomialNB │ 0.9700598802395209 │ 0.9678795721187026 │ 0.9689200656860745 │ NA │ 0.01410818099975586 │ +│ NearestCentroid │ 0.9520958083832335 │ 0.9499045135454718 │ 0.9515097876015481 │ NA │ 0.018617868423461914 │ +│ NuSVC │ 0.9670658682634731 │ 0.9656159420289855 │ 0.9669719954040374 │ NA │ 6.941549062728882 │ +│ PassiveAggressiveClassifier │ 0.9775449101796407 │ 0.9772388820754925 │ 0.9770812340935414 │ NA │ 0.05249309539794922 │ +│ Perceptron │ 0.9775449101796407 │ 0.9769254658385094 │ 0.9768161404324825 │ NA │ 0.030637741088867188 │ +│ RandomForestClassifier │ 0.9625748502994012 │ 0.9605135542632081 │ 0.9624462948504477 │ NA │ 0.9921820163726807 │ +│ RidgeClassifier │ 0.9775449101796407 │ 0.9769254658385093 │ 0.9769176825464448 │ NA │ 0.09582686424255371 │ +│ SGDClassifier │ 0.9700598802395209 │ 0.9695007868373973 │ 0.969787370271274 │ NA │ 0.04686570167541504 │ +│ SVC │ 0.9715568862275449 │ 0.9703778467908902 │ 0.9713021262026043 │ NA │ 6.64256477355957 │ +└─────────────────────────────┴────────────────────┴────────────────────┴─────────────────────┴─────────────────────┴──────────────────────┘ ``` Result of each estimator is stored in `models` which is a list and each trained estimator is also returned which can be used further for analysis. diff --git a/requirements/prod.txt b/requirements/prod.txt index 979f400..5efa9b8 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -1,3 +1,3 @@ scikit-learn==1.0.1 -tqdm==4.62.3 +rich==11.2.0 pandas==1.3.5 diff --git a/src/lazytext/_repo_version.py b/src/lazytext/_repo_version.py index 4eb5cc6..c5815f9 100644 --- a/src/lazytext/_repo_version.py +++ b/src/lazytext/_repo_version.py @@ -1 +1 @@ -version = "0.1.dev1+dirty" +version = "0.0.2.dev2+dirty" diff --git a/src/lazytext/create_table.py b/src/lazytext/create_table.py index 211e410..577ad47 100644 --- a/src/lazytext/create_table.py +++ b/src/lazytext/create_table.py @@ -1,5 +1,8 @@ import typing as tt +from rich.console import Console +from rich.table import Table + def create_table(results: tt.Dict, label_analysis: tt.Dict = None): """Create summary table for all the results. @@ -7,56 +10,61 @@ def create_table(results: tt.Dict, label_analysis: tt.Dict = None): Example: Results: ``` - | Model | Accuracy | Balanced Accuracy | Time Taken | - | -------------------: | -------------------: | -------------------: | -------------------: | - | MultinomialNB | 0.641908620301598 | 0.62653122841884 | 0.03511333465576172 | + Label Analysis + ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ + ┃ Classes ┃ Weights ┃ + ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ + │ entertainment │ 0.8725490196078431 │ + │ sport │ 1.1528497409326426 │ + │ business │ 1.0671462829736211 │ + │ tech │ 0.8708414872798435 │ + │ politics │ 1.1097256857855362 │ + └───────────────┴────────────────────┘ + Result Analysis + ┏━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ + ┃ Model ┃ Accuracy ┃ Balanced Accuracy ┃ F1 Score ┃ Custom Metric Score ┃ Time Taken ┃ + ┡━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ + │ SVC │ 0.23502994011976047 │ 0.2184410069760388 │ 0.10772097568020063 │ NA │ 6.808304071426392 │ + └───────┴─────────────────────┴────────────────────┴─────────────────────┴─────────────────────┴───────────────────┘ ``` - Label Analysis - Args: results: Dictonary of all the results label_analysis: Analysis of the labels """ - result_format = "| {:<30}| {:<20}| {:<20}| {:<20}| {:<20}| {:<20}|" - label_format = "| {:<20}| {:<20} |" - - # Class weights + console = Console() if label_analysis: - print("\n Label Analysis") - print(label_format.format("Classes", "Weights")) - print("|--------------------:|---------------------:|") + label_table = Table(title="Label Analysis") + label_table.add_column("Classes", justify="left", style="cyan", no_wrap=True) + label_table.add_column("Weights", justify="left", style="magenta", no_wrap=True) + for name, weight in label_analysis.items(): - print(label_format.format(name, weight)) - - # Result - print("\n Result Analysis") - - print( - result_format.format( - "Model", - "Accuracy", - "Balanced Accuracy", - "F1 Score", - "Custom Metric Score", - "Time Taken", - ) - ) - print( - result_format.format( - "----------------------------:", - "-------------------:", - "-------------------:", - "-------------------:", - "-------------------:", - "-------------------:", - ) + label_table.add_row(str(name), str(weight)) + + console.print(label_table) + + result_table = Table(title="Result Analysis") + result_table.add_column("Model", justify="left", style="cyan", no_wrap=True) + result_table.add_column("Accuracy", justify="left", style="magenta", no_wrap=True) + result_table.add_column( + "Balanced Accuracy", justify="left", style="green", no_wrap=True ) + result_table.add_column("F1 Score", justify="left", style="red", no_wrap=True) + result_table.add_column("Custom Metric Score", justify="left", style="yellow") + result_table.add_column("Time Taken", justify="left", style="white") + for result in results: temp = [] for key, value in result.items(): temp.append(value) - print( - result_format.format(temp[0], temp[1], temp[2], temp[3], temp[4], temp[5]) + + result_table.add_row( + str(temp[0]), + str(temp[1]), + str(temp[2]), + str(temp[3]), + str(temp[4]), + str(temp[5]), ) - print("\n") + + console.print(result_table) diff --git a/src/lazytext/supervised.py b/src/lazytext/supervised.py index a56b33e..c72d35b 100644 --- a/src/lazytext/supervised.py +++ b/src/lazytext/supervised.py @@ -6,10 +6,10 @@ import numpy as np import sklearn +from rich.progress import track from sklearn.preprocessing import LabelEncoder from sklearn.utils import all_estimators from sklearn.utils.class_weight import compute_class_weight -from tqdm import tqdm from lazytext.create_table import create_table @@ -115,43 +115,45 @@ class LazyTextPredict: models = lazy_text.fit(x_train, x_test, y_train, y_test) - Label Analysis - | Classes | Weights | - |--------------------:|---------------------:| - | tech | 0.8725490196078431 | - | politics | 1.1528497409326426 | - | sport | 1.0671462829736211 | - | entertainment | 0.8708414872798435 | - | business | 1.1097256857855362 | - - Result Analysis - | Model | Accuracy | Balanced Accuracy | F1 Score | Custom Metric Score | Time Taken | - | ----------------------------: | -------------------:| -------------------:| -------------------:| -------------------:| -------------------:| - | AdaBoostClassifier | 0.7260479041916168 | 0.717737172132769 | 0.7248335989941609 | NA | 1.829047679901123 | - | BaggingClassifier | 0.8817365269461078 | 0.8796633962363677 | 0.8814695332332374 | NA | 3.5215072631835938 | - | BernoulliNB | 0.9535928143712575 | 0.9505929193425733 | 0.9533647387436917 | NA | 0.020041465759277344| - | CalibratedClassifierCV | 0.9760479041916168 | 0.9760018220340847 | 0.9755904096436046 | NA | 0.4990670680999756 | - | ComplementNB | 0.9760479041916168 | 0.9752329192546583 | 0.9754237510855159 | NA | 0.013598203659057617| - | DecisionTreeClassifier | 0.8532934131736527 | 0.8473956671194278 | 0.8496464898940103 | NA | 0.478792667388916 | - | DummyClassifier | 0.2155688622754491 | 0.2 | 0.07093596059113301 | NA | 0.008046865463256836| - | ExtraTreeClassifier | 0.7275449101796407 | 0.7253518459908658 | 0.7255575847020816 | NA | 0.026398658752441406| - | ExtraTreesClassifier | 0.9655688622754491 | 0.9635363285903302 | 0.9649837485086689 | NA | 1.6907336711883545 | - | GradientBoostingClassifier | 0.9565868263473054 | 0.9543725191544354 | 0.9554606292723953 | NA | 39.16400766372681 | - | KNeighborsClassifier | 0.938622754491018 | 0.9370053693959814 | 0.9367294513157219 | NA | 0.14803171157836914 | - | LinearSVC | 0.9745508982035929 | 0.974262691599302 | 0.9740343976103922 | NA | 0.10053229331970215 | - | LogisticRegression | 0.968562874251497 | 0.9668995859213251 | 0.9678778814908909 | NA | 2.9565982818603516 | - | LogisticRegressionCV | 0.9715568862275449 | 0.9708896757262861 | 0.971147482393915 | NA | 109.64091444015503 | - | MLPClassifier | 0.9760479041916168 | 0.9753381642512078 | 0.9752912960666735 | NA | 35.64296746253967 | - | MultinomialNB | 0.9700598802395209 | 0.9678795721187026 | 0.9689200656860745 | NA | 0.024427413940429688| - | NearestCentroid | 0.9520958083832335 | 0.9499045135454718 | 0.9515097876015481 | NA | 0.024636268615722656| - | NuSVC | 0.9670658682634731 | 0.9656159420289855 | 0.9669719954040374 | NA | 8.287142515182495 | - | PassiveAggressiveClassifier | 0.9775449101796407 | 0.9772388820754925 | 0.9770812340935414 | NA | 0.10332632064819336 | - | Perceptron | 0.9775449101796407 | 0.9769254658385094 | 0.9768161404324825 | NA | 0.07216000556945801 | - | RandomForestClassifier | 0.9625748502994012 | 0.9605135542632081 | 0.9624462948504477 | NA | 1.2427525520324707 | - | RidgeClassifier | 0.9775449101796407 | 0.9769254658385093 | 0.9769176825464448 | NA | 0.17272400856018066 | - | SGDClassifier | 0.9700598802395209 | 0.9695007868373973 | 0.969787370271274 | NA | 0.13134551048278809 | - | SVC | 0.9715568862275449 | 0.9703778467908902 | 0.9713021262026043 | NA | 8.388679027557373 | - + Label Analysis + ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ + ┃ Classes ┃ Weights ┃ + ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ + │ business │ 0.8725490196078431 │ + │ sport │ 1.1528497409326426 │ + │ politics │ 1.0671462829736211 │ + │ entertainment │ 0.8708414872798435 │ + │ tech │ 1.1097256857855362 │ + └───────────────┴────────────────────┘ + Result Analysis + ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┓ + ┃ Model ┃ Accuracy ┃ Balanced Accuracy ┃ F1 Score ┃ Custom Metric Score ┃ Time Taken ┃ + ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┩ + │ AdaBoostClassifier │ 0.7260479041916168 │ 0.717737172132769 │ 0.7248335989941609 │ NA │ 1.4244091510772705 │ + │ BaggingClassifier │ 0.8817365269461078 │ 0.8796633962363677 │ 0.8814695332332374 │ NA │ 2.422576904296875 │ + │ BernoulliNB │ 0.9535928143712575 │ 0.9505929193425733 │ 0.9533647387436917 │ NA │ 0.015914201736450195 │ + │ CalibratedClassifierCV │ 0.9760479041916168 │ 0.9760018220340847 │ 0.9755904096436046 │ NA │ 0.36926722526550293 │ + │ ComplementNB │ 0.9760479041916168 │ 0.9752329192546583 │ 0.9754237510855159 │ NA │ 0.009947061538696289 │ + │ DecisionTreeClassifier │ 0.8532934131736527 │ 0.8473956671194278 │ 0.8496464898940103 │ NA │ 0.34440088272094727 │ + │ DummyClassifier │ 0.2155688622754491 │ 0.2 │ 0.07093596059113301 │ NA │ 0.005555868148803711 │ + │ ExtraTreeClassifier │ 0.7275449101796407 │ 0.7253518459908658 │ 0.7255575847020816 │ NA │ 0.018934965133666992 │ + │ ExtraTreesClassifier │ 0.9655688622754491 │ 0.9635363285903302 │ 0.9649837485086689 │ NA │ 1.2101161479949951 │ + │ GradientBoostingClassifier │ 0.9550898203592815 │ 0.9526333887196529 │ 0.9539060578037555 │ NA │ 30.256237030029297 │ + │ KNeighborsClassifier │ 0.938622754491018 │ 0.9370053693959814 │ 0.9367294513157219 │ NA │ 0.12071108818054199 │ + │ LinearSVC │ 0.9745508982035929 │ 0.974262691599302 │ 0.9740343976103922 │ NA │ 0.11713886260986328 │ + │ LogisticRegression │ 0.968562874251497 │ 0.9668995859213251 │ 0.9678778814908909 │ NA │ 0.8916082382202148 │ + │ LogisticRegressionCV │ 0.9715568862275449 │ 0.9708896757262861 │ 0.971147482393915 │ NA │ 37.82431483268738 │ + │ MLPClassifier │ 0.9760479041916168 │ 0.9753381642512078 │ 0.9752912960666735 │ NA │ 30.700589656829834 │ + │ MultinomialNB │ 0.9700598802395209 │ 0.9678795721187026 │ 0.9689200656860745 │ NA │ 0.01410818099975586 │ + │ NearestCentroid │ 0.9520958083832335 │ 0.9499045135454718 │ 0.9515097876015481 │ NA │ 0.018617868423461914 │ + │ NuSVC │ 0.9670658682634731 │ 0.9656159420289855 │ 0.9669719954040374 │ NA │ 6.941549062728882 │ + │ PassiveAggressiveClassifier │ 0.9775449101796407 │ 0.9772388820754925 │ 0.9770812340935414 │ NA │ 0.05249309539794922 │ + │ Perceptron │ 0.9775449101796407 │ 0.9769254658385094 │ 0.9768161404324825 │ NA │ 0.030637741088867188 │ + │ RandomForestClassifier │ 0.9625748502994012 │ 0.9605135542632081 │ 0.9624462948504477 │ NA │ 0.9921820163726807 │ + │ RidgeClassifier │ 0.9775449101796407 │ 0.9769254658385093 │ 0.9769176825464448 │ NA │ 0.09582686424255371 │ + │ SGDClassifier │ 0.9700598802395209 │ 0.9695007868373973 │ 0.969787370271274 │ NA │ 0.04686570167541504 │ + │ SVC │ 0.9715568862275449 │ 0.9703778467908902 │ 0.9713021262026043 │ NA │ 6.64256477355957 │ + └─────────────────────────────┴────────────────────┴────────────────────┴─────────────────────┴─────────────────────┴──────────────────────┘ """ def __init__( @@ -354,8 +356,8 @@ def fit(self, x_train, x_test, y_train, y_test): logger.info("Checking labels.") y_train, y_test = self._check_and_convert_labels(y_train, y_test) - for name, estimator in tqdm(models.items()): - print(f"Processing {name} estimator") + for name, estimator in track(models.items(), description="Training..."): + print(f" Training {name} estimator") model = estimator() # check if there are model parameters