An exploration of nine cost functions.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
classification_cost.py
regression_cost.py

README.md

cost_functions

An exploration of nine cost functions.

Note: the terms cost function, loss function and error function are synonymous.

Cost functions for regression (regression_cost)

The following cost functions for regression are explored:

1. Mean Absolute Error (MAE) (L1)

alt text

Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html

2. Mean Squared Error (MSE) (L2)

alt text

Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_error.html

3. Root Mean Squared Error (RMSE)

alt text

4. Mean Squared Log Error (MSLE)

Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_squared_log_error.html

5. Root Mean Squared Log Error (RMSLE)

6. Huber Loss

alt text

7. Log-Cosh

alt text

Cost functions for classification (classification_cost)

The following cost functions for classification are explored:

8. Hinge Loss

alt text

Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.hinge_loss.html

9. Cross-entropy Loss (log loss)

alt text

Documentation: http://scikit-learn.org/stable/modules/generated/sklearn.metrics.log_loss.html

Learn more