Fork me on GitHub

confusion-matrix: Make a confusion matrix from sample classifier predictions.ΒΆ

Docstring:

Usage: qiime sample-classifier confusion-matrix [OPTIONS]

  Make a confusion matrix and calculate accuracy of predicted vs. true
  values for a set of samples classified using a sample classifier. If per-
  sample class probabilities are provided, will also generate Receiver
  Operating Characteristic curves and calculate area under the curve for
  each class.

Inputs:
  --i-predictions ARTIFACT SampleData[ClassifierPredictions]
                       Predicted values to plot on x axis. Should be
                       predictions of categorical data produced by a sample
                       classifier.                                  [required]
  --i-probabilities ARTIFACT SampleData[Probabilities]
                       Predicted class probabilities for each input sample.
                                                                    [optional]
Parameters:
  --m-truth-file METADATA
  --m-truth-column COLUMN  MetadataColumn[Categorical]
                       Metadata column (true values) to plot on y axis.
                                                                    [required]
  --p-missing-samples TEXT Choices('error', 'ignore')
                       How to handle missing samples in metadata. "error"
                       will fail if missing samples are detected. "ignore"
                       will cause the feature table and metadata to be
                       filtered, so that only samples found in both files are
                       retained.                            [default: 'error']
  --p-palette TEXT Choices('YellowOrangeBrown', 'YellowOrangeRed',
    'OrangeRed', 'PurpleRed', 'RedPurple', 'BluePurple', 'GreenBlue',
    'PurpleBlue', 'YellowGreen', 'summer', 'copper', 'viridis', 'plasma',
    'inferno', 'magma', 'sirocco', 'drifting', 'melancholy', 'enigma', 'eros',
    'spectre', 'ambition', 'mysteriousstains', 'daydream', 'solano',
    'navarro', 'dandelions', 'deepblue', 'verve', 'greyscale')
                       The color palette to use for plotting.
                                                          [default: 'sirocco']
Outputs:
  --o-visualization VISUALIZATION
                                                                    [required]
Miscellaneous:
  --output-dir PATH    Output unspecified results to a directory
  --verbose / --quiet  Display verbose output to stdout and/or stderr during
                       execution of this action. Or silence output if
                       execution is successful (silence is golden).
  --citations          Show citations and exit.
  --help               Show this message and exit.

Import:

from qiime2.plugins.sample_classifier.visualizers import confusion_matrix

Docstring:

Make a confusion matrix from sample classifier predictions.

Make a confusion matrix and calculate accuracy of predicted vs. true values
for a set of samples classified using a sample classifier. If per-sample
class probabilities are provided, will also generate Receiver Operating
Characteristic curves and calculate area under the curve for each class.

Parameters
----------
predictions : SampleData[ClassifierPredictions]
    Predicted values to plot on x axis. Should be predictions of
    categorical data produced by a sample classifier.
truth : MetadataColumn[Categorical]
    Metadata column (true values) to plot on y axis.
probabilities : SampleData[Probabilities], optional
    Predicted class probabilities for each input sample.
missing_samples : Str % Choices('error', 'ignore'), optional
    How to handle missing samples in metadata. "error" will fail if missing
    samples are detected. "ignore" will cause the feature table and
    metadata to be filtered, so that only samples found in both files are
    retained.
palette : Str % Choices('YellowOrangeBrown', 'YellowOrangeRed', 'OrangeRed', 'PurpleRed', 'RedPurple', 'BluePurple', 'GreenBlue', 'PurpleBlue', 'YellowGreen', 'summer', 'copper', 'viridis', 'plasma', 'inferno', 'magma', 'sirocco', 'drifting', 'melancholy', 'enigma', 'eros', 'spectre', 'ambition', 'mysteriousstains', 'daydream', 'solano', 'navarro', 'dandelions', 'deepblue', 'verve', 'greyscale'), optional
    The color palette to use for plotting.

Returns
-------
visualization : Visualization