This class stores the variables of a SMO problem solution. More...
Classes | |
| class | CLSVMSrc |
| class | ProblemSolver |
| This class aggregates all methods for solving SMO problems. | |
Public Member Functions | |
| SVM () | |
| Constructor that initializes with 0s. | |
| void | initializeWithZeros () |
| Set all values of the solution to 0. | |
| void | PreCalibrateCfg (float tolPositive, float tolNegative) |
| Attempts to pre-calibrate configuration parameters. Finds an alpha that enhances similarities between positive examples and reduces similarities between positive and negative examples. Assumes that decreasing lambda increases kernel match. | |
| float | TrainWithCrossValidation () |
| Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C. | |
| float | TrainWithCrossValidation (float CrossValidationSetPercent, float[] lambdaSet, float[] CSet) |
| Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C. Returns best performance so far. | |
| void | Train () |
| Trains current SVM. | |
| void | ResetSolution () |
| Resets current SVM solution. | |
| void | RemoveNonSupportVectors () |
| Removes all vectors that are not SVMs, ie, so that alpha[i]=0. | |
| bool | Classify (TrainingUnit Sample) |
| Classifies a training unit as positive or negative (true or false). | |
| float | ClassificationValue (TrainingUnit Sample) |
| Classifies a training unit with a float. The bigger, the more positive the sample. Values greater than zero are assumed to be positive samples. | |
| float | GetTrainingSetHitRate () |
| Gets the percentage of training examples classified correctly in the training set. | |
| float | GetTrainingSetHitRate (int ind) |
| Gets the percentage of training examples classified correctly starting from the ind-th training sample. | |
| float | GetHitRate (TrainingSet samples) |
| Computes hit rates for a given test set. | |
| void | Load (string FileName) |
| Copy all values from another solution. | |
| void | Save (string FileName) |
| Writes current solution to a file. | |
| SVM () | |
| Constructor that initializes with 0s. | |
| void | initializeWithZeros () |
| Set all values of the solution to 0. | |
| void | PreCalibrateCfg (float tolPositive, float tolNegative) |
| Attempts to pre-calibrate configuration parameters. Finds an alpha that enhances similarities between positive examples and reduces similarities between positive and negative examples. Assumes that decreasing lambda increases kernel match. | |
| float | TrainWithCrossValidation () |
| Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C. | |
| float | TrainWithCrossValidation (float CrossValidationSetPercent, float[] lambdaSet, float[] CSet) |
| Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C. Returns best performance so far. | |
| void | Train () |
| Trains current SVM. | |
| void | ResetSolution () |
| Resets current SVM solution. | |
| void | RemoveNonSupportVectors () |
| Removes all vectors that are not SVMs, ie, so that alpha[i]=0. | |
| bool | Classify (TrainingUnit Sample) |
| Classifies a training unit as positive or negative (true or false). | |
| float | ClassificationValue (TrainingUnit Sample) |
| Classifies a training unit with a float. The bigger, the more positive the sample. Values greater than zero are assumed to be positive samples. | |
| float | GetTrainingSetHitRate () |
| Gets the percentage of training examples classified correctly in the training set. | |
| float | GetTrainingSetHitRate (int ind) |
| Gets the percentage of training examples classified correctly starting from the ind-th training sample. | |
| float | GetHitRate (TrainingSet samples) |
| Computes hit rates for a given test set. | |
| void | Load (string FileName) |
| Copy all values from another solution. | |
| void | Save (string FileName) |
| Writes current solution to a file. | |
Static Public Member Functions | |
| static void | CLcalculateAllKernels (SVM problemSolution) |
| Computes All kernels and errors accelerating with OpenCL. | |
| static float | CLpredictOutput (SVM problemSolution, TrainingUnit untrainedUnit) |
| Predicts the output of a single entry, given a previous problem, solution and correspondent training set. | |
| static float[] | MultiClassify (SVM svm, CLCalc.Program.Image2D Samples) |
| Classifies multiple samples stored in OpenCL memory. | |
| static void | CLcalculateAllKernels (SVM problemSolution) |
| Computes All kernels and errors accelerating with OpenCL. | |
| static float | CLpredictOutput (SVM problemSolution, TrainingUnit untrainedUnit) |
| Predicts the output of a single entry, given a previous problem, solution and correspondent training set. | |
| static float[] | MultiClassify (SVM svm, CLCalc.Program.Image2D Samples) |
| Classifies multiple samples stored in OpenCL memory. | |
Public Attributes | |
| TrainingSet | TrainingSet = null |
| Training set for this solution. | |
| ProblemConfig | ProblemCfg = new ProblemConfig(0.1f, 50, 1e-3f, 1) |
| Problem configuration. | |
This class stores the variables of a SMO problem solution.
| OpenCLTemplate.MachineLearning.SVM.SVM | ( | ) |
Constructor that initializes with 0s.
| OpenCLTemplate.MachineLearning.SVM.SVM | ( | ) |
Constructor that initializes with 0s.
| float OpenCLTemplate.MachineLearning.SVM.ClassificationValue | ( | TrainingUnit | Sample | ) |
Classifies a training unit with a float. The bigger, the more positive the sample. Values greater than zero are assumed to be positive samples.
| Sample | Sample to be classified |
| float OpenCLTemplate.MachineLearning.SVM.ClassificationValue | ( | TrainingUnit | Sample | ) |
Classifies a training unit with a float. The bigger, the more positive the sample. Values greater than zero are assumed to be positive samples.
| Sample | Sample to be classified |
| bool OpenCLTemplate.MachineLearning.SVM.Classify | ( | TrainingUnit | Sample | ) |
Classifies a training unit as positive or negative (true or false).
| Sample | Sample to be classified |
| bool OpenCLTemplate.MachineLearning.SVM.Classify | ( | TrainingUnit | Sample | ) |
Classifies a training unit as positive or negative (true or false).
| Sample | Sample to be classified |
| static void OpenCLTemplate.MachineLearning.SVM.CLcalculateAllKernels | ( | SVM | problemSolution | ) | [static] |
Computes All kernels and errors accelerating with OpenCL.
| problemSolution | Problem solution SVM |
| static void OpenCLTemplate.MachineLearning.SVM.CLcalculateAllKernels | ( | SVM | problemSolution | ) | [static] |
Computes All kernels and errors accelerating with OpenCL.
| problemSolution | Problem solution SVM |
| static float OpenCLTemplate.MachineLearning.SVM.CLpredictOutput | ( | SVM | problemSolution, | |
| TrainingUnit | untrainedUnit | |||
| ) | [static] |
Predicts the output of a single entry, given a previous problem, solution and correspondent training set.
| problemSolution | Correspondent problem solution | |
| untrainedUnit | Input features from which the output will be predicted |
| static float OpenCLTemplate.MachineLearning.SVM.CLpredictOutput | ( | SVM | problemSolution, | |
| TrainingUnit | untrainedUnit | |||
| ) | [static] |
Predicts the output of a single entry, given a previous problem, solution and correspondent training set.
| problemSolution | Correspondent problem solution | |
| untrainedUnit | Input features from which the output will be predicted |
| float OpenCLTemplate.MachineLearning.SVM.GetHitRate | ( | TrainingSet | samples | ) |
Computes hit rates for a given test set.
| samples | Test set to be used |
| float OpenCLTemplate.MachineLearning.SVM.GetHitRate | ( | TrainingSet | samples | ) |
Computes hit rates for a given test set.
| samples | Test set to be used |
| float OpenCLTemplate.MachineLearning.SVM.GetTrainingSetHitRate | ( | int | ind | ) |
Gets the percentage of training examples classified correctly starting from the ind-th training sample.
| ind | Index to start reading training set samples |
| float OpenCLTemplate.MachineLearning.SVM.GetTrainingSetHitRate | ( | ) |
Gets the percentage of training examples classified correctly in the training set.
| float OpenCLTemplate.MachineLearning.SVM.GetTrainingSetHitRate | ( | int | ind | ) |
Gets the percentage of training examples classified correctly starting from the ind-th training sample.
| ind | Index to start reading training set samples |
| float OpenCLTemplate.MachineLearning.SVM.GetTrainingSetHitRate | ( | ) |
Gets the percentage of training examples classified correctly in the training set.
| void OpenCLTemplate.MachineLearning.SVM.initializeWithZeros | ( | ) |
Set all values of the solution to 0.
| void OpenCLTemplate.MachineLearning.SVM.initializeWithZeros | ( | ) |
Set all values of the solution to 0.
| void OpenCLTemplate.MachineLearning.SVM.Load | ( | string | FileName | ) |
Copy all values from another solution.
| FileName | File containing alpha's data |
| void OpenCLTemplate.MachineLearning.SVM.Load | ( | string | FileName | ) |
Copy all values from another solution.
| FileName | File containing alpha's data |
| static float [] OpenCLTemplate.MachineLearning.SVM.MultiClassify | ( | SVM | svm, | |
| CLCalc.Program.Image2D | Samples | |||
| ) | [static] |
Classifies multiple samples stored in OpenCL memory.
| Samples | Samples data to classify | |
| svm | SVM to use as classifier |
| static float [] OpenCLTemplate.MachineLearning.SVM.MultiClassify | ( | SVM | svm, | |
| CLCalc.Program.Image2D | Samples | |||
| ) | [static] |
Classifies multiple samples stored in OpenCL memory.
| Samples | Samples data to classify | |
| svm | SVM to use as classifier |
| void OpenCLTemplate.MachineLearning.SVM.PreCalibrateCfg | ( | float | tolPositive, | |
| float | tolNegative | |||
| ) |
Attempts to pre-calibrate configuration parameters. Finds an alpha that enhances similarities between positive examples and reduces similarities between positive and negative examples. Assumes that decreasing lambda increases kernel match.
| tolPositive | Positive kernels average should be greater than tolPositive | |
| tolNegative | Negative kernels average should be lesser than tolNegative |
| void OpenCLTemplate.MachineLearning.SVM.PreCalibrateCfg | ( | float | tolPositive, | |
| float | tolNegative | |||
| ) |
Attempts to pre-calibrate configuration parameters. Finds an alpha that enhances similarities between positive examples and reduces similarities between positive and negative examples. Assumes that decreasing lambda increases kernel match.
| tolPositive | Positive kernels average should be greater than tolPositive | |
| tolNegative | Negative kernels average should be lesser than tolNegative |
| void OpenCLTemplate.MachineLearning.SVM.RemoveNonSupportVectors | ( | ) |
Removes all vectors that are not SVMs, ie, so that alpha[i]=0.
| void OpenCLTemplate.MachineLearning.SVM.RemoveNonSupportVectors | ( | ) |
Removes all vectors that are not SVMs, ie, so that alpha[i]=0.
| void OpenCLTemplate.MachineLearning.SVM.ResetSolution | ( | ) |
Resets current SVM solution.
| void OpenCLTemplate.MachineLearning.SVM.ResetSolution | ( | ) |
Resets current SVM solution.
| void OpenCLTemplate.MachineLearning.SVM.Save | ( | string | FileName | ) |
Writes current solution to a file.
| void OpenCLTemplate.MachineLearning.SVM.Save | ( | string | FileName | ) |
Writes current solution to a file.
| void OpenCLTemplate.MachineLearning.SVM.Train | ( | ) |
Trains current SVM.
| void OpenCLTemplate.MachineLearning.SVM.Train | ( | ) |
Trains current SVM.
| float OpenCLTemplate.MachineLearning.SVM.TrainWithCrossValidation | ( | float | CrossValidationSetPercent, | |
| float[] | lambdaSet, | |||
| float[] | CSet | |||
| ) |
Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C. Returns best performance so far.
| CrossValidationSetPercent | Percentage of training examples that should be used as cross validation set | |
| lambdaSet | Values of lambda to try | |
| CSet | Values of c to try |
| float OpenCLTemplate.MachineLearning.SVM.TrainWithCrossValidation | ( | ) |
Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C.
| float OpenCLTemplate.MachineLearning.SVM.TrainWithCrossValidation | ( | float | CrossValidationSetPercent, | |
| float[] | lambdaSet, | |||
| float[] | CSet | |||
| ) |
Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C. Returns best performance so far.
| CrossValidationSetPercent | Percentage of training examples that should be used as cross validation set | |
| lambdaSet | Values of lambda to try | |
| CSet | Values of c to try |
| float OpenCLTemplate.MachineLearning.SVM.TrainWithCrossValidation | ( | ) |
Trains current SVM with cross-validation, adjusting kernel parameter lambda and box parameter C.
| ProblemConfig OpenCLTemplate::MachineLearning.SVM::ProblemCfg = new ProblemConfig(0.1f, 50, 1e-3f, 1) |
Problem configuration.
Training set for this solution.
1.6.3