note 127893 added to svm.examples

From: Date: Fri, 04 Nov 2022 08:33:10 +0000
Subject: note 127893 added to svm.examples
Groups: php.notes 
Request: Send a blank email to php-notes+get-219847@lists.php.net to get a copy of this message
from pecl.php.net i download svm php_svm-0.2.3-8.1-ts-vs16-x64.zip so i read in README.md .. ===================================================== Data is supplied in either a file, a stream, or as an an array. If supplied in a file or a stream, it must contain one line per training example, which must be formatted as an integer class (usually 1 and -1) followed by a series of feature/value pairs, in increasing feature order. The features are integers, the values floats, usually scaled 0-1. For example: -1 1:0.43 3:0.12 9284:0.2 ===================================================== so creating traindata.txt with the content -1 1:0.43 3:0.12 9284:0.2 leads me to use it in the second example: <?php $svm = new SVM(); $model = $svm->train("traindata.txt"); $model->save('model2.svm'); ?> and running and editing the model2.svm i got the content: ------------------------------------------------------------------- svm_type c_svc kernel_type rbf gamma 0.00010771219302024989 nr_class 1 total_sv 0 rho label -1 nr_sv 0 SV -------------------------------------------------------------------- so yes i think it's work, how i said i need to do more tests to get control with main functions to think to other more complicated ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.159.161 (proxied: 5.14.157.148) ---- Manual Page -- https://php.net/manual/en/svm.examples.php Edit -- https://main.php.net/note/edit/127893 Del: integrated -- https://main.php.net/note/delete/127893/integrated Del: useless -- https://main.php.net/note/delete/127893/useless Del: bad code -- https://main.php.net/note/delete/127893/bad+code Del: spam -- https://main.php.net/note/delete/127893/spam Del: non-english -- https://main.php.net/note/delete/127893/non-english Del: in docs -- https://main.php.net/note/delete/127893/in+docs Del: other reasons-- https://main.php.net/note/delete/127893 Reject -- https://main.php.net/note/reject/127893 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219847) next »