Skip to content

Feature request: Weighted Square Loss #139

@marcobonici

Description

@marcobonici

I would like to use a Weighted Mean Square Loss

$$ \mathrm{WMSL}=\frac{1}{N}\sum_{i=1}^N w_i(y_i-\hat{y}_i)^2 $$

This is very close to the standard Mean Square Loss, with the additional Weight array that can be used to give a higher weight to one of the output features.

Something similar can also be done for the absolute square loss, in principle.

After a chat with @chriselrod and @ChrisRackauckas I decided to open an issue and a related PR.
I have forkerd the repo and I am willing to implement this by myself and if you are satisfied merge it.
I should have done most of what is needed, but a bit of guidance would be useful, since I never did something like that before. Basically, right now I adapted the code for the Mean Square error already present in the repo.

Here is the link to my forker version. There are just a few lines of code I added in the loss.jl part. Today I'll check more deeply what I did, but mainly I have a doubt on the target function definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions