adding all work done so far (lessons 1 - 5)

This commit is contained in:
2019-07-10 19:58:53 +01:00
parent 8085149a49
commit b982957daf
37 changed files with 19407 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
0.24539,0.81725,0
0.21774,0.76462,0
0.20161,0.69737,0
0.20161,0.58041,0
0.2477,0.49561,0
0.32834,0.44883,0
0.39516,0.48099,0
0.39286,0.57164,0
0.33525,0.62135,0
0.33986,0.71199,0
0.34447,0.81433,0
0.28226,0.82602,0
0.26613,0.75,0
0.26613,0.63596,0
0.32604,0.54825,0
0.28917,0.65643,0
0.80069,0.71491,0
0.80069,0.64181,0
0.80069,0.50146,0
0.79839,0.36988,0
0.73157,0.25,0
0.63249,0.18275,0
0.60023,0.27047,0
0.66014,0.34649,0
0.70161,0.42251,0
0.70853,0.53947,0
0.71544,0.63304,0
0.74309,0.72076,0
0.75,0.63596,0
0.75,0.46345,0
0.72235,0.35526,0
0.66935,0.28509,0
0.20622,0.94298,1
0.26613,0.8962,1
0.38134,0.8962,1
0.42051,0.94591,1
0.49885,0.86404,1
0.31452,0.93421,1
0.53111,0.72076,1
0.45276,0.74415,1
0.53571,0.6038,1
0.60484,0.71491,1
0.60945,0.58333,1
0.51267,0.47807,1
0.50806,0.59211,1
0.46198,0.30556,1
0.5288,0.41082,1
0.38594,0.35819,1
0.31682,0.31433,1
0.29608,0.20906,1
0.36982,0.27632,1
0.42972,0.18275,1
0.51498,0.10965,1
0.53111,0.20906,1
0.59793,0.095029,1
0.73848,0.086257,1
0.83065,0.18275,1
0.8629,0.10965,1
0.88364,0.27924,1
0.93433,0.30848,1
0.93433,0.19444,1
0.92512,0.43421,1
0.87903,0.43421,1
0.87903,0.58626,1
0.9182,0.71491,1
0.85138,0.8348,1
0.85599,0.94006,1
0.70853,0.94298,1
0.70853,0.87281,1
0.59793,0.93129,1
0.61175,0.83187,1
0.78226,0.82895,1
0.78917,0.8962,1
0.90668,0.89912,1
0.14862,0.92251,1
0.15092,0.85819,1
0.097926,0.85819,1
0.079493,0.91374,1
0.079493,0.77632,1
0.10945,0.79678,1
0.12327,0.67982,1
0.077189,0.6886,1
0.081797,0.58626,1
0.14862,0.58041,1
0.14862,0.5307,1
0.14171,0.41959,1
0.08871,0.49269,1
0.095622,0.36696,1
0.24539,0.3962,1
0.1947,0.29678,1
0.16935,0.22368,1
0.15553,0.13596,1
0.23848,0.12427,1
0.33065,0.12427,1
0.095622,0.2617,1
0.091014,0.20322,1
1 0.24539 0.81725 0
2 0.21774 0.76462 0
3 0.20161 0.69737 0
4 0.20161 0.58041 0
5 0.2477 0.49561 0
6 0.32834 0.44883 0
7 0.39516 0.48099 0
8 0.39286 0.57164 0
9 0.33525 0.62135 0
10 0.33986 0.71199 0
11 0.34447 0.81433 0
12 0.28226 0.82602 0
13 0.26613 0.75 0
14 0.26613 0.63596 0
15 0.32604 0.54825 0
16 0.28917 0.65643 0
17 0.80069 0.71491 0
18 0.80069 0.64181 0
19 0.80069 0.50146 0
20 0.79839 0.36988 0
21 0.73157 0.25 0
22 0.63249 0.18275 0
23 0.60023 0.27047 0
24 0.66014 0.34649 0
25 0.70161 0.42251 0
26 0.70853 0.53947 0
27 0.71544 0.63304 0
28 0.74309 0.72076 0
29 0.75 0.63596 0
30 0.75 0.46345 0
31 0.72235 0.35526 0
32 0.66935 0.28509 0
33 0.20622 0.94298 1
34 0.26613 0.8962 1
35 0.38134 0.8962 1
36 0.42051 0.94591 1
37 0.49885 0.86404 1
38 0.31452 0.93421 1
39 0.53111 0.72076 1
40 0.45276 0.74415 1
41 0.53571 0.6038 1
42 0.60484 0.71491 1
43 0.60945 0.58333 1
44 0.51267 0.47807 1
45 0.50806 0.59211 1
46 0.46198 0.30556 1
47 0.5288 0.41082 1
48 0.38594 0.35819 1
49 0.31682 0.31433 1
50 0.29608 0.20906 1
51 0.36982 0.27632 1
52 0.42972 0.18275 1
53 0.51498 0.10965 1
54 0.53111 0.20906 1
55 0.59793 0.095029 1
56 0.73848 0.086257 1
57 0.83065 0.18275 1
58 0.8629 0.10965 1
59 0.88364 0.27924 1
60 0.93433 0.30848 1
61 0.93433 0.19444 1
62 0.92512 0.43421 1
63 0.87903 0.43421 1
64 0.87903 0.58626 1
65 0.9182 0.71491 1
66 0.85138 0.8348 1
67 0.85599 0.94006 1
68 0.70853 0.94298 1
69 0.70853 0.87281 1
70 0.59793 0.93129 1
71 0.61175 0.83187 1
72 0.78226 0.82895 1
73 0.78917 0.8962 1
74 0.90668 0.89912 1
75 0.14862 0.92251 1
76 0.15092 0.85819 1
77 0.097926 0.85819 1
78 0.079493 0.91374 1
79 0.079493 0.77632 1
80 0.10945 0.79678 1
81 0.12327 0.67982 1
82 0.077189 0.6886 1
83 0.081797 0.58626 1
84 0.14862 0.58041 1
85 0.14862 0.5307 1
86 0.14171 0.41959 1
87 0.08871 0.49269 1
88 0.095622 0.36696 1
89 0.24539 0.3962 1
90 0.1947 0.29678 1
91 0.16935 0.22368 1
92 0.15553 0.13596 1
93 0.23848 0.12427 1
94 0.33065 0.12427 1
95 0.095622 0.2617 1
96 0.091014 0.20322 1

View File

@@ -0,0 +1,30 @@
# Import statements
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Read the data.
data = np.asarray(pd.read_csv('data.csv', header=None))
# Assign the features to the variable X, and the labels to the variable y.
X = data[:, 0:2]
y = data[:, 2]
# TODO: Create the model and assign it to the variable model.
# Find the right parameters for this model to achieve 100% accuracy
# on the dataset.
model = SVC(kernel='rbf', gamma=27)
# TODO: Fit the model.
model.fit(X, y)
# TODO: Make predictions. Store them in the variable y_pred.
y_pred = model.predict(X)
# TODO: Calculate the accuracy and assign it to the variable acc.
acc = accuracy_score(y, y_pred)