Description
when i try to run search_param function i got this issue:
Traceback (most recent call last):
File "<pyshell#383>", line 1, in
elmk.search_param(data, cv="kfold", of="accuracy", eval=10)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\elmk.py", line 489, in search_param
param_kernel=param_ranges[1])
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\api.py", line 212, in minimize
pmap=pmap)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\api.py", line 245, in optimize
solution, report = solver.optimize(f, maximize, pmap=pmap)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\solvers\CMAES.py", line 163, in optimize
halloffame=hof, verbose=False)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\deap\algorithms.py", line 487, in eaGenerateUpdate
for ind, fit in zip(population, fitnesses):
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\solvers\CMAES.py", line 156, in evaluate
individual)]))),)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\functions.py", line 301, in wrapped_f
value = f(*args, **kwargs)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\functions.py", line 356, in wrapped_f
return f(*args, **kwargs)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\constraints.py", line 151, in wrapped_f
return f(*args, **kwargs)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\constraints.py", line 129, in wrapped_f
return f(*args, **kwargs)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\optunity\constraints.py", line 266, in func
return f(*args, **kwargs)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\elmk.py", line 426, in wrapper_1param
dataprocess=dataprocess)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\mltools.py", line 800, in kfold_cross_validation
cv_testing_error = CVError(testing_errors)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\mltools.py", line 563, in init
self.calc_metrics()
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\mltools.py", line 576, in calc_metrics
fold.dict_errors[error] = fold.get(error)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\mltools.py", line 428, in get
self._calc(error, self.expected_targets, self.predicted_targets)
File "C:\Users\abdel\AppData\Local\Programs\Python\Python37\lib\site-packages\elm\mltools.py", line 358, in _calc
self.dict_errors[name] = np.count_nonzero(_a == _b) / _b.size
ZeroDivisionError: division by zero
this my code:
data= mltools.read("C:/these1.data")
elmk = elm.ELMKernel()
elmk.search_param(data, cv="kfold", of="accuracy", eval=10)
this is my data:
array([[6000, 1999],
[6196, 2000],
[7474, 2001],
[7813, 2002],
[4684, 2003],
[4933, 2004],
[5261, 2005],
[5485, 2006],
[5869, 2007],
[6155, 2008],
[6566, 2009],
[7005, 2010],
[7372, 2011],
[7631, 2012],
[7255, 2013],
[6404, 2014],
[6736, 2015],
[6414, 2016]])
Note that i have the same issue if i use ELMRandom()