actsnclass.random_forest

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

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.
  • max_depth (None or int (optional)) – The maximum depth of the tree. Default is None.
  • n_jobs (int (optional)) – Number of cores used to train the model. Default is 1.
Returns:

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