public void TestBoost() { using (Boost tree = new Boost()) { MCvBoostParams param = MCvBoostParams.GetDefaultParameter(); } }
public static extern bool CvBoostTrain( IntPtr model, IntPtr trainData, MlEnum.DataLayoutType tFlag, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, IntPtr varType, IntPtr missingMask, ref MCvBoostParams param, [MarshalAs(CvInvoke.BoolMarshalType)] bool update);
public static extern bool CvBoostTrain( IntPtr model, IntPtr trainData, MlEnum.DATA_LAYOUT_TYPE tFlag, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, IntPtr varType, IntPtr missingMask, MCvBoostParams param, [MarshalAs(UnmanagedType.I1)] bool update);
/// <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="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> varType, Matrix <Byte> missingMask, MCvBoostParams param, bool update) { return(MlInvoke.CvBoostTrain( _ptr, trainData.Ptr, tflag, responses.Ptr, IntPtr.Zero, IntPtr.Zero, varType == null ? IntPtr.Zero : varType.Ptr, missingMask == null ? IntPtr.Zero : missingMask.Ptr, ref param, update)); }
/// <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="varIdx">Can be null if not needed. When specified, identifies variables (features) of interest. It is a Matrix>int< of nx1</param> /// <param name="sampleIdx">Can be null if not needed. When specified, identifies samples of interest. It is a Matrix>int< of nx1</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.DATA_LAYOUT_TYPE tflag, Matrix <float> responses, Matrix <Byte> varIdx, Matrix <Byte> sampleIdx, Matrix <Byte> varType, Matrix <Byte> missingMask, MCvBoostParams param, bool update) { return(MlInvoke.CvBoostTrain( _ptr, trainData.Ptr, tflag, responses.Ptr, varIdx == null ? IntPtr.Zero : varIdx.Ptr, sampleIdx == null ? IntPtr.Zero : sampleIdx.Ptr, varType == null ? IntPtr.Zero : varType.Ptr, missingMask == null ? IntPtr.Zero : missingMask.Ptr, param, update)); }