Last active
December 13, 2025 18:27
-
-
Save thierrymoudiki/19a856e2d9c75d5b4fe57fa332b5e8c9 to your computer and use it in GitHub Desktop.
Loop on all sklearn models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.utils import all_estimators | |
| from tqdm import tqdm | |
| # Get all scikit-learn regressors | |
| estimators = all_estimators(type_filter='regressor') | |
| for name, RegressorClass in tqdm(estimators): | |
| if name in ['MultiOutputRegressor', 'MultiOutputClassifier', 'StackingRegressor', 'StackingClassifier', | |
| 'VotingRegressor', 'VotingClassifier', 'TransformedTargetRegressor', 'RegressorChain', | |
| 'GradientBoostingRegressor', 'HistGradientBoostingRegressor', 'RandomForestRegressor', | |
| 'ExtraTreesRegressor', 'MLPRegressor']: | |
| continue | |
| try: | |
| print(f"name: {name}, class: {RegressorClass}") | |
| except Exception as e: | |
| print(f"Error: {e}") | |
| continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment