Commit 60348742 authored by Taddeüs Kroes's avatar Taddeüs Kroes

StatRed ass1: Added some comments.

parent b5d82c8c
...@@ -7,7 +7,7 @@ cnvt_dict = {'Iris-setosa': 0.0, 'Iris-versicolor': 1.0, 'Iris-virginica': 2.0} ...@@ -7,7 +7,7 @@ cnvt_dict = {'Iris-setosa': 0.0, 'Iris-versicolor': 1.0, 'Iris-virginica': 2.0}
data = loadtxt('iris.data', delimiter=',', dtype=float, \ data = loadtxt('iris.data', delimiter=',', dtype=float, \
converters={4: lambda s: not s in cnvt_dict and -1.0 or cnvt_dict[s]}) converters={4: lambda s: not s in cnvt_dict and -1.0 or cnvt_dict[s]})
# Transform the data set into # Transform the data set into plottable graph data
graph_data = [[[] for i in range(3)] for j in range(16)] graph_data = [[[] for i in range(3)] for j in range(16)]
for i in range(4): for i in range(4):
for j in range(4): for j in range(4):
...@@ -15,10 +15,10 @@ for i in range(4): ...@@ -15,10 +15,10 @@ for i in range(4):
for d in data: for d in data:
graph_data[i + j*4][int(d[4])].append((d[i], d[j])); graph_data[i + j*4][int(d[4])].append((d[i], d[j]));
# Different colors for different data types (map these colors to cnvt_dict).
colors = ['r', 'g', 'b'] colors = ['r', 'g', 'b']
figure(16) figure(16)
clf() clf()
for i in range(4): for i in range(4):
for j in range(4): for j in range(4):
if i != j: if i != j:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment