evaluate: Evaluate a metANN Model

View source: R/evaluate.R

evaluateR Documentation

Evaluate a metANN Model

Description

Evaluates a fitted metANN model on new data.

Usage

evaluate(object, newdata, y_true = NULL, metrics = NULL, threshold = 0.5, ...)

Arguments

object

A fitted object of class "metann".

newdata

New data used for evaluation. For formula-based models, this should be a data frame containing the response variable. For x-y models, this should be a numeric matrix or numeric data frame.

y_true

Optional true response values. Required for x-y models. For formula-based models, if NULL, the response is extracted from newdata.

metrics

Optional performance metrics. If NULL, the metrics stored in the fitted model are used.

threshold

Classification threshold for binary classification.

...

Additional arguments passed to predict().

Value

An object of class "metann_evaluation".

Examples

fit <- met_mlp(
  formula = Petal.Width ~ Sepal.Length + Sepal.Width + Petal.Length,
  data = iris,
  hidden_layers = c(5),
  optimizer = optimizer_pso(pop_size = 10, max_iter = 10),
  seed = 123,
  verbose = FALSE
)

evaluate(fit, newdata = iris)

metANN documentation built on May 16, 2026, 1:06 a.m.