Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search_param function problem #8

Open
Abdou24MR opened this issue Apr 6, 2019 · 0 comments
Open

search_param function problem #8

Abdou24MR opened this issue Apr 6, 2019 · 0 comments

Comments

@Abdou24MR
Copy link

Abdou24MR commented Apr 6, 2019

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant