Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -232,21 +232,21 @@ def calculate_prediction_with_ltsm(symbol="BTC", period="5d", interval="5m"):
|
|
232 |
prices = [(pd.to_datetime(index, unit='m'), price) for index, price in data['Close'].items()]
|
233 |
df = pd.DataFrame(prices, columns=['Date', 'Price'])
|
234 |
|
235 |
-
st.write("**Preparing data for LTSM Model training......")
|
236 |
X, Y, scaler = prepare_lstm_data(df)
|
237 |
|
238 |
-
st.write("**Build LTSM Model with X shape data.........")
|
239 |
model = build_lstm_model((X.shape[1], 1))
|
240 |
|
241 |
# Train the model
|
242 |
-
st.write("**Train LTSM Model with X,Y shape data with batch_size(32), epochs(10)............")
|
243 |
model.fit(X, Y, batch_size=32, epochs=10)
|
244 |
|
245 |
# Predict the next price point
|
246 |
-
st.write("**Sequence LTSM Model with X,Y shape data with batch_size(32), epochs(10)...............")
|
247 |
last_sequence = X[-1].reshape(1, X.shape[1], 1)
|
248 |
|
249 |
-
st.write("**Predict realtime price with LTSM Model trained with X,Y shape data with batch_size(32), epochs(10)..................")
|
250 |
scaled_prediction = model.predict(last_sequence)
|
251 |
predicted_price = scaler.inverse_transform(scaled_prediction)
|
252 |
|
@@ -396,8 +396,8 @@ symbol = st.sidebar.text_input("Enter Cryptocurrency Symbol (e.g., BTC):", "BTC"
|
|
396 |
|
397 |
# Add buttons for navigation
|
398 |
show_news_button = st.sidebar.button("Show Latest News")
|
399 |
-
show_data_button = st.sidebar.button("Show Data and
|
400 |
-
predict_lstm_button = st.sidebar.button("Predict
|
401 |
|
402 |
|
403 |
# Fetch data and news when the button is clicked
|
|
|
232 |
prices = [(pd.to_datetime(index, unit='m'), price) for index, price in data['Close'].items()]
|
233 |
df = pd.DataFrame(prices, columns=['Date', 'Price'])
|
234 |
|
235 |
+
st.write("**Preparing data for LTSM Model training......(processing)...")
|
236 |
X, Y, scaler = prepare_lstm_data(df)
|
237 |
|
238 |
+
st.write("**Build LTSM Model with X shape data.........(processing)...")
|
239 |
model = build_lstm_model((X.shape[1], 1))
|
240 |
|
241 |
# Train the model
|
242 |
+
st.write("**Train LTSM Model with X,Y shape data with batch_size(32), epochs(10)............(processing)...")
|
243 |
model.fit(X, Y, batch_size=32, epochs=10)
|
244 |
|
245 |
# Predict the next price point
|
246 |
+
st.write("**Sequence LTSM Model with X,Y shape data with batch_size(32), epochs(10)...............(processing)...")
|
247 |
last_sequence = X[-1].reshape(1, X.shape[1], 1)
|
248 |
|
249 |
+
st.write("**Predict realtime price with LTSM Model trained with X,Y shape data with batch_size(32), epochs(10)..................(processing)...")
|
250 |
scaled_prediction = model.predict(last_sequence)
|
251 |
predicted_price = scaler.inverse_transform(scaled_prediction)
|
252 |
|
|
|
396 |
|
397 |
# Add buttons for navigation
|
398 |
show_news_button = st.sidebar.button("Show Latest News")
|
399 |
+
show_data_button = st.sidebar.button("Show Data and Indicators")
|
400 |
+
predict_lstm_button = st.sidebar.button("Predict by training LSTM Model")
|
401 |
|
402 |
|
403 |
# Fetch data and news when the button is clicked
|