Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,10 @@ from sklearn.preprocessing import PolynomialFeatures
|
|
| 6 |
from sklearn.metrics import mean_squared_error
|
| 7 |
|
| 8 |
st.title("Ridge Demo")
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
x = np.linspace(-1., 1., 100)
|
| 11 |
y = 4 + 3*x + 2*np.sin(x) + 2*np.random.randn(len(x))
|
| 12 |
|
|
@@ -36,7 +39,8 @@ ax.set_ylabel("y")
|
|
| 36 |
rmse = np.round(np.sqrt(mean_squared_error(y_pred, y)), 2)
|
| 37 |
ax.set_title(f"Train RMSE: {rmse}")
|
| 38 |
|
| 39 |
-
|
|
|
|
| 40 |
hide_streamlit_style = """
|
| 41 |
<style>
|
| 42 |
#MainMenu {visibility: hidden;}
|
|
|
|
| 6 |
from sklearn.metrics import mean_squared_error
|
| 7 |
|
| 8 |
st.title("Ridge Demo")
|
| 9 |
+
col1, col2 = st.columns(2)
|
| 10 |
+
|
| 11 |
+
with col1:
|
| 12 |
+
degree = st.slider('Degree', 2, 40, 1)
|
| 13 |
x = np.linspace(-1., 1., 100)
|
| 14 |
y = 4 + 3*x + 2*np.sin(x) + 2*np.random.randn(len(x))
|
| 15 |
|
|
|
|
| 39 |
rmse = np.round(np.sqrt(mean_squared_error(y_pred, y)), 2)
|
| 40 |
ax.set_title(f"Train RMSE: {rmse}")
|
| 41 |
|
| 42 |
+
with col1:
|
| 43 |
+
st.pyplot(fig)
|
| 44 |
hide_streamlit_style = """
|
| 45 |
<style>
|
| 46 |
#MainMenu {visibility: hidden;}
|