foscat.Softmax#

Classes#

SoftmaxClassifier

A classifier based on the softmax function for multi-class classification.

Module Contents#

class foscat.Softmax.SoftmaxClassifier(Nval, Nclass, Nhidden=10, Nlevel=1)#

A classifier based on the softmax function for multi-class classification.

Attributes:

model (Sequential): A TensorFlow/Keras model comprising a hidden layer and a softmax output layer.

Parameters:

Nval (int): Number of features in the input dataset. Nclass (int): Number of classes to classify the input data into. Nhidden (int, optional): Number of neurons in the hidden layer. Defaults to 10.

model#
fit(x_train, y_train, epochs=10)#

Trains the model on the provided dataset.

Args:

x_train (np.ndarray): Training data features, shape (num_samples, Nval). y_train (np.ndarray): Training data labels, shape (num_samples, ). epochs (int, optional): Number of epochs to train the model. Defaults to 10.

predict(x_train)#

Predicts the class labels for the given input data.

Args:

x_train (np.ndarray): Input data for which to predict class labels, shape (num_samples, Nval).

Returns:

np.ndarray: Predicted class labels for the input data.