Method Create
- Namespace
- OpenCvSharp.ML
- Assembly
- OpenCvSharp.dll
Create(InputArray, SampleTypes, InputArray, InputArray, InputArray, InputArray, InputArray)
Creates training data from in-memory arrays.
public static TrainData Create(InputArray samples, SampleTypes layout, InputArray responses, InputArray varIdx = default, InputArray sampleIdx = default, InputArray sampleWeights = default, InputArray varType = default)
Parameters
samplesInputArraymatrix of samples. It should have CV_32F type.
layoutSampleTypessee ml::SampleTypes.
responsesInputArraymatrix of responses. If the responses are scalar, they should be stored as a single row or as a single column. The matrix should have type CV_32F or CV_32S (in the former case the responses are considered as ordered by default; in the latter case - as categorical)
varIdxInputArrayvector specifying which variables to use for training. It can be an integer vector (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of active variables.
sampleIdxInputArrayvector specifying which samples to use for training. It can be an integer vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask of training samples.
sampleWeightsInputArrayoptional vector with weights for each sample. It should have CV_32F type.
varTypeInputArrayoptional vector of type CV_8U and size <number_of_variables_in_samples> + <number_of_variables_in_responses>, containing types of each input and output variable. See ml::VariableTypes.