Hem345 commited on
Commit
e9ea34c
·
verified ·
1 Parent(s): c39b3e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -2,8 +2,6 @@ import streamlit as st
2
  import numpy as np
3
  from sklearn.neighbors import KNeighborsClassifier
4
  import matplotlib.pyplot as plt
5
- st.set_option('deprecation.showPyplotGlobalUse', False)
6
-
7
 
8
  def get_user_data_train():
9
  data_points = []
@@ -45,7 +43,8 @@ def plot_training_and_test_data(X_train, y_train, X_test, predictions):
45
  plt.scatter(X_train[indices, 0], X_train[indices, 1], label=f'Training ({label})')
46
 
47
  # Plot test data with predicted labels
48
- plt.scatter(X_test[:, 0], X_test[:, 1], label=f'Test (Predicted Labels)', marker='x', c=predictions)
 
49
 
50
  plt.xlabel('X-coordinate')
51
  plt.ylabel('Y-coordinate')
 
2
  import numpy as np
3
  from sklearn.neighbors import KNeighborsClassifier
4
  import matplotlib.pyplot as plt
 
 
5
 
6
  def get_user_data_train():
7
  data_points = []
 
43
  plt.scatter(X_train[indices, 0], X_train[indices, 1], label=f'Training ({label})')
44
 
45
  # Plot test data with predicted labels
46
+ numerical_predictions = np.arange(len(np.unique(predictions)))
47
+ plt.scatter(X_test[:, 0], X_test[:, 1], label=f'Test (Predicted Labels)', marker='x', c=numerical_predictions[predictions])
48
 
49
  plt.xlabel('X-coordinate')
50
  plt.ylabel('Y-coordinate')