note 127895 added to svm.examples
| From: | razvan_bc.yahoo.com via php-notes | Date: | Fri, 04 Nov 2022 09:03:04 +0000 |
| Subject: | note 127895 added to svm.examples | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219849@lists.php.net to get a copy of this message | ||
ok i did more tests..
getting the source
https://github.com/ianbarber/php-svm/blob/master/tests/002_predict.phpt
modified ..
<?php
$svm = new svmmodel();
//$result = $svm->load(dirname(__FILE__) . '/australian.model');
$result = $svm->load('australian.model');
if($result) {
$data = array(
"1" => 1,
2 => -0.731729,
3 => -0.886786,
4 => -1,
5 => 0.230769,
"6" => -0.25,
7 => -0.783509,
8 => 1,
9 => 1,
10 => "-0.820896",
11 => -1,
13 => -0.92,
"14" => "-1"
);
$result = $svm->predict($data);
if($result > 0) {
echo "ok";
print_r($result);
} else {
echo "predict failed: $result";
}
} else {
echo "loading failed";
}
?>
with additional https://github.com/ianbarber/php-svm/blob/master/tests/australian.scale
dropped inside the test folder where .php file is located i am able after running to get the result:
================================
ok1
so it's work
----
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/127895
Del: integrated -- https://main.php.net/note/delete/127895/integrated
Del: useless -- https://main.php.net/note/delete/127895/useless
Del: bad code -- https://main.php.net/note/delete/127895/bad+code
Del: spam -- https://main.php.net/note/delete/127895/spam
Del: non-english -- https://main.php.net/note/delete/127895/non-english
Del: in docs -- https://main.php.net/note/delete/127895/in+docs
Del: other reasons-- https://main.php.net/note/delete/127895
Reject -- https://main.php.net/note/reject/127895
Search -- https://main.php.net/manage/user-notes.php