ageron / ageron/handson-ml2

Chapter 4: Early Stopping

Abierto
#226 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
30k
Forks
13.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

In the book is not mentioned to use the method ravel in the y_train, but if I don't use it the code crushes. The variables X_train, x_val, y_train and y_val, I created them with the method split.

X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2)

for epoch in range(1000):
sgd_reg.fit(X_train_poly_scaled, y_train.ravel()) # continues where it left off
y_val_predict = sgd_reg.predict(X_val_poly_scaled)
val_error = mean_squared_error(y_val, y_val_predict)
if val_error < minimum_val_error:
minimum_val_error = val_error
best_epoch = epoch
best_model = deepcopy(sgd_reg)

If I'm doing something wrong please can anyone tell me what I'm doing wrong!!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.