alkzar90 commited on
Commit
f81dc6c
1 Parent(s): 96f9a87

Add sidebar and a subhead

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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=0.5, value=0.25)
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))