示例#1
0
        /// <summary>
        /// 決定木を学習する
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <returns></returns>
#else
        /// <summary>
        /// Trains decision tree
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <returns></returns>
#endif
        public virtual bool Train(CvDTreeTrainData trainData, CvMat subsampleIdx)
        {
            if (trainData == null)
            {
                throw new ArgumentNullException(nameof(trainData));
            }
            if (subsampleIdx == null)
            {
                throw new ArgumentNullException(nameof(subsampleIdx));
            }

            return(NativeMethods.ml_CvDTree_train2(
                       ptr, trainData.CvPtr, subsampleIdx.CvPtr) != 0);
        }
示例#2
0
        /// <summary>
        /// 決定木を学習する
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <param name="ensemble"></param>
        /// <returns></returns>
#else
        /// <summary>
        /// Trains decision tree
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <param name="ensemble"></param>
        /// <returns></returns>
#endif
        public virtual bool Train(CvDTreeTrainData trainData, CvMat subsampleIdx, CvBoost ensemble)
        {
            if (trainData == null)
            {
                throw new ArgumentNullException("trainData");
            }
            if (subsampleIdx == null)
            {
                throw new ArgumentNullException("subsampleIdx");
            }

            return(NativeMethods.ml_CvBoostTree_train(
                       ptr, trainData.CvPtr, subsampleIdx.CvPtr, Cv2.ToPtr(ensemble)) != 0);
        }
示例#3
0
        /// <summary>
        /// ファイルストレージからモデルを読み込む
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="data"></param>
#else
        /// <summary>
        /// Reads the model from file storage
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="data"></param>
#endif
        public virtual void Read(CvFileStorage fs, CvFileNode node, CvDTreeTrainData data)
        {
            if (fs == null)
            {
                throw new ArgumentNullException(nameof(fs));
            }
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            NativeMethods.ml_CvDTree_read(ptr, fs.CvPtr, node.CvPtr, data.CvPtr);
        }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <param name="forest"></param>
        /// <returns></returns>
#else
        /// <summary>
        ///
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <param name="forest"></param>
        /// <returns></returns>
#endif
        public virtual bool Train(CvDTreeTrainData trainData, CvMat subsampleIdx, CvRTrees forest)
        {
            if (trainData == null)
            {
                throw new ArgumentNullException("trainData");
            }
            if (subsampleIdx == null)
            {
                throw new ArgumentNullException("subsampleIdx");
            }
            if (forest == null)
            {
                throw new ArgumentNullException("forest");
            }

            return(NativeMethods.ml_CvForestTree_train(
                       ptr, trainData.CvPtr, subsampleIdx.CvPtr, forest.CvPtr) != 0);
        }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="forest"></param>
        /// <param name="data"></param>
#else
        /// <summary>
        ///
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="forest"></param>
        /// <param name="data"></param>
#endif
        public virtual void Read(CvFileStorage fs, CvFileNode node, CvRTrees forest, CvDTreeTrainData data)
        {
            if (fs == null)
            {
                throw new ArgumentNullException("fs");
            }
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }
            if (forest == null)
            {
                throw new ArgumentNullException("forest");
            }
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            NativeMethods.ml_CvForestTree_read(
                ptr, fs.CvPtr, node.CvPtr, forest.CvPtr, data.CvPtr);
        }
示例#6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fs"></param>		
        /// <param name="node"></param>
		/// <param name="ensemble"></param>
		/// <param name="data"></param>
#else
		/// <summary>
        /// 
        /// </summary>
        /// <param name="fs"></param>		
        /// <param name="node"></param>
		/// <param name="ensemble"></param>
		/// <param name="data"></param>
#endif
		public virtual void Read(CvFileStorage fs, CvFileNode node, CvBoost ensemble, CvDTreeTrainData data)
        {
			if (fs == null)
                throw new ArgumentNullException("fs");
            if (node == null)
                throw new ArgumentNullException("node");
			if (ensemble == null)
                throw new ArgumentNullException("ensemble");
			if (data == null)
                throw new ArgumentNullException("data");

            NativeMethods.ml_CvBoostTree_read(
                ptr, fs.CvPtr, node.CvPtr, ensemble.CvPtr, data.CvPtr);
        }
示例#7
0
        /// <summary>
        /// 決定木を学習する
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
		/// <param name="ensemble"></param>
        /// <returns></returns>
#else
		/// <summary>
        /// Trains decision tree
        /// </summary>
        /// <param name="trainData"></param>
		/// <param name="subsampleIdx"></param>
		/// <param name="ensemble"></param>
        /// <returns></returns>
#endif
		public virtual bool Train(CvDTreeTrainData trainData, CvMat subsampleIdx, CvBoost ensemble)
        {
            if (trainData == null)
                throw new ArgumentNullException("trainData");
            if (subsampleIdx == null)
                throw new ArgumentNullException("subsampleIdx");

			return NativeMethods.ml_CvBoostTree_train(
                ptr, trainData.CvPtr, subsampleIdx.CvPtr, Cv2.ToPtr(ensemble)) != 0;
        }
示例#8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="ensemble"></param>
        /// <param name="data"></param>
#else
        /// <summary>
        ///
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="ensemble"></param>
        /// <param name="data"></param>
#endif
        public virtual void Read(CvFileStorage fs, CvFileNode node, CvBoost ensemble, CvDTreeTrainData data)
        {
            if (fs == null)
            {
                throw new ArgumentNullException("fs");
            }
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }
            if (ensemble == null)
            {
                throw new ArgumentNullException("ensemble");
            }
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            NativeMethods.ml_CvBoostTree_read(
                ptr, fs.CvPtr, node.CvPtr, ensemble.CvPtr, data.CvPtr);
        }
示例#9
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="forest"></param>
        /// <param name="data"></param>
#else
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fs"></param>
        /// <param name="node"></param>
        /// <param name="forest"></param>
        /// <param name="data"></param>
#endif
        public virtual void Read(CvFileStorage fs, CvFileNode node, CvRTrees forest, CvDTreeTrainData data)
        {
            if (fs == null)
                throw new ArgumentNullException("fs");
            if (node == null)
                throw new ArgumentNullException("node");
            if (forest == null)
                throw new ArgumentNullException("forest");
            if (data == null)
                throw new ArgumentNullException("data");

            NativeMethods.ml_CvForestTree_read(
                ptr, fs.CvPtr, node.CvPtr, forest.CvPtr, data.CvPtr);
        }
示例#10
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <param name="forest"></param>
        /// <returns></returns>
#else
        /// <summary>
        /// 
        /// </summary>
        /// <param name="trainData"></param>
        /// <param name="subsampleIdx"></param>
        /// <param name="forest"></param>
        /// <returns></returns>
#endif
        public virtual bool Train( CvDTreeTrainData trainData, CvMat subsampleIdx, CvRTrees forest )
        {
            if (trainData == null)
                throw new ArgumentNullException("trainData");
            if (subsampleIdx == null)
                throw new ArgumentNullException("subsampleIdx");
            if (forest == null)
                throw new ArgumentNullException("forest");

            return NativeMethods.ml_CvForestTree_train(
                ptr, trainData.CvPtr, subsampleIdx.CvPtr, forest.CvPtr) != 0;
        }