Table of Contents

Class ExtraTreesClassifierOptions<T>

Namespace
AiDotNet.Models.Options
Assembly
AiDotNet.dll

Configuration options for Extra Trees (Extremely Randomized Trees) classifier.

public class ExtraTreesClassifierOptions<T> : ClassifierOptions<T>

Type Parameters

T

The data type used for calculations.

Inheritance
ExtraTreesClassifierOptions<T>
Inherited Members

Remarks

Extra Trees is similar to Random Forest but with even more randomization. Instead of finding the best split, it selects splits at random, which can lead to better generalization and faster training.

For Beginners: Extra Trees is a "more random" version of Random Forest!

The key differences from Random Forest:

  1. Random Forest finds the BEST split among random features
  2. Extra Trees picks RANDOM splits for random features

This extra randomness:

  • Makes training even faster
  • Often generalizes better (less overfitting)
  • Creates more diverse trees

When to use Extra Trees:

  • When Random Forest is overfitting
  • When you need faster training
  • As an alternative to try alongside Random Forest

Properties

Bootstrap

Gets or sets whether to bootstrap samples.

public bool Bootstrap { get; set; }

Property Value

bool

True for bootstrap sampling, false for full dataset. Default is false.

Remarks

Unlike Random Forest, Extra Trees typically uses the full dataset for each tree (Bootstrap = false), relying on random split selection for diversity instead of bootstrap sampling.

Criterion

Gets or sets the split criterion.

public ClassificationSplitCriterion Criterion { get; set; }

Property Value

ClassificationSplitCriterion

The split quality measure. Default is Gini.

MaxDepth

Gets or sets the maximum depth of each tree.

public int? MaxDepth { get; set; }

Property Value

int?

The maximum depth, or null for unlimited. Default is null.

MaxFeatures

Gets or sets the maximum number of features to consider.

public string MaxFeatures { get; set; }

Property Value

string

"sqrt", "log2", "all", or a number. Default is "sqrt".

MinImpurityDecrease

Gets or sets the minimum impurity decrease for splitting.

public double MinImpurityDecrease { get; set; }

Property Value

double

The threshold. Default is 0.0.

MinSamplesLeaf

Gets or sets the minimum samples required at a leaf.

public int MinSamplesLeaf { get; set; }

Property Value

int

The minimum samples. Default is 1.

MinSamplesSplit

Gets or sets the minimum samples required to split.

public int MinSamplesSplit { get; set; }

Property Value

int

The minimum samples. Default is 2.

NEstimators

Gets or sets the number of trees in the forest.

public int NEstimators { get; set; }

Property Value

int

The number of trees. Default is 100.

RandomState

Gets or sets the random state for reproducibility.

public int? RandomState { get; set; }

Property Value

int?

The random seed, or null for non-deterministic. Default is null.