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

CreateMachine() public method

Creates a SupportVectorMachine that attends the requisites specified in this model.
public CreateMachine ( ) : Accord.MachineLearning.VectorMachines.SupportVectorMachine
return Accord.MachineLearning.VectorMachines.SupportVectorMachine
        public SupportVectorMachine CreateMachine()
        {
            switch (type)
            {
                case LibSvmSolverType.Unknown:
                    break;

                case LibSvmSolverType.L2RegularizedLogisticRegression:
                case LibSvmSolverType.L1RegularizedLogisticRegression:
                case LibSvmSolverType.L2RegularizedLogisticRegressionDual:
                case LibSvmSolverType.L2RegularizedL2LossSvc:
                case LibSvmSolverType.L2RegularizedL1LossSvcDual:
                case LibSvmSolverType.L2RegularizedL2LossSvcDual:
                case LibSvmSolverType.L1RegularizedL2LossSvc:
                case LibSvmSolverType.L2RegularizedL2LossSvr:
                case LibSvmSolverType.L2RegularizedL2LossSvrDual:
                case LibSvmSolverType.L2RegularizedL1LossSvrDual:
                    {
                        return SupportVectorMachine.FromWeights(Weights, 0);
                    }
            }

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