Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,15 +17,15 @@ def make_data(dataset_option):
|
|
17 |
opt = dataset_option.split()[0]
|
18 |
if opt == "100":
|
19 |
X, y = make_regression(n_samples=100,
|
20 |
-
n_features=10,
|
21 |
random_state=42)
|
22 |
elif opt == "200":
|
23 |
X, y = make_regression(n_samples=200,
|
24 |
-
n_features=5,
|
25 |
random_state=56)
|
26 |
elif opt == "150":
|
27 |
X, y = make_regression(n_samples=150,
|
28 |
-
n_features=7,
|
29 |
random_state=25)
|
30 |
else:
|
31 |
X, y = make_regression(random_state=10)
|
@@ -74,7 +74,7 @@ if st.button('Magic'):
|
|
74 |
fig = plt.figure()
|
75 |
plt.title(f"Best model fit is of {opts[np.argmin(loss)]}")
|
76 |
plt.scatter(X_test[:,0], y_pred, label = "Prediction Value")
|
77 |
-
plt.scatter(X_test[:,0], y_test, label = "Real
|
78 |
plt.legend()
|
79 |
st.pyplot(fig)
|
80 |
|
@@ -123,4 +123,4 @@ plt.legend()
|
|
123 |
plt.title("loss plot")
|
124 |
plt.xlabel("n_estimators")
|
125 |
plt.ylabel("mean squared error loss")
|
126 |
-
st.pyplot(fig)
|
|
|
17 |
opt = dataset_option.split()[0]
|
18 |
if opt == "100":
|
19 |
X, y = make_regression(n_samples=100,
|
20 |
+
n_features=10,n_informative=10,noise=50,
|
21 |
random_state=42)
|
22 |
elif opt == "200":
|
23 |
X, y = make_regression(n_samples=200,
|
24 |
+
n_features=5,n_informative=5,
|
25 |
random_state=56)
|
26 |
elif opt == "150":
|
27 |
X, y = make_regression(n_samples=150,
|
28 |
+
n_features=7,n_informative=2,
|
29 |
random_state=25)
|
30 |
else:
|
31 |
X, y = make_regression(random_state=10)
|
|
|
74 |
fig = plt.figure()
|
75 |
plt.title(f"Best model fit is of {opts[np.argmin(loss)]}")
|
76 |
plt.scatter(X_test[:,0], y_pred, label = "Prediction Value")
|
77 |
+
plt.scatter(X_test[:,0], y_test, label = "Real Vaule")
|
78 |
plt.legend()
|
79 |
st.pyplot(fig)
|
80 |
|
|
|
123 |
plt.title("loss plot")
|
124 |
plt.xlabel("n_estimators")
|
125 |
plt.ylabel("mean squared error loss")
|
126 |
+
st.pyplot(fig)
|