Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,24 @@ bool = isLossFunction( 'beep' );
#include "stdlib/ml/base/sgd-classification/loss_functions.h"
```

#### STDLIB_ML_SGD_CLASSIFICATION
#### STDLIB_ML_SGD_CLASSIFICATION_LOSS_FUNCTION

An enumeration of SGD classification loss functions with the following fields:

- **STDLIB_ML_BASE_SGD_CLASSIFICATION_EPSILON_INSENSITIVE**: penalty is the absolute value of the error whenever the absolute error exceeds epsilon and zero otherwise.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_HINGE**: corresponds to a soft-margin linear Support Vector Machine (SVM), which can handle non-linearly separable data.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_HUBER**: squared-error loss for observations with error smaller than epsilon in magnitude, linear loss otherwise.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_LOG**: corresponds to Logistic Regression.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_MODIFIED_HUBER**: Huber loss function variant for classification.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_PERCEPTRON**: corresponds to the original perceptron by Rosenblatt (1957).
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_SQUARED_EPSILON_INSENSITIVE**: squared epsilon insensitive loss function.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_SQUARED_ERROR**: squared difference of the observed and fitted values.
- **STDLIB_ML_BASE_SGD_CLASSIFICATION_SQUARED_HINGE**: squared hinge loss function SVM (L2-SVM).
- **STDLIB_ML_SGD_CLASSIFICATION_EPSILON_INSENSITIVE**: penalty is the absolute value of the error whenever the absolute error exceeds epsilon and zero otherwise.
- **STDLIB_ML_SGD_CLASSIFICATION_HINGE**: corresponds to a soft-margin linear Support Vector Machine (SVM), which can handle non-linearly separable data.
- **STDLIB_ML_SGD_CLASSIFICATION_HUBER**: squared-error loss for observations with error smaller than epsilon in magnitude, linear loss otherwise.
- **STDLIB_ML_SGD_CLASSIFICATION_LOG**: corresponds to Logistic Regression.
- **STDLIB_ML_SGD_CLASSIFICATION_MODIFIED_HUBER**: Huber loss function variant for classification.
- **STDLIB_ML_SGD_CLASSIFICATION_PERCEPTRON**: corresponds to the original perceptron by Rosenblatt (1957).
- **STDLIB_ML_SGD_CLASSIFICATION_SQUARED_EPSILON_INSENSITIVE**: squared epsilon insensitive loss function.
- **STDLIB_ML_SGD_CLASSIFICATION_SQUARED_ERROR**: squared difference of the observed and fitted values.
- **STDLIB_ML_SGD_CLASSIFICATION_SQUARED_HINGE**: squared hinge loss function SVM (L2-SVM).

```c
#include "stdlib/ml/base/sgd-classification/loss_functions.h"

const enum STDLIB_ML_SGD_CLASSIFICATION_LOSS_FUNCTIONS v = STDLIB_ML_SGD_CLASSIFICATION_HINGE;
const enum STDLIB_ML_SGD_CLASSIFICATION_LOSS_FUNCTION v = STDLIB_ML_SGD_CLASSIFICATION_HINGE;
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@
/**
* Enumeration of SGD classification loss functions.
*/
enum STDLIB_ML_BASE_SGD_CLASSIFICATION_LOSS_FUNCTIONS {
enum STDLIB_ML_SGD_CLASSIFICATION_LOSS_FUNCTION {
// Penalty is the absolute value of the error whenever the absolute error exceeds epsilon and zero otherwise:
STDLIB_ML_BASE_SGD_CLASSIFICATION_EPSILON_INSENSITIVE = 0,
STDLIB_ML_SGD_CLASSIFICATION_EPSILON_INSENSITIVE = 0,

// Corresponds to a soft-margin linear Support Vector Machine (SVM), which can handle non-linearly separable data:
STDLIB_ML_BASE_SGD_CLASSIFICATION_HINGE,
STDLIB_ML_SGD_CLASSIFICATION_HINGE,

// Squared-error loss for observations with error smaller than epsilon in magnitude, linear loss otherwise:
STDLIB_ML_BASE_SGD_CLASSIFICATION_HUBER,
STDLIB_ML_SGD_CLASSIFICATION_HUBER,

// Corresponds to Logistic Regression:
STDLIB_ML_BASE_SGD_CLASSIFICATION_LOG,
STDLIB_ML_SGD_CLASSIFICATION_LOG,

// Huber loss function variant for classification:
STDLIB_ML_BASE_SGD_CLASSIFICATION_MODIFIED_HUBER,
STDLIB_ML_SGD_CLASSIFICATION_MODIFIED_HUBER,

// Corresponds to the original perceptron by Rosenblatt (1957):
STDLIB_ML_BASE_SGD_CLASSIFICATION_PERCEPTRON,
STDLIB_ML_SGD_CLASSIFICATION_PERCEPTRON,

// Squared epsilon insensitive loss function:
STDLIB_ML_BASE_SGD_CLASSIFICATION_SQUARED_EPSILON_INSENSITIVE,
STDLIB_ML_SGD_CLASSIFICATION_SQUARED_EPSILON_INSENSITIVE,

// Squared difference of the observed and fitted values:
STDLIB_ML_BASE_SGD_CLASSIFICATION_SQUARED_ERROR,
STDLIB_ML_SGD_CLASSIFICATION_SQUARED_ERROR,

// Squared hinge loss function SVM (L2-SVM):
STDLIB_ML_BASE_SGD_CLASSIFICATION_SQUARED_HINGE
STDLIB_ML_SGD_CLASSIFICATION_SQUARED_HINGE
};

#endif // !STDLIB_ML_BASE_SGD_CLASSIFICATION_LOSS_FUNCTIONS_H