Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bolsonaro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luc Giffon
bolsonaro
Commits
b5bbdccd
Commit
b5bbdccd
authored
5 years ago
by
Léo Bouscarrat
Browse files
Options
Downloads
Patches
Plain Diff
Removing inexisting parameter to fetch_openml
parent
96f51d9c
No related branches found
Branches containing commit
No related tags found
1 merge request
!15
Resolve "Adding new datasets"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/bolsonaro/data/dataset_loader.py
+1
-1
1 addition, 1 deletion
code/bolsonaro/data/dataset_loader.py
code/bolsonaro/utils.py
+1
-4
1 addition, 4 deletions
code/bolsonaro/utils.py
with
2 additions
and
5 deletions
code/bolsonaro/data/dataset_loader.py
+
1
−
1
View file @
b5bbdccd
...
...
@@ -112,7 +112,7 @@ class DatasetLoader(object):
dataset_loading_func
=
change_binary_func_openml
(
'
kr-vs-kp
'
)
task
=
Task
.
BINARYCLASSIFICATION
elif
name
==
'
kin8nm
'
:
X
,
y
=
fetch_openml
(
'
kin8nm
'
,
return_X_y
=
True
,
random_state
=
dataset_parameters
.
random_state
)
X
,
y
=
fetch_openml
(
'
kin8nm
'
,
return_X_y
=
True
)
task
=
Task
.
REGRESSION
else
:
raise
ValueError
(
"
Unsupported dataset
'
{}
'"
.
format
(
name
))
...
...
This diff is collapsed.
Click to expand it.
code/bolsonaro/utils.py
+
1
−
4
View file @
b5bbdccd
...
...
@@ -82,10 +82,7 @@ def change_binary_func_load(base_load_function):
def
change_binary_func_openml
(
dataset_name
):
def
func_load
(
return_X_y
=
True
,
random_state
=
None
):
if
random_state
:
X
,
y
=
fetch_openml
(
dataset_name
,
return_X_y
=
return_X_y
,
random_state
=
random_state
)
else
:
X
,
y
=
fetch_openml
(
dataset_name
,
return_X_y
=
return_X_y
)
X
,
y
=
fetch_openml
(
dataset_name
,
return_X_y
=
return_X_y
)
possible_classes
=
sorted
(
set
(
y
))
assert
len
(
possible_classes
)
==
2
,
"
Function change binary_func_load only work for binary classfication
"
y
=
binarize_class_data
(
y
,
possible_classes
[
-
1
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment