Skip to content

Commit ff0b119

Browse files
update README: replace Boston dataset with Diabetes dataset and adjust model performance table
1 parent 947c87f commit ff0b119

File tree

2 files changed

+90
-92
lines changed

2 files changed

+90
-92
lines changed

README.md

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ from sklearn import datasets
9191
from sklearn.utils import shuffle
9292
import numpy as np
9393

94-
boston = datasets.load_boston()
95-
X, y = shuffle(boston.data, boston.target, random_state=13)
94+
diabetes = datasets.load_diabetes()
95+
X, y = shuffle(diabetes.data, diabetes.target, random_state=13)
9696
X = X.astype(np.float32)
9797

9898
offset = int(X.shape[0] * 0.9)
@@ -106,47 +106,46 @@ models, predictions = reg.fit(X_train, X_test, y_train, y_test)
106106
print(models)
107107
```
108108

109-
| Model | Adjusted R-Squared | R-Squared | RMSE | Time Taken |
110-
|:------------------------------|-------------------:|----------:|------:|-----------:|
111-
| SVR | 0.83 | 0.88 | 2.62 | 0.01 |
112-
| BaggingRegressor | 0.83 | 0.88 | 2.63 | 0.03 |
113-
| NuSVR | 0.82 | 0.86 | 2.76 | 0.03 |
114-
| RandomForestRegressor | 0.81 | 0.86 | 2.78 | 0.21 |
115-
| XGBRegressor | 0.81 | 0.86 | 2.79 | 0.06 |
116-
| GradientBoostingRegressor | 0.81 | 0.86 | 2.84 | 0.11 |
117-
| ExtraTreesRegressor | 0.79 | 0.84 | 2.98 | 0.12 |
118-
| AdaBoostRegressor | 0.78 | 0.83 | 3.04 | 0.07 |
119-
| HistGradientBoostingRegressor | 0.77 | 0.83 | 3.06 | 0.17 |
120-
| PoissonRegressor | 0.77 | 0.83 | 3.11 | 0.01 |
121-
| LGBMRegressor | 0.77 | 0.83 | 3.11 | 0.07 |
122-
| KNeighborsRegressor | 0.77 | 0.83 | 3.12 | 0.01 |
123-
| DecisionTreeRegressor | 0.65 | 0.74 | 3.79 | 0.01 |
124-
| MLPRegressor | 0.65 | 0.74 | 3.80 | 1.63 |
125-
| HuberRegressor | 0.64 | 0.74 | 3.84 | 0.01 |
126-
| GammaRegressor | 0.64 | 0.73 | 3.88 | 0.01 |
127-
| LinearSVR | 0.62 | 0.72 | 3.96 | 0.01 |
128-
| RidgeCV | 0.62 | 0.72 | 3.97 | 0.01 |
129-
| BayesianRidge | 0.62 | 0.72 | 3.97 | 0.01 |
130-
| Ridge | 0.62 | 0.72 | 3.97 | 0.01 |
131-
| TransformedTargetRegressor | 0.62 | 0.72 | 3.97 | 0.01 |
132-
| LinearRegression | 0.62 | 0.72 | 3.97 | 0.01 |
133-
| ElasticNetCV | 0.62 | 0.72 | 3.98 | 0.04 |
134-
| LassoCV | 0.62 | 0.72 | 3.98 | 0.06 |
135-
| LassoLarsIC | 0.62 | 0.72 | 3.98 | 0.01 |
136-
| LassoLarsCV | 0.62 | 0.72 | 3.98 | 0.02 |
137-
| Lars | 0.61 | 0.72 | 3.99 | 0.01 |
138-
| LarsCV | 0.61 | 0.71 | 4.02 | 0.04 |
139-
| SGDRegressor | 0.60 | 0.70 | 4.07 | 0.01 |
140-
| TweedieRegressor | 0.59 | 0.70 | 4.12 | 0.01 |
141-
| GeneralizedLinearRegressor | 0.59 | 0.70 | 4.12 | 0.01 |
142-
| ElasticNet | 0.58 | 0.69 | 4.16 | 0.01 |
143-
| Lasso | 0.54 | 0.66 | 4.35 | 0.02 |
144-
| RANSACRegressor | 0.53 | 0.65 | 4.41 | 0.04 |
145-
| OrthogonalMatchingPursuitCV | 0.45 | 0.59 | 4.78 | 0.02 |
146-
| PassiveAggressiveRegressor | 0.37 | 0.54 | 5.09 | 0.01 |
147-
| GaussianProcessRegressor | 0.23 | 0.43 | 5.65 | 0.03 |
148-
| OrthogonalMatchingPursuit | 0.16 | 0.38 | 5.89 | 0.01 |
149-
| ExtraTreeRegressor | 0.08 | 0.32 | 6.17 | 0.01 |
150-
| DummyRegressor | -0.38 | -0.02 | 7.56 | 0.01 |
151-
| LassoLars | -0.38 | -0.02 | 7.56 | 0.01 |
152-
| KernelRidge | -11.50 | -8.25 | 22.74 | 0.01 |
109+
| Model | Adjusted R-Squared | R-Squared | RMSE | Time Taken |
110+
|:------------------------------|---------------------:|------------:|---------:|-------------:|
111+
| ExtraTreesRegressor | 0.378921 | 0.520076 | 54.2202 | 0.121466 |
112+
| OrthogonalMatchingPursuitCV | 0.374947 | 0.517004 | 54.3934 | 0.0111742 |
113+
| Lasso | 0.373483 | 0.515873 | 54.457 | 0.00620174 |
114+
| LassoLars | 0.373474 | 0.515866 | 54.4575 | 0.0087235 |
115+
| LarsCV | 0.3715 | 0.514341 | 54.5432 | 0.0160234 |
116+
| LassoCV | 0.370413 | 0.513501 | 54.5903 | 0.0624897 |
117+
| PassiveAggressiveRegressor | 0.366958 | 0.510831 | 54.7399 | 0.00689793 |
118+
| LassoLarsIC | 0.364984 | 0.509306 | 54.8252 | 0.0108321 |
119+
| SGDRegressor | 0.364307 | 0.508783 | 54.8544 | 0.0055306 |
120+
| RidgeCV | 0.363002 | 0.507774 | 54.9107 | 0.00728202 |
121+
| Ridge | 0.363002 | 0.507774 | 54.9107 | 0.00556874 |
122+
| BayesianRidge | 0.362296 | 0.507229 | 54.9411 | 0.0122972 |
123+
| LassoLarsCV | 0.361749 | 0.506806 | 54.9646 | 0.0175984 |
124+
| TransformedTargetRegressor | 0.361749 | 0.506806 | 54.9646 | 0.00604773 |
125+
| LinearRegression | 0.361749 | 0.506806 | 54.9646 | 0.00677514 |
126+
| Lars | 0.358828 | 0.504549 | 55.0903 | 0.00935149 |
127+
| ElasticNetCV | 0.356159 | 0.502486 | 55.2048 | 0.0478678 |
128+
| HuberRegressor | 0.355251 | 0.501785 | 55.2437 | 0.0129263 |
129+
| RandomForestRegressor | 0.349621 | 0.497434 | 55.4844 | 0.2331 |
130+
| AdaBoostRegressor | 0.340416 | 0.490322 | 55.8757 | 0.0512381 |
131+
| LGBMRegressor | 0.339239 | 0.489412 | 55.9255 | 0.0396187 |
132+
| HistGradientBoostingRegressor | 0.335632 | 0.486625 | 56.0779 | 0.0897055 |
133+
| PoissonRegressor | 0.323033 | 0.476889 | 56.6072 | 0.00953603 |
134+
| ElasticNet | 0.301755 | 0.460447 | 57.4899 | 0.00604224 |
135+
| KNeighborsRegressor | 0.299855 | 0.458979 | 57.5681 | 0.00757337 |
136+
| OrthogonalMatchingPursuit | 0.292421 | 0.453235 | 57.8729 | 0.00709486 |
137+
| BaggingRegressor | 0.291213 | 0.452301 | 57.9223 | 0.0302746 |
138+
| GradientBoostingRegressor | 0.247009 | 0.418143 | 59.7011 | 0.136803 |
139+
| TweedieRegressor | 0.244215 | 0.415984 | 59.8118 | 0.00633955 |
140+
| XGBRegressor | 0.224263 | 0.400567 | 60.5961 | 0.339694 |
141+
| GammaRegressor | 0.223895 | 0.400283 | 60.6105 | 0.0235181 |
142+
| RANSACRegressor | 0.203535 | 0.38455 | 61.4004 | 0.0653253 |
143+
| LinearSVR | 0.116707 | 0.317455 | 64.6607 | 0.0077076 |
144+
| ExtraTreeRegressor | 0.00201902 | 0.228833 | 68.7304 | 0.00626636 |
145+
| NuSVR | -0.0667043 | 0.175728 | 71.0575 | 0.0143399 |
146+
| SVR | -0.0964128 | 0.152772 | 72.0402 | 0.0114729 |
147+
| DummyRegressor | -0.297553 | -0.00265478 | 78.3701 | 0.00592971 |
148+
| DecisionTreeRegressor | -0.470263 | -0.136112 | 83.4229 | 0.00749898 |
149+
| GaussianProcessRegressor | -0.769174 | -0.367089 | 91.5109 | 0.0770502 |
150+
| MLPRegressor | -1.86772 | -1.21597 | 116.508 | 0.235267 |
151+
| KernelRidge | -5.03822 | -3.6659 | 169.061 | 0.0243919 |

lazypredict/Supervised.py

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ class LazyRegressor:
444444
>>> from sklearn.utils import shuffle
445445
>>> import numpy as np
446446
447-
>>> boston = datasets.load_boston()
448-
>>> X, y = shuffle(boston.data, boston.target, random_state=13)
447+
>>> diabetes = datasets.load_diabetes()
448+
>>> X, y = shuffle(diabetes.data, diabetes.target, random_state=13)
449449
>>> X = X.astype(np.float32)
450450
451451
>>> offset = int(X.shape[0] * 0.9)
@@ -456,50 +456,49 @@ class LazyRegressor:
456456
>>> models, predictions = reg.fit(X_train, X_test, y_train, y_test)
457457
>>> model_dictionary = reg.provide_models(X_train, X_test, y_train, y_test)
458458
>>> models
459-
| Model | Adjusted R-Squared | R-Squared | RMSE | Time Taken |
460-
|:------------------------------|-------------------:|----------:|------:|-----------:|
461-
| SVR | 0.83 | 0.88 | 2.62 | 0.01 |
462-
| BaggingRegressor | 0.83 | 0.88 | 2.63 | 0.03 |
463-
| NuSVR | 0.82 | 0.86 | 2.76 | 0.03 |
464-
| RandomForestRegressor | 0.81 | 0.86 | 2.78 | 0.21 |
465-
| XGBRegressor | 0.81 | 0.86 | 2.79 | 0.06 |
466-
| GradientBoostingRegressor | 0.81 | 0.86 | 2.84 | 0.11 |
467-
| ExtraTreesRegressor | 0.79 | 0.84 | 2.98 | 0.12 |
468-
| AdaBoostRegressor | 0.78 | 0.83 | 3.04 | 0.07 |
469-
| HistGradientBoostingRegressor | 0.77 | 0.83 | 3.06 | 0.17 |
470-
| PoissonRegressor | 0.77 | 0.83 | 3.11 | 0.01 |
471-
| LGBMRegressor | 0.77 | 0.83 | 3.11 | 0.07 |
472-
| KNeighborsRegressor | 0.77 | 0.83 | 3.12 | 0.01 |
473-
| DecisionTreeRegressor | 0.65 | 0.74 | 3.79 | 0.01 |
474-
| MLPRegressor | 0.65 | 0.74 | 3.80 | 1.63 |
475-
| HuberRegressor | 0.64 | 0.74 | 3.84 | 0.01 |
476-
| GammaRegressor | 0.64 | 0.73 | 3.88 | 0.01 |
477-
| LinearSVR | 0.62 | 0.72 | 3.96 | 0.01 |
478-
| RidgeCV | 0.62 | 0.72 | 3.97 | 0.01 |
479-
| BayesianRidge | 0.62 | 0.72 | 3.97 | 0.01 |
480-
| Ridge | 0.62 | 0.72 | 3.97 | 0.01 |
481-
| TransformedTargetRegressor | 0.62 | 0.72 | 3.97 | 0.01 |
482-
| LinearRegression | 0.62 | 0.72 | 3.97 | 0.01 |
483-
| ElasticNetCV | 0.62 | 0.72 | 3.98 | 0.04 |
484-
| LassoCV | 0.62 | 0.72 | 3.98 | 0.06 |
485-
| LassoLarsIC | 0.62 | 0.72 | 3.98 | 0.01 |
486-
| LassoLarsCV | 0.62 | 0.72 | 3.98 | 0.02 |
487-
| Lars | 0.61 | 0.72 | 3.99 | 0.01 |
488-
| LarsCV | 0.61 | 0.71 | 4.02 | 0.04 |
489-
| SGDRegressor | 0.60 | 0.70 | 4.07 | 0.01 |
490-
| TweedieRegressor | 0.59 | 0.70 | 4.12 | 0.01 |
491-
| GeneralizedLinearRegressor | 0.59 | 0.70 | 4.12 | 0.01 |
492-
| ElasticNet | 0.58 | 0.69 | 4.16 | 0.01 |
493-
| Lasso | 0.54 | 0.66 | 4.35 | 0.02 |
494-
| RANSACRegressor | 0.53 | 0.65 | 4.41 | 0.04 |
495-
| OrthogonalMatchingPursuitCV | 0.45 | 0.59 | 4.78 | 0.02 |
496-
| PassiveAggressiveRegressor | 0.37 | 0.54 | 5.09 | 0.01 |
497-
| GaussianProcessRegressor | 0.23 | 0.43 | 5.65 | 0.03 |
498-
| OrthogonalMatchingPursuit | 0.16 | 0.38 | 5.89 | 0.01 |
499-
| ExtraTreeRegressor | 0.08 | 0.32 | 6.17 | 0.01 |
500-
| DummyRegressor | -0.38 | -0.02 | 7.56 | 0.01 |
501-
| LassoLars | -0.38 | -0.02 | 7.56 | 0.01 |
502-
| KernelRidge | -11.50 | -8.25 | 22.74 | 0.01 |
459+
| Model | Adjusted R-Squared | R-Squared | RMSE | Time Taken |
460+
|:------------------------------|---------------------:|------------:|---------:|-------------:|
461+
| ExtraTreesRegressor | 0.378921 | 0.520076 | 54.2202 | 0.121466 |
462+
| OrthogonalMatchingPursuitCV | 0.374947 | 0.517004 | 54.3934 | 0.0111742 |
463+
| Lasso | 0.373483 | 0.515873 | 54.457 | 0.00620174 |
464+
| LassoLars | 0.373474 | 0.515866 | 54.4575 | 0.0087235 |
465+
| LarsCV | 0.3715 | 0.514341 | 54.5432 | 0.0160234 |
466+
| LassoCV | 0.370413 | 0.513501 | 54.5903 | 0.0624897 |
467+
| PassiveAggressiveRegressor | 0.366958 | 0.510831 | 54.7399 | 0.00689793 |
468+
| LassoLarsIC | 0.364984 | 0.509306 | 54.8252 | 0.0108321 |
469+
| SGDRegressor | 0.364307 | 0.508783 | 54.8544 | 0.0055306 |
470+
| RidgeCV | 0.363002 | 0.507774 | 54.9107 | 0.00728202 |
471+
| Ridge | 0.363002 | 0.507774 | 54.9107 | 0.00556874 |
472+
| BayesianRidge | 0.362296 | 0.507229 | 54.9411 | 0.0122972 |
473+
| LassoLarsCV | 0.361749 | 0.506806 | 54.9646 | 0.0175984 |
474+
| TransformedTargetRegressor | 0.361749 | 0.506806 | 54.9646 | 0.00604773 |
475+
| LinearRegression | 0.361749 | 0.506806 | 54.9646 | 0.00677514 |
476+
| Lars | 0.358828 | 0.504549 | 55.0903 | 0.00935149 |
477+
| ElasticNetCV | 0.356159 | 0.502486 | 55.2048 | 0.0478678 |
478+
| HuberRegressor | 0.355251 | 0.501785 | 55.2437 | 0.0129263 |
479+
| RandomForestRegressor | 0.349621 | 0.497434 | 55.4844 | 0.2331 |
480+
| AdaBoostRegressor | 0.340416 | 0.490322 | 55.8757 | 0.0512381 |
481+
| LGBMRegressor | 0.339239 | 0.489412 | 55.9255 | 0.0396187 |
482+
| HistGradientBoostingRegressor | 0.335632 | 0.486625 | 56.0779 | 0.0897055 |
483+
| PoissonRegressor | 0.323033 | 0.476889 | 56.6072 | 0.00953603 |
484+
| ElasticNet | 0.301755 | 0.460447 | 57.4899 | 0.00604224 |
485+
| KNeighborsRegressor | 0.299855 | 0.458979 | 57.5681 | 0.00757337 |
486+
| OrthogonalMatchingPursuit | 0.292421 | 0.453235 | 57.8729 | 0.00709486 |
487+
| BaggingRegressor | 0.291213 | 0.452301 | 57.9223 | 0.0302746 |
488+
| GradientBoostingRegressor | 0.247009 | 0.418143 | 59.7011 | 0.136803 |
489+
| TweedieRegressor | 0.244215 | 0.415984 | 59.8118 | 0.00633955 |
490+
| XGBRegressor | 0.224263 | 0.400567 | 60.5961 | 0.339694 |
491+
| GammaRegressor | 0.223895 | 0.400283 | 60.6105 | 0.0235181 |
492+
| RANSACRegressor | 0.203535 | 0.38455 | 61.4004 | 0.0653253 |
493+
| LinearSVR | 0.116707 | 0.317455 | 64.6607 | 0.0077076 |
494+
| ExtraTreeRegressor | 0.00201902 | 0.228833 | 68.7304 | 0.00626636 |
495+
| NuSVR | -0.0667043 | 0.175728 | 71.0575 | 0.0143399 |
496+
| SVR | -0.0964128 | 0.152772 | 72.0402 | 0.0114729 |
497+
| DummyRegressor | -0.297553 | -0.00265478 | 78.3701 | 0.00592971 |
498+
| DecisionTreeRegressor | -0.470263 | -0.136112 | 83.4229 | 0.00749898 |
499+
| GaussianProcessRegressor | -0.769174 | -0.367089 | 91.5109 | 0.0770502 |
500+
| MLPRegressor | -1.86772 | -1.21597 | 116.508 | 0.235267 |
501+
| KernelRidge | -5.03822 | -3.6659 | 169.061 | 0.0243919 |
503502
"""
504503

505504
def __init__(

0 commit comments

Comments
 (0)