Skip to content

Instantly share code, notes, and snippets.

@amandaiglesiasmoreno
Created November 22, 2021 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandaiglesiasmoreno/e20a4f052cf48e4a163db3eeb7d1fcd6 to your computer and use it in GitHub Desktop.
Save amandaiglesiasmoreno/e20a4f052cf48e4a163db3eeb7d1fcd6 to your computer and use it in GitHub Desktop.
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