"ContingencyTable" (Machine Learning Method)

Details & Suboptions

  • A contingency table models the probability distribution of a nominal vector space by storing a probability value for each possible outcome.
  • If the data is unidimensional, the distribution corresponds to a categorical distribution.
  • The following options can be given:
  • "AdditiveSmoothing"Automaticvalue to be added to each count
  • If the data contains numerical values, they are discretized. The resulting distribution is still a valid distribution in the original space.
  • Information[LearnedDistribution[],"MethodOption"] can be used to extract the values of options chosen by the automation system.
  • LearnDistribution[,FeatureExtractor"Minimal"] can be used to remove most preprocessing and directly access the method.

Examples

open all close all

Basic Examples  (3)

Train a contingency-table distribution on a nominal dataset:

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

Look at the distribution Information:

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

Obtain options information:

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

Obtain an option value directly:

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

Compute the probabilities for the values "A" and "B":

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

Generate new samples:

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

Train a contingency-table distribution on a numeric dataset:

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

Look at the distribution Information:

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

Compute the probability density for a new example:

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

Plot the PDF along with the training data:

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

Generate and visualize new samples:

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

Train a contingency-table distribution on a two-dimensional dataset:

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

Plot the PDF along with the training data:

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

Use SynthesizeMissingValues to impute missing values using the learned distribution:

In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=

Options  (1)