"RandomForest" (Machine Learning Method)

Details & Suboptions

  • Random forest is an ensemble learning method for classification and regression that operates by constructing a multitude of decision trees. The forest prediction is obtained by taking the most common class or the mean-value tree predictions. Each decision tree is trained on a random subset of the training set and only uses a random subset of the features (bootstrap aggregating algorithm).
  • The following options can be given:
  • "DistributionSmoothing"0.5regularization parameter
    "FeatureFraction"Automaticthe fraction of features to be randomly selected to train each tree
    "LeafSize"Automaticthe maximum number of examples in each leaf
    "TreeNumber"Automaticthe number of trees in the forest
  • "FeatureFraction", "LeafSize" and "DistributionSmoothing" can be used to control overfitting.

Examples

open allclose all

Basic Examples  (3)

Train a predictor on labeled examples:

In[1]:=
Click for copyable input
Out[1]=

Look at the PredictorInformation:

In[2]:=
Click for copyable input
Out[2]=

Predict a new example:

In[3]:=
Click for copyable input
Out[3]=

Train a classifier function on labeled examples:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Plot the probability that the class of an example is "A" or "B" as a function of the feature and compare them:

In[3]:=
Click for copyable input
Out[3]=

Train a predictor function on labeled data:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Compare the data with the predicted values and look at the standard deviation:

In[3]:=
Click for copyable input
Out[3]=

Options  (6)

See Also

Classify  Predict  ClassifierFunction  PredictorFunction  ClassifierMeasurements  PredictorMeasurements  ClassifierInformation  PredictorInformation  SequencePredict  ClusterClassify

Related Demonstrations

Related Methods