Spaces:
Runtime error
Runtime error
Commit
•
1bd9250
1
Parent(s):
2b0a296
Update app.py
Browse files
app.py
CHANGED
@@ -130,18 +130,21 @@ def main():
|
|
130 |
with open("mcclf_cc.properties", "wb") as f:
|
131 |
f.write(mlf_file.read())
|
132 |
|
133 |
-
#
|
134 |
-
|
135 |
|
136 |
-
# Load the model from cc.mod
|
137 |
-
model = MarkovChainClassifier.load_model("cc.mod")
|
138 |
|
139 |
# Get user input for userID
|
140 |
user_id = st.text_input("Enter User ID")
|
141 |
|
142 |
# Check if the "Predict" button was clicked
|
143 |
if st.button("Predict"):
|
144 |
-
|
|
|
|
|
|
|
145 |
pred = model.predict()
|
146 |
if pred == 'T':
|
147 |
st.write(f"UserID: {user_id}, Prediction: Visitor is likely to convert into a customer.")
|
|
|
130 |
with open("mcclf_cc.properties", "wb") as f:
|
131 |
f.write(mlf_file.read())
|
132 |
|
133 |
+
# Create an instance of MarkovChainClassifier with the uploaded ML config file
|
134 |
+
model = MarkovChainClassifier("cc.mod")
|
135 |
|
136 |
+
# # Load the model from cc.mod
|
137 |
+
# model = MarkovChainClassifier.load_model("cc.mod")
|
138 |
|
139 |
# Get user input for userID
|
140 |
user_id = st.text_input("Enter User ID")
|
141 |
|
142 |
# Check if the "Predict" button was clicked
|
143 |
if st.button("Predict"):
|
144 |
+
# Load the saved model
|
145 |
+
model.load_model("cc.mod")
|
146 |
+
|
147 |
+
# Call the predict method of the MarkovChainClassifier instance
|
148 |
pred = model.predict()
|
149 |
if pred == 'T':
|
150 |
st.write(f"UserID: {user_id}, Prediction: Visitor is likely to convert into a customer.")
|