Merge pull request #1339 from mdim:ml_cpp_wrappers_fix
This commit is contained in:
commit
45a0b39a73
@ -942,6 +942,8 @@ protected:
|
|||||||
CvDTreeNode* root;
|
CvDTreeNode* root;
|
||||||
CvMat* var_importance;
|
CvMat* var_importance;
|
||||||
CvDTreeTrainData* data;
|
CvDTreeTrainData* data;
|
||||||
|
CvMat train_data_hdr, responses_hdr;
|
||||||
|
cv::Mat train_data_mat, responses_mat;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int pruned_tree_idx;
|
int pruned_tree_idx;
|
||||||
@ -1053,6 +1055,8 @@ protected:
|
|||||||
// array of the trees of the forest
|
// array of the trees of the forest
|
||||||
CvForestTree** trees;
|
CvForestTree** trees;
|
||||||
CvDTreeTrainData* data;
|
CvDTreeTrainData* data;
|
||||||
|
CvMat train_data_hdr, responses_hdr;
|
||||||
|
cv::Mat train_data_mat, responses_mat;
|
||||||
int ntrees;
|
int ntrees;
|
||||||
int nclasses;
|
int nclasses;
|
||||||
double oob_error;
|
double oob_error;
|
||||||
@ -1268,6 +1272,8 @@ protected:
|
|||||||
virtual void initialize_weights(double (&p)[2]);
|
virtual void initialize_weights(double (&p)[2]);
|
||||||
|
|
||||||
CvDTreeTrainData* data;
|
CvDTreeTrainData* data;
|
||||||
|
CvMat train_data_hdr, responses_hdr;
|
||||||
|
cv::Mat train_data_mat, responses_mat;
|
||||||
CvBoostParams params;
|
CvBoostParams params;
|
||||||
CvSeq* weak;
|
CvSeq* weak;
|
||||||
|
|
||||||
|
@ -2122,9 +2122,14 @@ CvBoost::train( const Mat& _train_data, int _tflag,
|
|||||||
const Mat& _missing_mask,
|
const Mat& _missing_mask,
|
||||||
CvBoostParams _params, bool _update )
|
CvBoostParams _params, bool _update )
|
||||||
{
|
{
|
||||||
CvMat tdata = _train_data, responses = _responses, vidx = _var_idx,
|
train_data_hdr = _train_data;
|
||||||
sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
train_data_mat = _train_data;
|
||||||
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0,
|
responses_hdr = _responses;
|
||||||
|
responses_mat = _responses;
|
||||||
|
|
||||||
|
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
||||||
|
|
||||||
|
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
|
||||||
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
||||||
mmask.data.ptr ? &mmask : 0, _params, _update);
|
mmask.data.ptr ? &mmask : 0, _params, _update);
|
||||||
}
|
}
|
||||||
|
@ -1844,9 +1844,14 @@ bool CvERTrees::train( const Mat& _train_data, int _tflag,
|
|||||||
const Mat& _sample_idx, const Mat& _var_type,
|
const Mat& _sample_idx, const Mat& _var_type,
|
||||||
const Mat& _missing_mask, CvRTParams params )
|
const Mat& _missing_mask, CvRTParams params )
|
||||||
{
|
{
|
||||||
CvMat tdata = _train_data, responses = _responses, vidx = _var_idx,
|
train_data_hdr = _train_data;
|
||||||
sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
train_data_mat = _train_data;
|
||||||
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0,
|
responses_hdr = _responses;
|
||||||
|
responses_mat = _responses;
|
||||||
|
|
||||||
|
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
||||||
|
|
||||||
|
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
|
||||||
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
||||||
mmask.data.ptr ? &mmask : 0, params);
|
mmask.data.ptr ? &mmask : 0, params);
|
||||||
}
|
}
|
||||||
|
@ -839,9 +839,14 @@ bool CvRTrees::train( const Mat& _train_data, int _tflag,
|
|||||||
const Mat& _sample_idx, const Mat& _var_type,
|
const Mat& _sample_idx, const Mat& _var_type,
|
||||||
const Mat& _missing_mask, CvRTParams _params )
|
const Mat& _missing_mask, CvRTParams _params )
|
||||||
{
|
{
|
||||||
CvMat tdata = _train_data, responses = _responses, vidx = _var_idx,
|
train_data_hdr = _train_data;
|
||||||
sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
train_data_mat = _train_data;
|
||||||
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0,
|
responses_hdr = _responses;
|
||||||
|
responses_mat = _responses;
|
||||||
|
|
||||||
|
CvMat vidx = _var_idx, sidx = _sample_idx, vtype = _var_type, mmask = _missing_mask;
|
||||||
|
|
||||||
|
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0,
|
||||||
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
sidx.data.ptr ? &sidx : 0, vtype.data.ptr ? &vtype : 0,
|
||||||
mmask.data.ptr ? &mmask : 0, _params);
|
mmask.data.ptr ? &mmask : 0, _params);
|
||||||
}
|
}
|
||||||
|
@ -1594,9 +1594,14 @@ bool CvDTree::train( const Mat& _train_data, int _tflag,
|
|||||||
const Mat& _sample_idx, const Mat& _var_type,
|
const Mat& _sample_idx, const Mat& _var_type,
|
||||||
const Mat& _missing_mask, CvDTreeParams _params )
|
const Mat& _missing_mask, CvDTreeParams _params )
|
||||||
{
|
{
|
||||||
CvMat tdata = _train_data, responses = _responses, vidx=_var_idx,
|
train_data_hdr = _train_data;
|
||||||
sidx=_sample_idx, vtype=_var_type, mmask=_missing_mask;
|
train_data_mat = _train_data;
|
||||||
return train(&tdata, _tflag, &responses, vidx.data.ptr ? &vidx : 0, sidx.data.ptr ? &sidx : 0,
|
responses_hdr = _responses;
|
||||||
|
responses_mat = _responses;
|
||||||
|
|
||||||
|
CvMat vidx=_var_idx, sidx=_sample_idx, vtype=_var_type, mmask=_missing_mask;
|
||||||
|
|
||||||
|
return train(&train_data_hdr, _tflag, &responses_hdr, vidx.data.ptr ? &vidx : 0, sidx.data.ptr ? &sidx : 0,
|
||||||
vtype.data.ptr ? &vtype : 0, mmask.data.ptr ? &mmask : 0, _params);
|
vtype.data.ptr ? &vtype : 0, mmask.data.ptr ? &mmask : 0, _params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user