Skip to content

Commit

Permalink
Remove some dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
jinlow committed Mar 23, 2024
1 parent cf0e730 commit ee87d36
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/objective.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,6 @@ impl ObjectiveFunction for LogLoss {
.unzip()
}

// #[inline]
// fn calc_grad(y: &[f64], yhat: &[f64], sample_weight: &[f64]) -> Vec<f32> {
// y.iter()
// .zip(yhat)
// .zip(sample_weight)
// .map(|((y_, yhat_), w_)| {
// let yhat_ = f64::ONE / (f64::ONE + (-*yhat_).exp());
// ((yhat_ - *y_) * *w_) as f32
// })
// .collect()
// }
// #[inline]
// fn calc_hess(_: &[f64], yhat: &[f64], sample_weight: &[f64]) -> Vec<f32> {
// yhat.iter()
// .zip(sample_weight)
// .map(|(yhat_, w_)| {
// let yhat_ = f64::ONE / (f64::ONE + (-*yhat_).exp());
// (yhat_ * (f64::ONE - yhat_) * *w_) as f32
// })
// .collect()
// }
fn default_metric() -> Metric {
Metric::LogLoss
}
Expand Down Expand Up @@ -124,19 +103,6 @@ impl ObjectiveFunction for SquaredLoss {
ytot / ntot
}

// #[inline]
// fn calc_grad(y: &[f64], yhat: &[f64], sample_weight: &[f64]) -> Vec<f32> {
// y.iter()
// .zip(yhat)
// .zip(sample_weight)
// .map(|((y_, yhat_), w_)| ((*yhat_ - *y_) * *w_) as f32)
// .collect()
// }

// #[inline]
// fn calc_hess(_: &[f64], _: &[f64], sample_weight: &[f64]) -> Vec<f32> {
// sample_weight.iter().map(|v| *v as f32).collect()
// }
#[inline]
fn calc_grad_hess(y: &[f64], yhat: &[f64], sample_weight: &[f64]) -> (Vec<f32>, Vec<f32>) {
y.iter()
Expand Down

0 comments on commit ee87d36

Please sign in to comment.