Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,15 +38,8 @@ from tensorflow.keras.callbacks import ReduceLROnPlateau, EarlyStopping
|
|
| 38 |
def GRUModel(trainX, trainy, testX=None, testy=None, epochs=1000, batch_size=64, learning_rate=0.0001,
|
| 39 |
l1_reg=0.001, l2_reg=0.001, dropout_rate=0.2, feature_selection=True, top_k=10):
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
rf = RandomForestRegressor(n_estimators=100, random_state=42)
|
| 44 |
-
rf.fit(trainX, trainy)
|
| 45 |
-
feature_importances = rf.feature_importances_
|
| 46 |
-
important_indices = np.argsort(feature_importances)[-top_k:] # Select top-k features
|
| 47 |
-
trainX = trainX[:, important_indices]
|
| 48 |
-
if testX is not None:
|
| 49 |
-
testX = testX[:, important_indices]
|
| 50 |
|
| 51 |
# Scale the input data
|
| 52 |
scaler = MinMaxScaler()
|
|
|
|
| 38 |
def GRUModel(trainX, trainy, testX=None, testy=None, epochs=1000, batch_size=64, learning_rate=0.0001,
|
| 39 |
l1_reg=0.001, l2_reg=0.001, dropout_rate=0.2, feature_selection=True, top_k=10):
|
| 40 |
|
| 41 |
+
|
| 42 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
# Scale the input data
|
| 45 |
scaler = MinMaxScaler()
|