ComenzarEmpieza gratis

Analizando la estabilidad de TPOT

Ahora vas a observar la naturaleza aleatoria de TPOT creando el clasificador con diferentes random states y viendo qué modelo considera el algoritmo como el mejor. Esto ayuda a comprobar que TPOT puede ser bastante inestable si no se ejecuta durante un tiempo razonable.

Este ejercicio forma parte del curso

Ajuste de hiperparámetros en Python

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Create the tpot classifier 
tpot_clf = TPOTClassifier(generations=2, population_size=4, offspring_size=3, scoring='accuracy', cv=2,
                          verbosity=2, random_state=____)

# Fit the classifier to the training data
tpot_clf.fit(X_train, y_train)

# Score on the test set
print(tpot_clf.score(X_test, y_test))
Editar y ejecutar código