Skip to content

Commit

Permalink
models/feature: Add iteration limit warning (#9580)
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 authored Oct 4, 2024
1 parent 828f52e commit b692905
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/models/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn split_features(features: FeaturesMap) -> (FeaturesMap, FeaturesMap) {

// Then, we recursively move features from `features` to `features2` if they
// depend on features in `features2`.
for _ in 0..ITERATION_LIMIT {
for i in (0..ITERATION_LIMIT).rev() {
let split = features
.into_iter()
.partition::<FeaturesMap, _>(|(_k, vals)| {
Expand All @@ -33,6 +33,10 @@ pub fn split_features(features: FeaturesMap) -> (FeaturesMap, FeaturesMap) {

if !split.1.is_empty() {
features2.extend(split.1);

if i == 0 {
warn!("Iteration limit reached while splitting features!");
}
} else {
break;
}
Expand Down

0 comments on commit b692905

Please sign in to comment.