File tree 2 files changed +6
-8
lines changed
machine_learning/loss_functions
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Binary Cross-Entropy (BCE) Loss Function
3
3
4
- This script defines the Binary Cross-Entropy (BCE) loss function, commonly used for binary classification.
5
-
6
4
Description:
7
- BCE quantifies dissimilarity between true binary labels (0 or 1) and predicted probabilities.
5
+ Quantifies dissimilarity between true labels (0 or 1) and predicted probabilities.
8
6
It's widely used in binary classification tasks.
9
7
10
8
Formula:
11
9
BCE = -Σ(y_true * log(y_pred) + (1 - y_true) * log(1 - y_pred))
12
10
13
- Source: [Wikipedia - Cross entropy](https://en.wikipedia.org/wiki/Cross_entropy)
11
+ Source:
12
+ [Wikipedia - Cross entropy](https://en.wikipedia.org/wiki/Cross_entropy)
14
13
"""
15
14
16
15
import numpy as np
Original file line number Diff line number Diff line change 1
1
"""
2
2
Mean Squared Error (MSE) Loss Function
3
3
4
- This script defines the Mean Squared Error (MSE) loss function, commonly used for regression problems.
5
-
6
4
Description:
7
- MSE measures the average squared difference between true values (ground truth) and predicted values.
5
+ MSE measures the mean squared difference between true values and predicted values.
8
6
It serves as a measure of the model's accuracy in regression tasks.
9
7
10
8
Formula:
11
9
MSE = (1/n) * Σ(y_true - y_pred)^2
12
10
13
- Source: [Wikipedia - Mean squared error](https://en.wikipedia.org/wiki/Mean_squared_error)
11
+ Source:
12
+ [Wikipedia - Mean squared error](https://en.wikipedia.org/wiki/Mean_squared_error)
14
13
"""
15
14
16
15
import numpy as np
You can’t perform that action at this time.
0 commit comments