Spaces:
Sleeping
Sleeping
Change streamlit cache to cache_data
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def rewrite(x):
|
|
27 |
return f'd["{x}"]'
|
28 |
|
29 |
|
30 |
-
@st.
|
31 |
def generate_data():
|
32 |
np.random.seed(seed=0)
|
33 |
d = {}
|
@@ -154,7 +154,7 @@ except TypeError:
|
|
154 |
pass
|
155 |
|
156 |
|
157 |
-
@st.
|
158 |
def compute_instrumental_variable():
|
159 |
regr = linear_model.LinearRegression()
|
160 |
regr2 = linear_model.LinearRegression()
|
@@ -163,7 +163,7 @@ def compute_instrumental_variable():
|
|
163 |
return "%.3f" % (regr.coef_[0, 0] / regr2.coef_[0, 0])
|
164 |
|
165 |
|
166 |
-
@st.
|
167 |
def compute_front_door():
|
168 |
regr = linear_model.LinearRegression()
|
169 |
regr2 = linear_model.LinearRegression()
|
|
|
27 |
return f'd["{x}"]'
|
28 |
|
29 |
|
30 |
+
@st.cache_data
|
31 |
def generate_data():
|
32 |
np.random.seed(seed=0)
|
33 |
d = {}
|
|
|
154 |
pass
|
155 |
|
156 |
|
157 |
+
@st.cache_data
|
158 |
def compute_instrumental_variable():
|
159 |
regr = linear_model.LinearRegression()
|
160 |
regr2 = linear_model.LinearRegression()
|
|
|
163 |
return "%.3f" % (regr.coef_[0, 0] / regr2.coef_[0, 0])
|
164 |
|
165 |
|
166 |
+
@st.cache_data
|
167 |
def compute_front_door():
|
168 |
regr = linear_model.LinearRegression()
|
169 |
regr2 = linear_model.LinearRegression()
|