Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,35 +5,35 @@ import streamlit.components.v1 as components
|
|
| 5 |
|
| 6 |
# Load the pickled model
|
| 7 |
def load_model():
|
| 8 |
-
return pickle.load(open('currency-exchange-rate-prediction_DTR.pkl', 'rb'))
|
| 9 |
|
| 10 |
# Function for model prediction
|
| 11 |
def model_prediction(model, features):
|
| 12 |
-
predicted = str(
|
| 13 |
return predicted
|
| 14 |
|
| 15 |
def app_design():
|
| 16 |
# Add input fields for High, Open, and Low values
|
| 17 |
-
image = '10.png'
|
| 18 |
st.image(image, use_column_width=True)
|
| 19 |
|
| 20 |
-
st.subheader("Enter the following values:")
|
| 21 |
-
|
| 22 |
Open = st.number_input("Open")
|
| 23 |
High = st.number_input("High")
|
| 24 |
Low = st.number_input("Low")
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
features = [[Open,High,Low]]
|
| 28 |
|
| 29 |
# Load the model
|
| 30 |
model = load_model()
|
| 31 |
|
| 32 |
# Make a prediction when the user clicks the "Predict" button
|
| 33 |
-
if st.button('Predict
|
| 34 |
predicted_value = model_prediction(model, features)
|
| 35 |
-
|
| 36 |
-
st.success(f"The Currency Exchange Rate price is: {predicted_value}")
|
| 37 |
|
| 38 |
|
| 39 |
def about_hidevs():
|
|
@@ -72,4 +72,4 @@ def main():
|
|
| 72 |
about_hidevs()
|
| 73 |
|
| 74 |
if __name__ == '__main__':
|
| 75 |
-
main()
|
|
|
|
| 5 |
|
| 6 |
# Load the pickled model
|
| 7 |
def load_model():
|
| 8 |
+
return pickle.load(open('currency-exchange-rate-prediction_DTR.pkl', 'rb'))
|
| 9 |
|
| 10 |
# Function for model prediction
|
| 11 |
def model_prediction(model, features):
|
| 12 |
+
predicted = str(model.predict(features)[0])
|
| 13 |
return predicted
|
| 14 |
|
| 15 |
def app_design():
|
| 16 |
# Add input fields for High, Open, and Low values
|
| 17 |
+
image = '10.png'
|
| 18 |
st.image(image, use_column_width=True)
|
| 19 |
|
| 20 |
+
st.subheader("Enter the following values:")
|
| 21 |
+
|
| 22 |
Open = st.number_input("Open")
|
| 23 |
High = st.number_input("High")
|
| 24 |
Low = st.number_input("Low")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
# Create a feature list from the user inputs
|
| 28 |
features = [[Open,High,Low]]
|
| 29 |
|
| 30 |
# Load the model
|
| 31 |
model = load_model()
|
| 32 |
|
| 33 |
# Make a prediction when the user clicks the "Predict" button
|
| 34 |
+
if st.button('Predict Amount'):
|
| 35 |
predicted_value = model_prediction(model, features)
|
| 36 |
+
st.success(f'The Closing amount is: {predicted_value}')
|
|
|
|
| 37 |
|
| 38 |
|
| 39 |
def about_hidevs():
|
|
|
|
| 72 |
about_hidevs()
|
| 73 |
|
| 74 |
if __name__ == '__main__':
|
| 75 |
+
main()
|