-
-
Save letthedataconfess/2ff8a07a444eee8677a0af55a584da7a to your computer and use it in GitHub Desktop.
This file contains 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 import linear_model | |
from sklearn.ensemble import RandomForestRegressor | |
from genetic_selection import GeneticSelectionCV | |
estimator = linear_model.LinearRegression() | |
selector = GeneticSelectionCV(estimator,cv=5, | |
verbose=1, | |
scoring="r2", | |
max_features=10, | |
n_population=50, | |
crossover_proba=0.5, | |
mutation_proba=0.2, | |
n_generations=40, | |
crossover_independent_proba=0.5, | |
mutation_independent_proba=0.05, | |
tournament_size=3, | |
n_gen_no_change=10, | |
caching=True, | |
n_jobs=-1) | |
selector = selector.fit(x_train, y_train) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment