The routines that call the accord algorithm:
First step: Create an algorithm
var teacher = new xxx ()
Step two: Train the algorithm
Teacher. Learn (input, output)
Step three: Let the algorithm predict
Teacher. Decide (Input)
Case00
// Create The learning algorithm with the chosen kernel var New Sequentialminimaloptimization<gaussian>() { +//}; // Use the algorithm to learn the SVM var svm = smo. Learn (inputs, outputs); // Compute the machine's answers for the given inputs BOOL [] prediction = SVM. Decide (inputs);
CASE01:
// Create a Naive Bayes learning algorithm var New Naivebayeslearning<normaldistribution>(); // Use the learning algorithm to learn var nb = teacher. Learn (inputs, outputs); // classify the samples using the model int [] answers = NB. Decide (inputs);
Case02
var New linearcoordinatedescent (); // Teach the vector machine var svm = teacher. Learn (inputs, outputs); // classify the samples using the model BOOL [] answers = SVM. Decide (inputs);
Case03
//Create a new sequential Minimal optimization (SMO) Learning//algorithm and estimate the complexity parameter C from datavarTeacher =NewSequentialminimaloptimization<gaussian>() {usecomplexityheuristic=true, Usekernelestimation=true //estimate the kernel from the data};//Teach the vector machinevarSVM =teacher. Learn (inputs, outputs);//classify the samples using the modelBOOL[] answers = SVM. Decide (inputs);
ML04 Accord call to implement the machine algorithm routines