Skip to content

Commit

Permalink
fix: forest coverity issues (uxlfoundation#2657)
Browse files Browse the repository at this point in the history
* fix forest issues

* Update dtrees_train_data_helper.i

---------

Co-authored-by: Ian Faust <[email protected]>
  • Loading branch information
Alexandr-Solovev and icfaust authored Feb 15, 2024
1 parent e0f791e commit 7871c22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions cpp/daal/src/algorithms/dtrees/dtrees_train_data_helper.i
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ struct SplitData

SplitData()
: impurityDecrease(-daal::services::internal::MaxVal<algorithmFPType>::get()),
left {},
featureValue(0.0),
nLeft(0),
iStart(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,8 @@ typename DataHelper::NodeType::Base * TrainBatchTaskBase<algorithmFPType, BinInd
double improvement;
algorithmFPType leftWeights;
algorithmFPType totalWeights;
typename DataHelper::ImpurityData impurityLeft;
typename DataHelper::ImpurityData impurityRight;
typename DataHelper::ImpurityData impurityLeft {};
typename DataHelper::ImpurityData impurityRight {};
typename DataHelper::NodeType::Split * node;

WorkItem()
Expand Down Expand Up @@ -1132,7 +1132,7 @@ NodeSplitResult TrainBatchTaskBase<algorithmFPType, BinIndexType, DataHelper, cp
/* zero-based index of best split */
int64_t iBestSplit = -1;
int64_t idxFeatureValueBestSplit = -1;
typename DataHelper::TSplitData split;
typename DataHelper::TSplitData split {};
/* RNG for sample drawing */
RNGsInst<IndexType, cpu> rng;
/* index for swapping samples in Fisher-Yates sampling */
Expand Down

0 comments on commit 7871c22

Please sign in to comment.