From 385114cea96bc0cd9b88c7e47638df2f833f978d Mon Sep 17 00:00:00 2001 From: Ian Barber Date: Sun, 18 Dec 2011 21:46:20 +0000 Subject: [PATCH] Adding predict probability function git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@321143 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/svm/svm.xml | 4 +- .../svm/svmmodel/predict_probability.xml | 92 +++++++++++++++++++ reference/svm/versions.xml | 1 + 3 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 reference/svm/svmmodel/predict_probability.xml diff --git a/reference/svm/svm.xml b/reference/svm/svm.xml index 19eccc8105..45c9b74140 100644 --- a/reference/svm/svm.xml +++ b/reference/svm/svm.xml @@ -280,7 +280,7 @@ SVM::OPT_PROBABILITY - Training parmater, boolean, for whether to use probability estimates + Training parameter, boolean, for whether to collect and use probability estimates @@ -322,7 +322,7 @@ SVM::OPT_C - The option for the cost parameter that controls tradeoff between errors and generality + The option for the cost parameter that controls tradeoff between errors and generality - effectively the penalty for misclassifying training examples. diff --git a/reference/svm/svmmodel/predict_probability.xml b/reference/svm/svmmodel/predict_probability.xml new file mode 100644 index 0000000000..45d4815696 --- /dev/null +++ b/reference/svm/svmmodel/predict_probability.xml @@ -0,0 +1,92 @@ + + + + + + SVMModel::predict_probability + Return class probabilities for previous unseen data + + + + &reftitle.description; + + public floatSVMModel::predict_probability + arraydata + + + This function accepts an array of data and attempts to predict the class, as with the predict function. + Additionally, however, this function returns an array of probabilities, one per class in the model, which + represent the estimated chance of the data supplied being a member of that class. Requires that the model + to be used has been trained with the probability parameter set to true. + + + + + + &reftitle.parameters; + + + + data + + + The array to be classified. This should be a series of key => value + pairs in increasing key order, but not necessarily continuous. + + + + + probabilities + + + The supplied value will be filled with the probabilities. This will be either null, in the case + of a model without probability information, or an array where the index is the class name and the value + the predicted probability. + + + + + + + + + &reftitle.returnvalues; + + Float the predicted value. This will be a class label in the case of + classification, a real value in the case of regression. + Throws SVMException on error + + + + + &reftitle.seealso; + + + SVM::predict + + + + + + + + diff --git a/reference/svm/versions.xml b/reference/svm/versions.xml index 1b1ec2b408..f5434d6fb8 100644 --- a/reference/svm/versions.xml +++ b/reference/svm/versions.xml @@ -15,6 +15,7 @@ +