/// <summary> /// 現在の SVM パラメータを返す /// </summary> /// <returns></returns> #else /// <summary> /// Returns current SVM parameters /// </summary> /// <returns></returns> #endif public CvSVMParams GetParams() { var p = new WCvSVMParams(); NativeMethods.ml_CvSVM_get_params(ptr, ref p); return(new CvSVMParams(p)); }
/// <summary> /// 初期化 /// </summary> /// <param name="svmType">SVMの種類</param> /// <param name="kernelType">SVMカーネルの種類</param> /// <param name="degree">poly 用</param> /// <param name="gamma">poly/rbf/sigmoid 用</param> /// <param name="coef0">poly/sigmoid 用</param> /// <param name="c">SVMType.CSvc, SVMType.EpsSvr, SVMType.NuSvr 用</param> /// <param name="nu">SVMType.NuSvc, SVMType.OneClass, SVMType.NuSvr 用</param> /// <param name="p">SVMType.EpsSvr 用</param> /// <param name="classWeights">SVMType.CSvc 用</param> /// <param name="termCrit">終了条件</param> #else /// <summary> /// Constructor /// </summary> /// <param name="svmType">Type of SVM</param> /// <param name="kernelType">The kernel type</param> /// <param name="degree">for poly</param> /// <param name="gamma">for poly/rbf/sigmoid</param> /// <param name="coef0">for poly/sigmoid</param> /// <param name="c">for SVMType.CSvc, SVMType.EpsSvr and SVMType.NuSvr</param> /// <param name="nu">for SVMType.NuSvc, SVMType.OneClass and SVMType.NuSvr</param> /// <param name="p">for SVMType.EpsSvr</param> /// <param name="classWeights">for SVMType.CSvc</param> /// <param name="termCrit">Termination criteria</param> #endif public CvSVMParams(SVMType svmType, SVMKernelType kernelType, double degree, double gamma, double coef0, double c, double nu, double p, CvMat classWeights, CvTermCriteria termCrit) { data = new WCvSVMParams(); NativeMethods.ml_CvSVMParams_new2( ref data, (int)svmType, (int)kernelType, degree, gamma, coef0, c, nu, p, Cv2.ToPtr(classWeights), termCrit); }
/// <summary> /// 現在の SVM パラメータを返す /// </summary> /// <returns></returns> #else /// <summary> /// Returns current SVM parameters /// </summary> /// <returns></returns> #endif public CvSVMParams GetParams() { var p = new WCvSVMParams(); NativeMethods.ml_CvSVM_get_params(ptr, ref p); return new CvSVMParams(p); }
public static extern void ml_CvSVM_get_params(IntPtr model, ref WCvSVMParams p);
public static extern int ml_CvSVM_train_auto_Mat( IntPtr model, IntPtr trainData, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, WCvSVMParams param, int kFold, CvParamGrid cGrid, CvParamGrid gammaGrid, CvParamGrid pGrid, CvParamGrid nuGrid, CvParamGrid coefGrid, CvParamGrid degreeGrid, int balanced);
public static extern int ml_CvSVM_train_Mat( IntPtr model, IntPtr trainData, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, WCvSVMParams param);
public static extern IntPtr ml_CvSVM_new2_Mat( IntPtr trainData, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, WCvSVMParams param);
/// <summary> /// 既定の初期化 /// </summary> #else /// <summary> /// Default constructor /// </summary> #endif public CvSVMParams() { data = new WCvSVMParams(); NativeMethods.ml_CvSVMParams_new1(ref data); }
public static extern void ml_CvSVMParams_new2(ref WCvSVMParams result, int svmType, int kernelType, double degree, double gamma, double coef0, double c, double nu, double p, IntPtr classWeights, CvTermCriteria termCrit);
public static extern void ml_CvSVMParams_new1(ref WCvSVMParams result);
/// <summary> /// 初期化 /// </summary> /// <param name="svmType">SVMの種類</param> /// <param name="kernelType">SVMカーネルの種類</param> /// <param name="degree">poly 用</param> /// <param name="gamma">poly/rbf/sigmoid 用</param> /// <param name="coef0">poly/sigmoid 用</param> /// <param name="c">SVMType.CSvc, SVMType.EpsSvr, SVMType.NuSvr 用</param> /// <param name="nu">SVMType.NuSvc, SVMType.OneClass, SVMType.NuSvr 用</param> /// <param name="p">SVMType.EpsSvr 用</param> /// <param name="classWeights">SVMType.CSvc 用</param> /// <param name="termCrit">終了条件</param> #else /// <summary> /// Constructor /// </summary> /// <param name="svmType">Type of SVM</param> /// <param name="kernelType">The kernel type</param> /// <param name="degree">for poly</param> /// <param name="gamma">for poly/rbf/sigmoid</param> /// <param name="coef0">for poly/sigmoid</param> /// <param name="c">for SVMType.CSvc, SVMType.EpsSvr and SVMType.NuSvr</param> /// <param name="nu">for SVMType.NuSvc, SVMType.OneClass and SVMType.NuSvr</param> /// <param name="p">for SVMType.EpsSvr</param> /// <param name="classWeights">for SVMType.CSvc</param> /// <param name="termCrit">Termination criteria</param> #endif public CvSVMParams(SVMType svmType, SVMKernelType kernelType, double degree, double gamma, double coef0, double c, double nu, double p, CvMat classWeights, CvTermCriteria termCrit ) { data = new WCvSVMParams(); NativeMethods.ml_CvSVMParams_new2( ref data, (int)svmType, (int)kernelType, degree, gamma, coef0, c, nu, p, Cv2.ToPtr(classWeights), termCrit); }
/// <summary> /// /// </summary> /// <param name="data"></param> internal CvSVMParams(WCvSVMParams data) { this.data = data; }