FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
machinelearningclassification/module3.py at master · codehard123/machinelearningclassification · GitHub
codehard123
/
machinelearningclassification
Public
forked from
cambridgecoding/machinelearningclassification
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
machinelearningclassification
/
module3.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (22 loc) · 673 Bytes
Breadcrumbs
machinelearningclassification
/
module3.py
Copy path
File metadata and controls
25 lines (22 loc) · 673 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import
csv
import
numpy
import
scipy
import
matplotlib
.
pyplot
as
plt
from
sklearn
import
preprocessing
from
sklearn
.
cross_validation
import
train_test_split
from
sklearn
import
metrics
#Imports for Module 4
from
sklearn
import
neighbors
import
knnplots
#Code common to all modeles from module 3 onwards
##NB. The X and yTransformed variables come from the preprocessing in the previous module.
fileName
=
"wdbc.csv"
fileOpen
=
open
(
fileName
,
"rU"
)
csvData
=
csv
.
reader
(
fileOpen
)
dataList
=
list
(
csvData
)
dataArray
=
numpy
.
array
(
dataList
)
X
=
dataArray
[:,
2
:
32
].
astype
(
float
)
y
=
dataArray
[:,
1
]
le
=
preprocessing
.
LabelEncoder
()
le
.
fit
(
y
)
yTransformed
=
le
.
transform
(
y
)
Back
|
FazBrowse Home
|
New Git URL