nvnavaneeth / PSO-optimized-SVR

18 stars 6 forks source link

Multiple input #2

Open tuzhirun opened 5 years ago

tuzhirun commented 5 years ago

Thank you very much for your work! If I have 10 inputs, which part of the program should I rewrite? My input had 10 variables, and then I ran the program, and there was an error. The error occurred in this module: update_particle_state

KeyError: 'C' I hope you can solve my problem, thank you very much!

rakemate commented 4 years ago

Hi Navaneeth

I also getting the same error

I have set the train_pso_svr.config **[Data] file_path = data/train_data.csv feature_cols = 0, 1, 2,3 label_col = 4

[PSO] n_iterations = 50 inertia_weight = 1.1 c1 = 2 c2 = 2

[SVR] kernel = rbf epsilon = 1 C_min = 1 C_max = 200 C_step = 20 gamma_min = 0.01 gamma_max = 2 gamma_step = 0.2

[Validation] type = k-fold n_validations = 10 validation_size = 0.1

[Model] save_path = svr_model.pickle**

C:\Program Files (x86)\Python38-32\lib\site-packages\sklearn\metrics_regression.py:589: UndefinedMetricWarning: R^2 score is not well-defined with less than two samples. warnings.warn(msg, UndefinedMetricWarning) C:\Program Files (x86)\Python38-32\lib\site-packages\sklearn\metrics_regression.py:589: UndefinedMetricWarning: R^2 score is not well-defined with less than two samples. warnings.warn(msg, UndefinedMetricWarning) C:\Program Files (x86)\Python38-32\lib\site-packages\sklearn\metrics_regression.py:589: UndefinedMetricWarning: R^2 score is not well-defined with less than two samples. warnings.warn(msg, UndefinedMetricWarning) Traceback (most recent call last): File "C:\Users\rkris24\Downloads\PSO-optimized-SVR-master\PSO-optimized-SVR-master\train.py", line 284, in pso_optimizer.run_optimizer() File "C:\Users\rkris24\Downloads\PSO-optimized-SVR-master\PSO-optimized-SVR-master\train.py", line 74, in run_optimizer self.update_particle_state() File "C:\Users\rkris24\Downloads\PSO-optimized-SVR-master\PSO-optimized-SVR-master\train.py", line 143, in update_particle_state