Spaces:
Sleeping
Sleeping
Suchinthana
commited on
Commit
·
80208be
1
Parent(s):
4f9f9c2
changing variables
Browse files
app.py
CHANGED
@@ -34,20 +34,22 @@ def predict_and_plot_logreg(dirty, wait, lastyear, usa):
|
|
34 |
|
35 |
plt.figure(figsize=(12, 6))
|
36 |
|
|
|
37 |
plt.subplot(1, 2, 1)
|
38 |
-
plt.scatter(X_test.iloc[:,
|
39 |
-
plt.scatter(
|
40 |
-
plt.title('
|
41 |
-
plt.xlabel('
|
42 |
plt.ylabel('Good')
|
43 |
plt.legend()
|
44 |
plt.grid(True)
|
45 |
|
|
|
46 |
plt.subplot(1, 2, 2)
|
47 |
-
plt.scatter(X_test.iloc[:,
|
48 |
-
plt.scatter(
|
49 |
-
plt.title('
|
50 |
-
plt.xlabel('
|
51 |
plt.ylabel('Good')
|
52 |
plt.legend()
|
53 |
plt.grid(True)
|
@@ -67,20 +69,22 @@ def predict_and_plot_nn(dirty, wait, lastyear, usa):
|
|
67 |
|
68 |
plt.figure(figsize=(12, 6))
|
69 |
|
|
|
70 |
plt.subplot(1, 2, 1)
|
71 |
-
plt.scatter(X_test.iloc[:,
|
72 |
-
plt.scatter(
|
73 |
-
plt.title('
|
74 |
-
plt.xlabel('
|
75 |
plt.ylabel('Good')
|
76 |
plt.legend()
|
77 |
plt.grid(True)
|
78 |
|
|
|
79 |
plt.subplot(1, 2, 2)
|
80 |
-
plt.scatter(X_test.iloc[:,
|
81 |
-
plt.scatter(
|
82 |
-
plt.title('
|
83 |
-
plt.xlabel('
|
84 |
plt.ylabel('Good')
|
85 |
plt.legend()
|
86 |
plt.grid(True)
|
|
|
34 |
|
35 |
plt.figure(figsize=(12, 6))
|
36 |
|
37 |
+
# Dirty vs Good plot
|
38 |
plt.subplot(1, 2, 1)
|
39 |
+
plt.scatter(X_test.iloc[:, 0], y_test, color='blue', alpha=0.6, label='Actual Good Values') # X_test.iloc[:, 0] corresponds to 'dirty'
|
40 |
+
plt.scatter(dirty, predicted_value, color='red', label=f'Input: Dirty={dirty}, Predicted Good={predicted_value:.2f}', zorder=5)
|
41 |
+
plt.title('Dirty vs Good')
|
42 |
+
plt.xlabel('Dirty')
|
43 |
plt.ylabel('Good')
|
44 |
plt.legend()
|
45 |
plt.grid(True)
|
46 |
|
47 |
+
# Wait vs Good plot
|
48 |
plt.subplot(1, 2, 2)
|
49 |
+
plt.scatter(X_test.iloc[:, 1], y_test, color='blue', alpha=0.6, label='Actual Good Values')
|
50 |
+
plt.scatter(wait, predicted_value, color='red', label=f'Input: Wait={wait}, Predicted Good={predicted_value:.2f}', zorder=5)
|
51 |
+
plt.title('Wait vs Good')
|
52 |
+
plt.xlabel('Wait')
|
53 |
plt.ylabel('Good')
|
54 |
plt.legend()
|
55 |
plt.grid(True)
|
|
|
69 |
|
70 |
plt.figure(figsize=(12, 6))
|
71 |
|
72 |
+
# Dirty vs Good plot
|
73 |
plt.subplot(1, 2, 1)
|
74 |
+
plt.scatter(X_test.iloc[:, 0], y_test, color='blue', alpha=0.6, label='Actual Good Values') # X_test.iloc[:, 0] corresponds to 'dirty'
|
75 |
+
plt.scatter(dirty, predicted_value, color='red', label=f'Input: Dirty={dirty}, Predicted Good={predicted_value:.2f}', zorder=5)
|
76 |
+
plt.title('Dirty vs Good (NN)')
|
77 |
+
plt.xlabel('Dirty')
|
78 |
plt.ylabel('Good')
|
79 |
plt.legend()
|
80 |
plt.grid(True)
|
81 |
|
82 |
+
# Wait vs Good plot
|
83 |
plt.subplot(1, 2, 2)
|
84 |
+
plt.scatter(X_test.iloc[:, 1], y_test, color='blue', alpha=0.6, label='Actual Good Values')
|
85 |
+
plt.scatter(wait, predicted_value, color='red', label=f'Input: Wait={wait}, Predicted Good={predicted_value:.2f}', zorder=5)
|
86 |
+
plt.title('Wait vs Good (NN)')
|
87 |
+
plt.xlabel('Wait')
|
88 |
plt.ylabel('Good')
|
89 |
plt.legend()
|
90 |
plt.grid(True)
|