Try to search your question here, if you can't find : Ask Any Question Now ?

I am using SVR() function for regression. I am unable to optimize it's parameter using #pso by #Pyswarm. Can anyone help me with please?

HomeCategory: stackoverflowI am using SVR() function for regression. I am unable to optimize it's parameter using #pso by #Pyswarm. Can anyone help me with please?
Avatarsourav asked 2 weeks ago

Optimizing parameters of #SVR() using #pyswarm #PSO function.

I have 200 inputs of the dataset with 9 features of each input. I have to predict one output parameter. I already did it by calling using #SVR() function using it’s default parameters. The results are not satisfactory. Now I want to optimize its parameters using the “PSO” algorithm but unable to do it.

model = SVR()model.fit(Xtrain,ytrain)

pred_y = model.predict(Xtest)

param = {'kernel' : ('linear', 'poly', 'rbf', 'sigmoid'),'C':[1,5,10],'degree' : [3,8],'coef0' : [0.01,10,0.5],'gamma' : ('auto','scale')}

import pyswarms as ps

optimizer = ps.single.GlobalBestPSO(n_particles=10, dimensions=2,options=param)

best_cost, best_pos = optimizer.optimize(model, iters=100)-

2019-08-13 12:19:48,551 - pyswarms.single.global_best - INFO - Optimize for 100 iters with {'kernel': ('linear', 'poly', 'rbf', 'sigmoid'), 'C': [1, 5, 10], 'degree': [3, 8], 'coef0': [0.01, 10, 0.5], 'gamma': ('auto', 'scale')}
pyswarms.single.global_best:   0%|                                       |0/100

TypeError: ‘SVR’ object is not callable

1 Answers
Best Answer
Avatarnaveen answered 2 weeks ago
Your Answer

12 + 12 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com