Skip to contents

Fits a 100-tree Random Forest on training data and reports a classification report (precision / recall / F1 / support per class) on the held-out test set. Mirrors morie.ml.eval_robustness.

Usage

morie_ml_eval_robustness(
  X,
  y,
  test_X,
  test_y,
  n_estimators = 100L,
  random_state = 42L
)

Arguments

X

Training features (data.frame or matrix).

y

Training labels (factor or coercible to factor).

test_X

Test features.

test_y

Test labels.

n_estimators

Number of trees. Default 100.

random_state

Integer seed. Default 42.

Value

Named list keyed by class label and accuracy with precision / recall / f1-score / support per class, mirroring sklearn's classification_report(output_dict=True).