LonghornPHP 2026

Voting

: min(nine, zero)?
(Example: nine)

The Note You're Voting On

razvan_bc at yahoo dot com
3 years ago
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

<< Back to user notes page

To Top