Spaces:
Runtime error
Runtime error
Add sidebar and a subhead
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import streamlit as st
|
|
2 |
import numpy as np
|
3 |
import matplotlib.pyplot as plt
|
4 |
|
5 |
-
number_of_observations = st.slider('Number of observations', min_value=50, max_value=150, value=50)
|
6 |
-
noise_standard_deviation = st.slider('Standard deviation of the noise', min_value = 0.0, max_value=
|
7 |
|
8 |
np.random.seed(2)
|
9 |
|
@@ -17,6 +17,7 @@ additional_noise = 8 * np.random.binomial(1, 0.03, size = number_of_observations
|
|
17 |
y = np.dot(X, w) + noise_standard_deviation * np.random.randn(number_of_observations) \
|
18 |
+ additional_noise
|
19 |
|
|
|
20 |
fig, ax = plt.subplots(dpi=320)
|
21 |
ax.set_xlim((0,1))
|
22 |
ax.set_ylim((-5,20))
|
|
|
2 |
import numpy as np
|
3 |
import matplotlib.pyplot as plt
|
4 |
|
5 |
+
number_of_observations = st.sidebar.slider('Number of observations', min_value=50, max_value=150, value=50)
|
6 |
+
noise_standard_deviation = st.sidebar.slider('Standard deviation of the noise', min_value = 0.0, max_value=2, value=0.25)
|
7 |
|
8 |
np.random.seed(2)
|
9 |
|
|
|
17 |
y = np.dot(X, w) + noise_standard_deviation * np.random.randn(number_of_observations) \
|
18 |
+ additional_noise
|
19 |
|
20 |
+
st.subheader('Quadratic regression')
|
21 |
fig, ax = plt.subplots(dpi=320)
|
22 |
ax.set_xlim((0,1))
|
23 |
ax.set_ylim((-5,20))
|