Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,7 +23,8 @@ X_test = scaler.transform(X_test)
|
|
| 23 |
|
| 24 |
# Construir el modelo
|
| 25 |
model = Sequential([
|
| 26 |
-
Dense(
|
|
|
|
| 27 |
Dense(3, activation='softmax') # Capa de salida con 3 neuronas para las clases de iris
|
| 28 |
])
|
| 29 |
|
|
@@ -33,7 +34,7 @@ model.compile(optimizer='adam',
|
|
| 33 |
metrics=['accuracy'])
|
| 34 |
|
| 35 |
# Entrenar el modelo
|
| 36 |
-
model.fit(X_train, y_train, epochs=
|
| 37 |
|
| 38 |
# Definir una funci贸n para la predicci贸n
|
| 39 |
def predict_iris_species(sepal_length, sepal_width, petal_length, petal_width):
|
|
|
|
| 23 |
|
| 24 |
# Construir el modelo
|
| 25 |
model = Sequential([
|
| 26 |
+
Dense(20, activation='relu', input_dim=4), # Capa oculta con 10 neuronas y funci贸n de activaci贸n ReLU
|
| 27 |
+
Dense(10, activation='relu'), # Capa oculta con 10 neuronas y funci贸n de activaci贸n ReLU
|
| 28 |
Dense(3, activation='softmax') # Capa de salida con 3 neuronas para las clases de iris
|
| 29 |
])
|
| 30 |
|
|
|
|
| 34 |
metrics=['accuracy'])
|
| 35 |
|
| 36 |
# Entrenar el modelo
|
| 37 |
+
model.fit(X_train, y_train, epochs=15, batch_size=32, validation_data=(X_test, y_test))
|
| 38 |
|
| 39 |
# Definir una funci贸n para la predicci贸n
|
| 40 |
def predict_iris_species(sepal_length, sepal_width, petal_length, petal_width):
|