Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MPBA
INF
Commits
e108062a
Commit
e108062a
authored
Feb 03, 2020
by
Alessia Marcolini
Browse files
Fix reading labels type
parent
910072b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
sklearn_validation.py
View file @
e108062a
...
...
@@ -89,13 +89,12 @@ le = preprocessing.LabelEncoder()
# load data
sample_names_tr
,
var_names_tr
,
x_tr
=
load_data
(
TR_TOPFEATS
)
y_tr
=
pd
.
read_csv
(
LABELSFILE
,
sep
=
'
\t
'
,
header
=
None
).
values
y_tr
=
pd
.
read_csv
(
LABELSFILE
,
sep
=
'
\t
'
,
header
=
None
,
dtype
=
str
).
values
y_tr
=
le
.
fit_transform
(
y_tr
)
print
(
y_tr
.
shape
)
sample_names_ts
,
var_names_ts
,
x_ts
=
load_data
(
TS_TOPFEATS
)
# load the TS labels if available
if
TSLABELSFILE
is
not
None
:
y_ts
=
pd
.
read_csv
(
TSLABELSFILE
,
sep
=
'
\t
'
,
header
=
None
,
dtype
=
str
).
values
y_ts
=
pd
.
read_csv
(
TSLABELSFILE
,
header
=
None
,
dtype
=
str
).
values
y_ts
=
le
.
transform
(
y_ts
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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