API Reference

The HOSA library is split into five modules:

  • hosa.optimization—for implementing the HOSA.

  • hosa.models.cnn—for implementing classification and regression models using Convolutional Neural Networks (CNN).

  • hosa.models.rnn—for implementing classification and regression models using Recurrent Neural Network (RNNs).

  • hosa.callbacks—for implementing early stopping callbacks for halting the model’s training.

  • hosa.helpers—for implementing helper functions for the package.

HOSA

This module implements the Heuristic Oriented Search Algorithm (HOSA).

hosa.BaseHOSA(x, y, model, n_outputs, ...[, ...])

Heuristic Oriented Search Algorithm (HOSA)

hosa.HOSACNN(x, y, model, n_outputs, ...[, ...])

Heuristic Oriented Search Algorithm (HOSA) for CNNs.

hosa.HOSARNN(x, y, model, n_outputs, ...[, ...])

Heuristic Oriented Search Algorithm (HOSA) for RNNs.

Models

CNN

This module implements classification and regression models using Convolutional Neural Networks (cnn).

cnn_models.BaseCNN(n_outputs, n_kernels[, ...])

Base class for Convolutional Neural Network (CNN) models for classification and regression.

cnn_models.CNNClassification(n_outputs, ...)

Convolutional Neural Network (CNN) classifier.

cnn_models.CNNRegression(n_outputs, n_kernels)

Convolutional Neural Network (CNN) regressor.

RNN

This module implements classification and regression models using Recurrent Neural Networks ( RNNs).

rnn_models.BaseRNN(n_outputs, ...[, ...])

Base class for Recurrent Neural Network (RNN) models for classification and regression.

rnn_models.RNNClassification(n_outputs, ...)

Recurrent Neural Network (RNN) model classifier.

rnn_models.RNNRegression(n_outputs, ...[, ...])

Recurrent Neural Network (RNN) model regressor.

Callbacks

This module implements early stopping callbacks for halting the model’s training.

early_stopping.EarlyStoppingAtMinLoss(...[, ...])

This class implements the early stopping for avoiding overfitting the model.

Helpers

This module implements all the helper functions required to prepare data, access models, and prepare the parameter grid for HOSA.

functions.sliding_window(x, window_size)

Creates a sliding window view of x according to the window size specified.

functions.metrics_multiclass(y_true, ...[, ...])

Computes the performance metrics for classification problems.

functions.create_overlapping(x, y, model[, ...])

Depending on the model chosen, prepare the data with segmented windows according to the number of epochs and overlapping type.

functions.create_parameter_grid(param_grid)

This function generates an iterator that can be traversed through all the parameter value combinations.

functions.prepare_param_overlapping(...)

Prepares, considering the given specification, the parameters for creating the input and output overlapping.