Spaces:
Runtime error
Runtime error
Enhance scatterplot and slider default
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ st.latex(r'''h(\boldsymbol x, \boldsymbol w)= \sum_{k=1}^{K}\boldsymbol w_{k} \p
|
|
11 |
|
12 |
|
13 |
# Sidebar inputs
|
14 |
-
number_of_observations = st.sidebar.slider('Number of observations', min_value=50, max_value=150, value=
|
15 |
noise_standard_deviation = st.sidebar.slider('Standard deviation of the noise', min_value = 0.0, max_value=2.0, value=0.25)
|
16 |
cost_function = st.sidebar.radio('What cost function you want to use for the fitting?', options=('RMSE-Loss', 'Huber-Loss'))
|
17 |
|
@@ -30,8 +30,8 @@ y = np.dot(X, w) + noise_standard_deviation * np.random.randn(number_of_observat
|
|
30 |
|
31 |
fig, ax = plt.subplots(dpi=320)
|
32 |
ax.set_xlim((0,1))
|
33 |
-
ax.set_ylim((-5,
|
34 |
-
ax.scatter(X[:,1], y, c='
|
35 |
|
36 |
st.pyplot(fig)
|
37 |
st.write(X[:5, :])
|
|
|
11 |
|
12 |
|
13 |
# Sidebar inputs
|
14 |
+
number_of_observations = st.sidebar.slider('Number of observations', min_value=50, max_value=150, value=75)
|
15 |
noise_standard_deviation = st.sidebar.slider('Standard deviation of the noise', min_value = 0.0, max_value=2.0, value=0.25)
|
16 |
cost_function = st.sidebar.radio('What cost function you want to use for the fitting?', options=('RMSE-Loss', 'Huber-Loss'))
|
17 |
|
|
|
30 |
|
31 |
fig, ax = plt.subplots(dpi=320)
|
32 |
ax.set_xlim((0,1))
|
33 |
+
ax.set_ylim((-5,26))
|
34 |
+
ax.scatter(X[:,1], y, c='#e76254' ,edgecolors='firebrick')
|
35 |
|
36 |
st.pyplot(fig)
|
37 |
st.write(X[:5, :])
|