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

len() of unsized object #18

Open
Abdou24MR opened this issue Apr 5, 2022 · 0 comments
Open

len() of unsized object #18

Abdou24MR opened this issue Apr 5, 2022 · 0 comments

Comments

@Abdou24MR
Copy link

Abdou24MR commented Apr 5, 2022

error while running the example:

elmk = elm.ELMKernel()
elmk.search_param(X, y, cv="kfold", of="accuracy", eval=10)
tr_set, te_set = elm.split_sets(data, training_percent=.8, perm=True)
tr_result = elmk.train(tr_set)
te_result = elmk.test(te_set)
print(te_result.get_accuracy)

error message:

`elmk
Start search


TypeError Traceback (most recent call last)
in
6 # to be optimized and perform 10 searching steps.
7 # best parameters will be saved inside 'elmk' object
----> 8 elmk.search_param(X, y, cv="kfold", of="accuracy", eval=10)
9
10 # split data in training and testing sets

c:\users\e580\appdata\local\programs\python\python36\lib\site-packages\elm\elmk.py in search_param(self, database, dataprocess, path_filename, save, cv, of, kf, eval)
487 num_evals=eval,
488 param_c=param_ranges[0],
--> 489 param_kernel=param_ranges[1])
490
491 elif kernel_function == "poly":

c:\users\e580\appdata\local\programs\python\python36\lib\site-packages\optunity\api.py in minimize(f, num_evals, solver_name, pmap, **kwargs)
210 solver = make_solver(**suggestion)
211 solution, details = optimize(solver, func, maximize=False, max_evals=num_evals,
--> 212 pmap=pmap)
213 return solution, details, suggestion
214

c:\users\e580\appdata\local\programs\python\python36\lib\site-packages\optunity\api.py in optimize(solver, func, maximize, max_evals, pmap)
243 time = timeit.default_timer()
244 try:
--> 245 solution, report = solver.optimize(f, maximize, pmap=pmap)
246 except fun.MaximumEvaluationsException:
247 # early stopping because maximum number of evaluations is reached

c:\users\e580\appdata\local\programs\python\python36\lib\site-packages\optunity\solvers\CMAES.py in optimize(self, f, maximize, pmap)
137 else:
138 strategy = deap.cma.Strategy(centroid=self.start.values(),
--> 139 sigma=self.sigma)
140 toolbox.register("generate", strategy.generate, Individual)
141 toolbox.register("update", strategy.update)

c:\users\e580\appdata\local\programs\python\python36\lib\site-packages\deap\cma.py in init(self, centroid, sigma, **kargs)
88 self.centroid = numpy.array(centroid)
89
---> 90 self.dim = len(self.centroid)
91 self.sigma = sigma
92 self.pc = numpy.zeros(self.dim)

TypeError: len() of unsized object

`

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