From b5bbdccd0447e47d27c090c8f7c03d4894987dcb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Bouscarrat?= <leo.bouscarrat@euranova.eu>
Date: Wed, 4 Mar 2020 18:09:00 +0100
Subject: [PATCH] Removing inexisting parameter to fetch_openml

---
 code/bolsonaro/data/dataset_loader.py | 2 +-
 code/bolsonaro/utils.py               | 5 +----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/code/bolsonaro/data/dataset_loader.py b/code/bolsonaro/data/dataset_loader.py
index df132fc..7d05f20 100644
--- a/code/bolsonaro/data/dataset_loader.py
+++ b/code/bolsonaro/data/dataset_loader.py
@@ -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))
diff --git a/code/bolsonaro/utils.py b/code/bolsonaro/utils.py
index f594f92..ee316bc 100644
--- a/code/bolsonaro/utils.py
+++ b/code/bolsonaro/utils.py
@@ -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])
-- 
GitLab