Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
60348742
Commit
60348742
authored
Apr 12, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StatRed ass1: Added some comments.
parent
b5d82c8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
statred/ass1/q23_iris.py
statred/ass1/q23_iris.py
+2
-2
No files found.
statred/ass1/q23_iris.py
View file @
60348742
...
...
@@ -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
,
\
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
)]
for
i
in
range
(
4
):
for
j
in
range
(
4
):
...
...
@@ -15,10 +15,10 @@ for i in range(4):
for
d
in
data
:
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'
]
figure
(
16
)
clf
()
for
i
in
range
(
4
):
for
j
in
range
(
4
):
if
i
!=
j
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment