2a3febefed59e906809a27c6379de2b13d3eef31,qiskit_aqua/algorithms/classical/svm/svm_classical.py,SVM_Classical,init_params,#SVM_Classical#Any#Any#,66
Before Change
def init_params(self, params, algo_input):
svm_params = params.get(QuantumAlgorithm.SECTION_KEY_ALGORITHM)
if algo_input.training_dataset is None:
raise AlgorithmError("Training dataset is required! please provide it")
is_multiclass = get_num_classes(algo_input.training_dataset) > 2
if is_multiclass:
multiclass_extension_params = params.get(QuantumAlgorithm.SECTION_KEY_MULTICLASS_EXTENSION)
multiclass_extension = get_multiclass_extension_instance(multiclass_extension_params["name"])
multiclass_extension_params["estimator_cls"] = RBF_SVC_Estimator
multiclass_extension.init_params(multiclass_extension_params)
logger.info("Multiclass classifcation algo:" + multiclass_extension_params["name"])
else:
After Change
svm_params = params.get(QuantumAlgorithm.SECTION_KEY_ALGORITHM)
multiclass_extension = None
multiclass_extension_params = params.get(QuantumAlgorithm.SECTION_KEY_MULTICLASS_EXTENSION)
if multiclass_extension_params is not None:
multiclass_extension = get_multiclass_extension_instance(multiclass_extension_params["name"])
multiclass_extension_params["estimator_cls"] = RBF_SVC_Estimator
multiclass_extension.init_params(multiclass_extension_params)
logger.info("Multiclass dataset with extension: {}".format(multiclass_extension_params["name"]))
self.init_args(algo_input.training_dataset, algo_input.test_dataset,
algo_input.datapoints, svm_params.get("gamma"), multiclass_extension)
def init_args(self, training_dataset, test_dataset, datapoints, gamma, multiclass_extension=None):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: Qiskit/qiskit-aqua
Commit Name: 2a3febefed59e906809a27c6379de2b13d3eef31
Time: 2018-09-25
Author: woodsp@us.ibm.com
File Name: qiskit_aqua/algorithms/classical/svm/svm_classical.py
Class Name: SVM_Classical
Method Name: init_params
Project Name: Qiskit/qiskit-aqua
Commit Name: 2a3febefed59e906809a27c6379de2b13d3eef31
Time: 2018-09-25
Author: woodsp@us.ibm.com
File Name: qiskit_aqua/algorithms/many_sample/qsvm/svm_qkernel.py
Class Name: SVM_QKernel
Method Name: init_params
Project Name: Qiskit/qiskit-aqua
Commit Name: 57457f9e1112856a3312b223e54fdf644ce99c53
Time: 2018-06-07
Author: manoel@us.ibm.com
File Name: qiskit_acqua/algomethods.py
Class Name:
Method Name: run_algorithm