Zeel commited on
Commit
6656ee8
·
1 Parent(s): 2feb377

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import numpy as np
2
  import streamlit as st
3
  import matplotlib.pyplot as plt
 
4
 
5
  st.subheader("Gaussian Process Regression with Squared Exponential Kernel")
6
 
@@ -29,7 +30,7 @@ def rbf_kernel(x1, x2, lengthscale, variance):
29
  dist_sqr = (x1_ - x2_) ** 2
30
  return variance * np.exp(-dist_sqr)
31
 
32
- fig, ax = plt.subplots(figsize=(10,4))
33
 
34
  x_train = np.array([0.2, 0.5, 0.8]).reshape(-1,1)
35
  y_train = np.array([0.8, 0.3, 0.6]).reshape(-1,1)
@@ -57,6 +58,7 @@ ax.fill_between(x_test.ravel(), pred_mean.ravel()-pred_std2.ravel(),
57
  pred_mean.ravel()+pred_std2.ravel(), alpha=0.5, label='$\\mu \\pm 2\\sigma$')
58
  ax.set_xlabel('x')
59
  ax.set_ylabel('y')
 
60
  ax.legend()
61
 
62
  with st_col:
 
1
  import numpy as np
2
  import streamlit as st
3
  import matplotlib.pyplot as plt
4
+ plt.style.use('fivethirtyeight')
5
 
6
  st.subheader("Gaussian Process Regression with Squared Exponential Kernel")
7
 
 
30
  dist_sqr = (x1_ - x2_) ** 2
31
  return variance * np.exp(-dist_sqr)
32
 
33
+ fig, ax = plt.subplots(figsize=(10,4), facecolor='white')
34
 
35
  x_train = np.array([0.2, 0.5, 0.8]).reshape(-1,1)
36
  y_train = np.array([0.8, 0.3, 0.6]).reshape(-1,1)
 
58
  pred_mean.ravel()+pred_std2.ravel(), alpha=0.5, label='$\\mu \\pm 2\\sigma$')
59
  ax.set_xlabel('x')
60
  ax.set_ylabel('y')
61
+ ax.set_facecolor('white')
62
  ax.legend()
63
 
64
  with st_col: