-
-
Save amandaiglesiasmoreno/e20a4f052cf48e4a163db3eeb7d1fcd6 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
def create_models(seed=2): | |
''' | |
Create a list of machine learning models. | |
Parameters: | |
seed (integer): random seed of the models | |
Returns: | |
models (list): list containing the models | |
''' | |
models = [] | |
models.append(('dummy_classifier', DummyClassifier(random_state=seed, strategy='most_frequent'))) | |
models.append(('k_nearest_neighbors', KNeighborsClassifier())) | |
models.append(('logistic_regression', LogisticRegression(random_state=seed))) | |
models.append(('support_vector_machines', SVC(random_state=seed))) | |
models.append(('random_forest', RandomForestClassifier(random_state=seed))) | |
models.append(('gradient_boosting', GradientBoostingClassifier(random_state=seed))) | |
return models | |
# create a list with all the algorithms we are going to assess | |
models = create_models() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment