Accord.IO.LibSvmModel.CreateAlgorithm C# (CSharp) Method

CreateAlgorithm() public method

Creates a support vector machine learning algorithm that attends the requisites specified in this model.
public CreateAlgorithm ( ) : ISupervisedLearning
return ISupervisedLearning
        public ISupervisedLearning<SupportVectorMachine, double[], double> CreateAlgorithm()
        {
            switch (type)
            {
                case LibSvmSolverType.L2RegularizedLogisticRegression: // -s 0
                    return new ProbabilisticNewtonMethod();

                case LibSvmSolverType.L2RegularizedL2LossSvcDual: // -s 1
                    return new LinearDualCoordinateDescent() { Loss = Loss.L2 };

                case LibSvmSolverType.L2RegularizedL2LossSvc: // -s 2
                    return new LinearNewtonMethod();

                case LibSvmSolverType.L2RegularizedL1LossSvcDual: // -s 3
                    return new LinearDualCoordinateDescent() { Loss = Loss.L1 };

                case LibSvmSolverType.L1RegularizedL2LossSvc: // -s 5
                    return new LinearCoordinateDescent();

                case LibSvmSolverType.L1RegularizedLogisticRegression: // -s 6
                    return new ProbabilisticCoordinateDescent();

                case LibSvmSolverType.L2RegularizedLogisticRegressionDual: // -s 7
                    return new ProbabilisticDualCoordinateDescent();

                case LibSvmSolverType.L2RegularizedL2LossSvr: // -11
                    return new LinearRegressionNewtonMethod();

                case LibSvmSolverType.L2RegularizedL2LossSvrDual: // -12
                    return new LinearRegressionCoordinateDescent() { Loss = Loss.L2 };

                case LibSvmSolverType.L2RegularizedL1LossSvrDual: // -13
                    return new LinearRegressionCoordinateDescent() { Loss = Loss.L1 };
            }

            throw new NotSupportedException("This solver type is unknown or not supported.");
        }