Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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