Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 20f16bf6 authored by GUYET Thomas's avatar GUYET Thomas
Browse files

fix hydronaut errors

parent 202f147f
Branches
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@ import matplotlib.pyplot as plt
import pickle
import warnings
class SWoTTeDExperiment(Experiment):
......@@ -177,6 +179,16 @@ class HyperparametersTuning(SWoTTeDExperiment):
if isinstance(X,list):
nb_train = int(params.data.percent_train*len(X))
nb_test = len(X)-nb_train
#remove examples that do not have the correct length
to_keep=[]
for i in range(len(X)):
if X[i].shape[1]>=params.model.twl:
to_keep.append(i)
if len(to_keep)<len(X):
warnings.warn(f"Removed {len(X)-len(to_keep)} examples with incompatible length")
X=[X[i] for i in to_keep]
else:
nb_train = int(params.data.percent_train*X.shape[0])
nb_test = X.shape[0]-nb_train
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment