DataSharp/Data/Analysis/SupportVectorMachine.cs
/// <summary>
/// Returns the hypothesis of this SVM on given sample.
/// </summary>
/// <param name="sample">The given sample.</param>
/// <returns>The hypothesis of this SVM on given sample.</returns>
Returns the hypothesis of this SVM on given sample.
Returns the hypothesis of this SVM on given sample .
public double GetHypothesis(Vector sample)
        {
            if (sample == null)
                throw new ArgumentNullException("sample");
            if (sample.Count != dataMatrix.ColumnCount)
                throw new ArgumentException("The sample must have the same data format as the training set.");
            Vector kernelValues = Kernel.KernelTransform(supportVectors, sample);
            double hypothesis = kernelValues * Vector.ElementWiseMultiplication(supportVectorLabels, supportVectorAlphas) + bias;
            return hypothesis;
        }
public double GetHypothesis ( Vector sample ) { if ( sample == null ) throw new ArgumentNullException ( " " ) ; if ( sample . Count != dataMatrix . ColumnCount ) throw new ArgumentException ( " " ) ; Vector kernelValues = Kernel . KernelTransform ( supportVectors , sample ) ; double hypothesis = kernelValues * Vector . ElementWiseMultiplication ( supportVectorLabels , supportVectorAlphas ) + bias ; return hypothesis ; }
Returns the hypothesis of this SVM on given sample.
Returns the hypothesis of this SVM on given sample .
The hypothesis of this SVM on given sample.
The hypothesis of this SVM on given sample .
sample
Vector
The given sample.
The given sample .