good stuff
This commit is contained in:
parent
ea8389ef40
commit
f4de0eeb9f
39 changed files with 5165 additions and 348 deletions
|
|
@ -52,6 +52,23 @@ impl Aggregator {
|
|||
}
|
||||
}
|
||||
|
||||
/// Merge another aggregator's results into this one.
|
||||
pub fn merge(&mut self, other: &Aggregator) {
|
||||
self.count += other.count;
|
||||
for i in 0..self.mins.len() {
|
||||
if other.feat_counts[i] > 0 {
|
||||
if other.mins[i] < self.mins[i] {
|
||||
self.mins[i] = other.mins[i];
|
||||
}
|
||||
if other.maxs[i] > self.maxs[i] {
|
||||
self.maxs[i] = other.maxs[i];
|
||||
}
|
||||
self.sums[i] += other.sums[i];
|
||||
self.feat_counts[i] += other.feat_counts[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Add a row, only aggregating the features at the given indices.
|
||||
#[inline]
|
||||
pub fn add_row_selective(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue