Skip to content

Calculation of cost saving #24

@andremarco

Description

@andremarco

Hello, thank you very much for the project. I am trying to apply a cost-sensitive learning approach to a marketing problem, where a False Negative (the record is predicted as no-customer, whereas he currently is a customer) is much worse than the opposite. As you can see, the cost-matrix is not example dependent, but class-dependent. I create the example-dependent cost-matrix such the following (it is an example for the first 4 records):

FP FN TP TN
1 2 60 0 0
2 2 60 0 0
3 2 60 0 0
4 2 60 0 0

When I calculate the savings_score() function I get a negative score. Which is the meaning of the 1-cost at the numerator?

I am referring to the following piece of code:

cost = cost_loss(y_true, y_pred, cost_mat)
    return 1.0 - cost / cost_base

The cost value is not normalized, so I really don't understand the meaning of doing 1-.
Thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions