Evaluate NeurEco Classification model with the Python API
Evaluate NeurEco Classification model with the Python API#
To evaluate a NeurEco Classification model in Python API, import NeurEcoTabular library:
from NeurEco import NeurEcoTabular as Tabular
Initialize a NeurEco object to handle the Classification problem:
model = Tabular.Classifier()
Build NeurEco Classification model with the Python API or load previously build and saved to “the/path/to/the/saved/classification/model.ernn” model:
Once model contains a Classification model, call method evaluate with the parameters set accordingly:
Evaluates a Tabular model on a set of input data.
required, NumPy array: input data array: shape (n, m) where n is the number of samples and m is the number of input features.
optional, NumPy array: perform evaluation with the model’s weights set to values in vec.
NumPy array: output data array: shape (n, p) where n is the number of samples and p is the number of output features.
The evaluated array outputs is non one-hot encoded. Each column j of this array contains the predicted probabilities for the samples to belong to the class number j.
Post-treatment to get the predicted class numbers:
import numpy as np output_labels = np.argmax(outputs, axis=1)