Skip to content
Snippets Groups Projects
Commit 9d88d5ee authored by s183897's avatar s183897 :ice_skate:
Browse files

Fixed faulty predictions, added plot of clusters

parent bdc28bf3
No related branches found
No related tags found
No related merge requests found
import pygame
import os
import time
......@@ -42,9 +43,9 @@ mediumfont = pygame.font.SysFont('comicsansms', 50)
largefont = pygame.font.SysFont('comicsansms', 80)
# matrixes of color, index 0 should be deleted
points = np.array([[1000000,1000000,1000000]])
white = np.array([[1000000,1000000,1000000]])
black = np.array([[1000000,1000000,1000000]])
points = np.reshape(np.array([randint(0,255), randint(0,255), randint(0,255)]), (-1, 3))
white = np.reshape(np.array([randint(0,255), randint(0,255), randint(0,255)]), (-1, 3))
black = np.reshape(np.array([randint(0,255), randint(0,255), randint(0,255)]), (-1, 3))
# write on screen
def text(msg,color,font,x,y):
......@@ -176,4 +177,7 @@ while True:
for n in range(1,len(black)):
ax.scatter(black[n,0],black[n,1],black[n,2], color = "black")
ax.scatter(color[0], color[1], color[2], color = "blue")
ax.scatter(whitecluster[:, 0], whitecluster[:, 1], whitecluster[:, 2], marker='*', c='white', s=500)
ax.scatter(blackcluster[:, 0], blackcluster[:, 1], blackcluster[:, 2], marker='*', c='black', s=500)
pyplot.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment