PreyPatel commited on
Commit
358454f
1 Parent(s): 384323b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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=2,
21
  random_state=42)
22
  elif opt == "200":
23
  X, y = make_regression(n_samples=200,
24
- n_features=2,
25
  random_state=56)
26
  elif opt == "150":
27
  X, y = make_regression(n_samples=150,
28
- n_features=2,
29
  random_state=25)
30
  else:
31
  X, y = make_regression(random_state=10)
@@ -73,8 +73,9 @@ if st.button('Magic'):
73
  y_pred = best_model.predict(X_test)
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)
77
- plt.scatter(X_test[:,0], y_test)
 
78
  st.pyplot(fig)
79
 
80
  options = ['LinearRegressor', 'DecisionTreeRegressor', 'SVR']
 
17
  opt = dataset_option.split()[0]
18
  if opt == "100":
19
  X, y = make_regression(n_samples=100,
20
+ n_features=10, n_informative=2,
21
  random_state=42)
22
  elif opt == "200":
23
  X, y = make_regression(n_samples=200,
24
+ n_features=5, n_informative=2,
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)
 
73
  y_pred = best_model.predict(X_test)
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 Value")
78
+ plt.legend()
79
  st.pyplot(fig)
80
 
81
  options = ['LinearRegressor', 'DecisionTreeRegressor', 'SVR']