Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,22 @@ for i in range(60, len(train_data)):
|
|
| 98 |
|
| 99 |
# Convert to numpy array
|
| 100 |
x_train, y_train = np.array(x_train), np.array(y_train)
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
# Specify the repository ID and filename
|
| 104 |
repo_id = "shubh7/arima-forecasting-model" # Replace with your repo ID
|
|
|
|
| 98 |
|
| 99 |
# Convert to numpy array
|
| 100 |
x_train, y_train = np.array(x_train), np.array(y_train)
|
| 101 |
+
# Creating a testing set with 60 time-steps and 1 output
|
| 102 |
+
x_test4 = [] # Initialize list for input sequences
|
| 103 |
+
y_test4 = [] # Initialize list for output values
|
| 104 |
+
|
| 105 |
+
# Loop through the test data to create input-output pairs
|
| 106 |
+
for i in range(60, len(test_data)):
|
| 107 |
+
# Append the previous 60 time-steps as input
|
| 108 |
+
x_test4.append(test_data[i-60:i, 0]) # Removed .values
|
| 109 |
+
# Append the next time-step as the output
|
| 110 |
+
y_test4.append(test_data[i, 0])
|
| 111 |
+
|
| 112 |
+
# Convert lists to numpy arrays
|
| 113 |
+
x_test4, y_test4 = np.array(x_test4), np.array(y_test4)
|
| 114 |
+
|
| 115 |
+
# Reshape input data to match the input shape expected by the model
|
| 116 |
+
x_test4 = np.reshape(x_test4, (x_test4.shape[0], x_test4.shape[1], 1))
|
| 117 |
|
| 118 |
# Specify the repository ID and filename
|
| 119 |
repo_id = "shubh7/arima-forecasting-model" # Replace with your repo ID
|