public static extern bool CvRTreesTrain( IntPtr model, IntPtr trainData, MlEnum.DataLayoutType tFlag, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, IntPtr varType, IntPtr missingMask, ref MCvRTParams param);
public static extern bool CvGBTreesTrain( IntPtr model, IntPtr trainData, MlEnum.DataLayoutType tFlag, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, IntPtr varType, IntPtr missingMask, ref MCvGBTreesParams param, [MarshalAs(CvInvoke.BoolMarshalType)] bool update);
/// <summary> /// Train the decision tree using the specific traning data /// </summary> /// <param name="trainData">The training data. A 32-bit floating-point, single-channel matrix, one vector per row</param> /// <param name="tflag">data layout type</param> /// <param name="responses">A floating-point matrix of the corresponding output vectors, one vector per row. </param> /// <param name="varType">The types of input variables</param> /// <param name="missingMask">Can be null if not needed. When specified, it is an 8-bit matrix of the same size as <paramref name="trainData"/>, is used to mark the missed values (non-zero elements of the mask)</param> /// <param name="param">The parameters for training the decision tree</param> /// <returns></returns> public bool Train( Matrix <float> trainData, MlEnum.DataLayoutType tflag, Matrix <float> responses, Matrix <Byte> varType, Matrix <Byte> missingMask, MCvDTreeParams param) { return(MlInvoke.CvDTreeTrain( _ptr, trainData.Ptr, tflag, responses.Ptr, IntPtr.Zero, IntPtr.Zero, varType == null ? IntPtr.Zero : varType.Ptr, missingMask == null ? IntPtr.Zero : missingMask.Ptr, ref param)); }
/// <summary> /// Train the boost tree using the specific traning data /// </summary> /// <param name="trainData">The training data. A 32-bit floating-point, single-channel matrix, one vector per row</param> /// <param name="tflag">data layout type</param> /// <param name="responses">A floating-point matrix of the corresponding output vectors, one vector per row. </param> /// <param name="varMask">Can be null if not needed. When specified, it is a mask that identifies variables (features) of interest. It must be a Matrix>Byte< of n x 1 where n is the number of rows in <paramref name="trainData"/></param> /// <param name="sampleMask">Can be null if not needed. When specified, it is a mask identifies samples of interest. It must be a Matrix>Byte< of nx1, where n is the number of rows in <paramref name="trainData"/></param> /// <param name="varType">The types of input variables</param> /// <param name="missingMask">Can be null if not needed. When specified, it is an 8-bit matrix of the same size as <paramref name="trainData"/>, is used to mark the missed values (non-zero elements of the mask)</param> /// <param name="param">The parameters for training the boost tree</param> /// <param name="update">specifies whether the classifier needs to be updated (i.e. the new weak tree classifiers added to the existing ensemble), or the classifier needs to be rebuilt from scratch</param> /// <returns></returns> public bool Train( Matrix <float> trainData, MlEnum.DataLayoutType tflag, Matrix <float> responses, Matrix <Byte> varMask, Matrix <Byte> sampleMask, Matrix <Byte> varType, Matrix <Byte> missingMask, MCvBoostParams param, bool update) { return(MlInvoke.CvBoostTrain( _ptr, trainData.Ptr, tflag, responses.Ptr, varMask == null ? IntPtr.Zero : varMask.Ptr, sampleMask == null ? IntPtr.Zero : sampleMask.Ptr, varType == null ? IntPtr.Zero : varType.Ptr, missingMask == null ? IntPtr.Zero : missingMask.Ptr, ref param, update)); }