Spaces:
Sleeping
Sleeping
Commit
•
ed7b72b
1
Parent(s):
a4078cd
download model func addded
Browse files- .gitignore +1 -0
- app.py +6 -0
.gitignore
CHANGED
@@ -18,6 +18,7 @@ data.pdf
|
|
18 |
data.txt
|
19 |
fig.pdf
|
20 |
report.pdf
|
|
|
21 |
#Env variables
|
22 |
.env
|
23 |
# Distribution / packaging
|
|
|
18 |
data.txt
|
19 |
fig.pdf
|
20 |
report.pdf
|
21 |
+
model.pkl
|
22 |
#Env variables
|
23 |
.env
|
24 |
# Distribution / packaging
|
app.py
CHANGED
@@ -4,6 +4,7 @@ import numpy as np
|
|
4 |
import pandas as pd
|
5 |
import os
|
6 |
from streamlit_option_menu import option_menu
|
|
|
7 |
|
8 |
|
9 |
#---MODULES IMPORT---
|
@@ -105,6 +106,11 @@ def main():
|
|
105 |
else:
|
106 |
st.write("Mean Squared error is:", mean_squared_error(y_test, predict))
|
107 |
st.write("Mean Absolute error is:", mean_absolute_error(y_test, predict))
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
except ValueError as e:
|
110 |
error_message = str(e)
|
|
|
4 |
import pandas as pd
|
5 |
import os
|
6 |
from streamlit_option_menu import option_menu
|
7 |
+
import pickle
|
8 |
|
9 |
|
10 |
#---MODULES IMPORT---
|
|
|
106 |
else:
|
107 |
st.write("Mean Squared error is:", mean_squared_error(y_test, predict))
|
108 |
st.write("Mean Absolute error is:", mean_absolute_error(y_test, predict))
|
109 |
+
|
110 |
+
model_bytes = pickle.dumps(algo_model)
|
111 |
+
st.download_button(label="Download pickled model",
|
112 |
+
data=model_bytes,
|
113 |
+
file_name="model.pkl")
|
114 |
|
115 |
except ValueError as e:
|
116 |
error_message = str(e)
|