Spaces:
Sleeping
Sleeping
Ayush Shrivastava
commited on
Commit
·
ab8a7de
1
Parent(s):
6e6d3d3
Changes to app file
Browse files
app.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
# import libraries.
|
| 3 |
from sklearn.model_selection import train_test_split
|
| 4 |
from sklearn.datasets import make_regression
|
|
|
|
| 5 |
from keras.optimizers import SGD,Adam
|
| 6 |
from keras.models import Sequential
|
| 7 |
import matplotlib.pyplot as plt
|
|
@@ -130,4 +131,15 @@ if __name__ == '__main__':
|
|
| 130 |
ax2.legend()
|
| 131 |
|
| 132 |
# write the graph to the app.
|
| 133 |
-
st.pyplot(fig2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
# import libraries.
|
| 3 |
from sklearn.model_selection import train_test_split
|
| 4 |
from sklearn.datasets import make_regression
|
| 5 |
+
from sklearn.metrics import mean_squared_error,mean_absolute_error
|
| 6 |
from keras.optimizers import SGD,Adam
|
| 7 |
from keras.models import Sequential
|
| 8 |
import matplotlib.pyplot as plt
|
|
|
|
| 131 |
ax2.legend()
|
| 132 |
|
| 133 |
# write the graph to the app.
|
| 134 |
+
st.pyplot(fig2)
|
| 135 |
+
|
| 136 |
+
# Printing the Errors.
|
| 137 |
+
st.subheader('Errors')
|
| 138 |
+
|
| 139 |
+
# Calculating the MSE.
|
| 140 |
+
mse = mean_squared_error(y_test, y_hat, squared=False)
|
| 141 |
+
st.write('Root Mean Squared Error : ',mse)
|
| 142 |
+
|
| 143 |
+
# Calculating the MAE.
|
| 144 |
+
mae = mean_absolute_error(y_test, y_hat)
|
| 145 |
+
st.write('Mean Absolute Error : ',mae)
|