Skip to content

Fix logit loss #40

@mnwright

Description

@mnwright

std::vector<std::vector<double>> W = *split.W, W_new = *split.W;
for(int p=0; p<value_size; ++p){
for(auto individual: split.I_s){
W[individual][p] = exp(W[individual][p]);
W_new[individual][p] = exp(W_new[individual][p] + log(M_s[p] / M_sp) - W_s_mean[p]);

If W and W_new are the same, why then treat them separately below?

split.min_sum += (*split.Y)[individual][p] * log(W[individual][p] / (1 + std::accumulate(W[individual].begin(), W[individual].end(), 0.0)) ); // ~ R_old
split.min_sum -= (*split.Y)[individual][p] * log(W_new[individual][p] / (1 + std::accumulate(W_new[individual].begin(), W_new[individual].end(), 0.0)) ); // ~ R_new

W and W_new are the same, so nothing happens?
And won't this give log(0) in some cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++Anything referring to the underlying C++ implementation.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions