From ab22cc5b68c5aaf1f9d7150ac41d03bd831eef59 Mon Sep 17 00:00:00 2001 From: Yuji Uchiyama Date: Thu, 21 Jun 2018 06:28:11 +0900 Subject: [PATCH] Change the default kernel type in SVC to Kernel::RBF (#267) * Change the default kernel type in SVC to Kernel::RBF * Update CHANGELOG.md --- CHANGELOG.md | 1 + docs/machine-learning/classification/svc.md | 2 +- src/Classification/SVC.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efd2174..13bae10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG This changelog references the relevant changes done in PHP-ML library. * Unreleased + * feature [Dataset] changed the default kernel type in SVC to Kernel::RBF (#267) * feature [Clustering] added KMeans associative clustering (#262) * feature [Dataset] added removeColumns function to ArrayDataset (#249) * feature [Dataset] added a SvmDataset class for SVM-Light (or LibSVM) format files (#237) diff --git a/docs/machine-learning/classification/svc.md b/docs/machine-learning/classification/svc.md index da0511c..99b4da0 100644 --- a/docs/machine-learning/classification/svc.md +++ b/docs/machine-learning/classification/svc.md @@ -4,7 +4,7 @@ Classifier implementing Support Vector Machine based on libsvm. ### Constructor Parameters -* $kernel (int) - kernel type to be used in the algorithm (default Kernel::LINEAR) +* $kernel (int) - kernel type to be used in the algorithm (default Kernel::RBF) * $cost (float) - parameter C of C-SVC (default 1.0) * $degree (int) - degree of the Kernel::POLYNOMIAL function (default 3) * $gamma (float) - kernel coefficient for ‘Kernel::RBF’, ‘Kernel::POLYNOMIAL’ and ‘Kernel::SIGMOID’. If gamma is ‘null’ then 1/features will be used instead. diff --git a/src/Classification/SVC.php b/src/Classification/SVC.php index de71bbe..fbc47ba 100644 --- a/src/Classification/SVC.php +++ b/src/Classification/SVC.php @@ -11,7 +11,7 @@ use Phpml\SupportVectorMachine\Type; class SVC extends SupportVectorMachine implements Classifier { public function __construct( - int $kernel = Kernel::LINEAR, + int $kernel = Kernel::RBF, float $cost = 1.0, int $degree = 3, ?float $gamma = null,