Ejemplo n.º 1
0
        //javadoc: SVM::trainAuto(samples, layout, responses, kFold, Cgrid)
        public bool trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid)
        {
            ThrowIfDisposed();
            if (samples != null)
            {
                samples.ThrowIfDisposed();
            }
            if (responses != null)
            {
                responses.ThrowIfDisposed();
            }
            if (Cgrid != null)
            {
                Cgrid.ThrowIfDisposed();
            }
#if UNITY_PRO_LICENSE || ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            bool retVal = ml_SVM_trainAuto_16(nativeObj, samples.nativeObj, layout, responses.nativeObj, kFold, Cgrid.getNativeObjAddr());

            return(retVal);
#else
            return(false);
#endif
        }
Ejemplo n.º 2
0
        //
        // C++:  bool cv::ml::SVM::trainAuto(Mat samples, int layout, Mat responses, int kFold = 10, Ptr_ParamGrid Cgrid = SVM::getDefaultGridPtr(SVM::C), Ptr_ParamGrid gammaGrid = SVM::getDefaultGridPtr(SVM::GAMMA), Ptr_ParamGrid pGrid = SVM::getDefaultGridPtr(SVM::P), Ptr_ParamGrid nuGrid = SVM::getDefaultGridPtr(SVM::NU), Ptr_ParamGrid coeffGrid = SVM::getDefaultGridPtr(SVM::COEF), Ptr_ParamGrid degreeGrid = SVM::getDefaultGridPtr(SVM::DEGREE), bool balanced = false)
        //

        //javadoc: SVM::trainAuto(samples, layout, responses, kFold, Cgrid, gammaGrid, pGrid, nuGrid, coeffGrid, degreeGrid, balanced)
        public bool trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid, ParamGrid pGrid, ParamGrid nuGrid, ParamGrid coeffGrid, ParamGrid degreeGrid, bool balanced)
        {
            ThrowIfDisposed();
            if (samples != null)
            {
                samples.ThrowIfDisposed();
            }
            if (responses != null)
            {
                responses.ThrowIfDisposed();
            }
            if (Cgrid != null)
            {
                Cgrid.ThrowIfDisposed();
            }
            if (gammaGrid != null)
            {
                gammaGrid.ThrowIfDisposed();
            }
            if (pGrid != null)
            {
                pGrid.ThrowIfDisposed();
            }
            if (nuGrid != null)
            {
                nuGrid.ThrowIfDisposed();
            }
            if (coeffGrid != null)
            {
                coeffGrid.ThrowIfDisposed();
            }
            if (degreeGrid != null)
            {
                degreeGrid.ThrowIfDisposed();
            }
#if UNITY_PRO_LICENSE || ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
            bool retVal = ml_SVM_trainAuto_10(nativeObj, samples.nativeObj, layout, responses.nativeObj, kFold, Cgrid.getNativeObjAddr(), gammaGrid.getNativeObjAddr(), pGrid.getNativeObjAddr(), nuGrid.getNativeObjAddr(), coeffGrid.getNativeObjAddr(), degreeGrid.getNativeObjAddr(), balanced);

            return(retVal);
#else
            return(false);
#endif
        }