actsnclass.random_forest

actsnclass.random_forest(train_features: numpy.array, train_labels: numpy.array, test_features: numpy.array, nest=1000, seed=42)

Random Forest classifier.

Parameters:
  • train_features (np.array) – Training sample features.
  • train_labels (np.array) – Training sample classes.
  • test_features (np.array) – Test sample features.
  • nest (int (optional)) – Number of estimators (trees) in the forest. Default is 1000.
  • seed (float (optional)) – Seed for random number generator. Default is 42.
Returns:

  • predictions (np.array) – Predicted classes.
  • prob (np.array) – Classification probability for all objects, [pIa, pnon-Ia].