Commit adb5224f authored by Benjamin Murauer's avatar Benjamin Murauer
Browse files

fixed bug where type(X) = Dataframe and type(y) = np.array

parent 87e0f0a1
Pipeline #45051 failed with stage
in 1 minute and 48 seconds
......@@ -7,8 +7,8 @@ import warnings
import numpy as np
import pandas as pd
from sklearn.base import clone
from sklearn import metrics
from sklearn.base import clone
from sklearn.model_selection import BaseCrossValidator
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import PredefinedSplit
......@@ -259,13 +259,19 @@ class FixedSplitGridEvaluator(GridEvaluator):
if type(xtrain) == np.ndarray:
x = np.concatenate((xtrain, xtest))
y = np.concatenate((ytrain, ytest))
elif type(xtrain) == pd.DataFrame:
if type(xtrain) == pd.DataFrame:
x = pd.concat((xtrain, xtest))
else:
raise ValueError('don\'t know how to concatenate ', type(xtrain),
type(xtest))
if type(ytrain) == np.ndarray:
y = np.concatenate((ytrain, ytest))
elif type(ytrain) == pd.DataFrame:
y = pd.concat((ytrain, ytest))
else:
raise ValueError(
f'cant concatenate train and test of type {type(xtrain)}')
raise ValueError('don\'t know how to concatenate ', type(xtrain),
type(xtest))
return super().evaluate(model, (x, y))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment