ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkSciVizStatistics Class Referenceabstract

Abstract base class for computing statistics with vtkStatistics. More...

#include <vtkSciVizStatistics.h>

Inheritance diagram for vtkSciVizStatistics:
Inheritance graph
[legend]
Collaboration diagram for vtkSciVizStatistics:
Collaboration graph
[legend]

Public Types

enum  Tasks { MODEL_INPUT, CREATE_MODEL, ASSESS_INPUT, MODEL_AND_ASSESS }
 Possible tasks the filter can perform. More...
 
typedef vtkTableAlgorithm Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
int GetNumberOfAttributeArrays ()
 Return the number of columns available for the current value of AttributeMode. More...
 
const char * GetAttributeArrayName (int n)
 Get the name of the n-th array ffor the current value of AttributeMode. More...
 
int GetAttributeArrayStatus (const char *arrName)
 Get the status of the specified array (i.e., whether or not it is a column of interest). More...
 
vtkInformationIntegerKey * MULTIPLE_MODELS ()
 A key used to mark the output model data object (output port 0) when it is a multiblock of models (any of which may be multiblock dataset themselves) as opposed to a multiblock dataset containing a single model. More...
 
virtual int GetAttributeMode ()
 Set/get the type of field attribute (cell, point, field) More...
 
virtual void SetAttributeMode (int)
 Set/get the type of field attribute (cell, point, field) More...
 
void EnableAttributeArray (const char *arrName)
 An alternate interface for preparing a selection of arrays in ParaView. More...
 
void ClearAttributeArrays ()
 An alternate interface for preparing a selection of arrays in ParaView. More...
 
virtual void SetTrainingFraction (double)
 Set/get the amount of data to be used for training. More...
 
virtual double GetTrainingFraction ()
 Set/get the amount of data to be used for training. More...
 
virtual void SetTask (int)
 Set/get whether this filter should create a model of the input or assess the input or both. More...
 
virtual int GetTask ()
 Set/get whether this filter should create a model of the input or assess the input or both. More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkSciVizStatisticsSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkSciVizStatistics ()
 
virtual ~vtkSciVizStatistics ()
 
virtual int FillInputPortInformation (int port, vtkInformation *info)
 
virtual int FillOutputPortInformation (int port, vtkInformation *info)
 
virtual int ProcessRequest (vtkInformation *request, vtkInformationVector **input, vtkInformationVector *output)
 
virtual int RequestDataObject (vtkInformation *request, vtkInformationVector **input, vtkInformationVector *output)
 
virtual int RequestData (vtkInformation *request, vtkInformationVector **input, vtkInformationVector *output)
 
virtual int RequestData (vtkCompositeDataSet *compDataOu, vtkCompositeDataSet *compModelOu, vtkCompositeDataSet *compDataIn, vtkCompositeDataSet *compModelIn, vtkDataObject *singleModel)
 
virtual int RequestData (vtkDataObject *observationsOut, vtkDataObject *modelOut, vtkDataObject *observationsIn, vtkDataObject *modelIn)
 
virtual int PrepareFullDataTable (vtkTable *table, vtkFieldData *dataAttrIn)
 
virtual int PrepareTrainingTable (vtkTable *trainingTable, vtkTable *fullDataTable, vtkIdType numObservations)
 
virtual int LearnAndDerive (vtkMultiBlockDataSet *model, vtkTable *inData)=0
 Method subclasses must override to calculate a full model from the given input data. More...
 
virtual int AssessData (vtkTable *observations, vtkDataObject *dataset, vtkMultiBlockDataSet *model)=0
 Method subclasses must override to assess an input table given a model of the proper type. More...
 
virtual vtkIdType GetNumberOfObservationsForTraining (vtkTable *observations)
 Subclasses may (but need not) override this function to guarantee that some minimum number of observations are included in the training data. More...
 

Protected Attributes

int AttributeMode
 
int Task
 
double TrainingFraction
 
vtkSciVizStatisticsPP
 

Detailed Description

Abstract base class for computing statistics with vtkStatistics.

This filter either computes a statistical model of a dataset or takes such a model as its second input. Then, the model (however it is obtained) may optionally be used to assess the input dataset.

This class serves as a base class that handles table conversion, interfacing with the array selection in the ParaView user interface, and provides a simplified interface to vtkStatisticsAlgorithm.

Thanks:
Thanks to David Thompson and Philippe Pebay from Sandia National Laboratories for implementing this class. Updated by Philippe Pebay, Kitware SAS 2012

Definition at line 51 of file vtkSciVizStatistics.h.

Member Typedef Documentation

◆ Superclass

typedef vtkTableAlgorithm vtkSciVizStatistics::Superclass

Definition at line 54 of file vtkSciVizStatistics.h.

Member Enumeration Documentation

◆ Tasks

Possible tasks the filter can perform.

The MODEL_AND_ASSESS task is not recommended; you should never evaluate data with a model if that data was used to create the model. Doing so can result in a too-liberal estimate of model error, especially if overfitting occurs. Because we expect that MODEL_AND_ASSESS, despite being ill-advised, will be frequently used the TrainingFraction parameter has been created.

Enumerator
MODEL_INPUT 

Execute Learn and Derive operations of a statistical engine on the input dataset.

CREATE_MODEL 

Create a statistical model from a random subset the input dataset.

ASSESS_INPUT 

Assess the input dataset using a statistical model from input port 1.

MODEL_AND_ASSESS 

Create a statistical model of the input dataset and use it to assess the dataset.

This is a bad idea.

Definition at line 116 of file vtkSciVizStatistics.h.

Constructor & Destructor Documentation

◆ vtkSciVizStatistics()

vtkSciVizStatistics::vtkSciVizStatistics ( )
protected

◆ ~vtkSciVizStatistics()

virtual vtkSciVizStatistics::~vtkSciVizStatistics ( )
protectedvirtual

Member Function Documentation

◆ GetClassName()

virtual const char* vtkSciVizStatistics::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkSciVizStatistics::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkSciVizStatistics::IsA ( const char *  type)
virtual

◆ SafeDownCast()

static vtkSciVizStatistics* vtkSciVizStatistics::SafeDownCast ( vtkObject *  o)
static

◆ PrintSelf()

virtual void vtkSciVizStatistics::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

◆ GetAttributeMode()

virtual int vtkSciVizStatistics::GetAttributeMode ( )
virtual

Set/get the type of field attribute (cell, point, field)

◆ SetAttributeMode()

virtual void vtkSciVizStatistics::SetAttributeMode ( int  )
virtual

Set/get the type of field attribute (cell, point, field)

◆ GetNumberOfAttributeArrays()

int vtkSciVizStatistics::GetNumberOfAttributeArrays ( )

Return the number of columns available for the current value of AttributeMode.

◆ GetAttributeArrayName()

const char* vtkSciVizStatistics::GetAttributeArrayName ( int  n)

Get the name of the n-th array ffor the current value of AttributeMode.

◆ GetAttributeArrayStatus()

int vtkSciVizStatistics::GetAttributeArrayStatus ( const char *  arrName)

Get the status of the specified array (i.e., whether or not it is a column of interest).

◆ EnableAttributeArray()

void vtkSciVizStatistics::EnableAttributeArray ( const char *  arrName)

An alternate interface for preparing a selection of arrays in ParaView.

◆ ClearAttributeArrays()

void vtkSciVizStatistics::ClearAttributeArrays ( )

An alternate interface for preparing a selection of arrays in ParaView.

◆ SetTrainingFraction()

virtual void vtkSciVizStatistics::SetTrainingFraction ( double  )
virtual

Set/get the amount of data to be used for training.

When 0.0 < TrainingFraction < 1.0, a randomly-sampled subset of the data is used for training. When an assessment is requested, all data (including the training data) is assessed, regardless of the value of TrainingFraction. The default value is 0.1.

The random sample of the original dataset (say, of size N) is obtained by choosing N random numbers in [0,1). Any sample where the random number is less than TrainingFraction is included in the training data. Samples are then randomly added or removed from the training data until it is the desired size.

◆ GetTrainingFraction()

virtual double vtkSciVizStatistics::GetTrainingFraction ( )
virtual

Set/get the amount of data to be used for training.

When 0.0 < TrainingFraction < 1.0, a randomly-sampled subset of the data is used for training. When an assessment is requested, all data (including the training data) is assessed, regardless of the value of TrainingFraction. The default value is 0.1.

The random sample of the original dataset (say, of size N) is obtained by choosing N random numbers in [0,1). Any sample where the random number is less than TrainingFraction is included in the training data. Samples are then randomly added or removed from the training data until it is the desired size.

◆ SetTask()

virtual void vtkSciVizStatistics::SetTask ( int  )
virtual

Set/get whether this filter should create a model of the input or assess the input or both.

This should take on a value from the Tasks enum. The default is MODEL_AND_ASSESS.

◆ GetTask()

virtual int vtkSciVizStatistics::GetTask ( )
virtual

Set/get whether this filter should create a model of the input or assess the input or both.

This should take on a value from the Tasks enum. The default is MODEL_AND_ASSESS.

◆ MULTIPLE_MODELS()

vtkInformationIntegerKey* vtkSciVizStatistics::MULTIPLE_MODELS ( )

A key used to mark the output model data object (output port 0) when it is a multiblock of models (any of which may be multiblock dataset themselves) as opposed to a multiblock dataset containing a single model.

◆ FillInputPortInformation()

virtual int vtkSciVizStatistics::FillInputPortInformation ( int  port,
vtkInformation *  info 
)
protectedvirtual

◆ FillOutputPortInformation()

virtual int vtkSciVizStatistics::FillOutputPortInformation ( int  port,
vtkInformation *  info 
)
protectedvirtual

◆ ProcessRequest()

virtual int vtkSciVizStatistics::ProcessRequest ( vtkInformation *  request,
vtkInformationVector **  input,
vtkInformationVector *  output 
)
protectedvirtual

◆ RequestDataObject()

virtual int vtkSciVizStatistics::RequestDataObject ( vtkInformation *  request,
vtkInformationVector **  input,
vtkInformationVector *  output 
)
protectedvirtual

◆ RequestData() [1/3]

virtual int vtkSciVizStatistics::RequestData ( vtkInformation *  request,
vtkInformationVector **  input,
vtkInformationVector *  output 
)
protectedvirtual

◆ RequestData() [2/3]

virtual int vtkSciVizStatistics::RequestData ( vtkCompositeDataSet *  compDataOu,
vtkCompositeDataSet *  compModelOu,
vtkCompositeDataSet *  compDataIn,
vtkCompositeDataSet *  compModelIn,
vtkDataObject *  singleModel 
)
protectedvirtual

◆ RequestData() [3/3]

virtual int vtkSciVizStatistics::RequestData ( vtkDataObject *  observationsOut,
vtkDataObject *  modelOut,
vtkDataObject *  observationsIn,
vtkDataObject *  modelIn 
)
protectedvirtual

◆ PrepareFullDataTable()

virtual int vtkSciVizStatistics::PrepareFullDataTable ( vtkTable *  table,
vtkFieldData *  dataAttrIn 
)
protectedvirtual

◆ PrepareTrainingTable()

virtual int vtkSciVizStatistics::PrepareTrainingTable ( vtkTable *  trainingTable,
vtkTable *  fullDataTable,
vtkIdType  numObservations 
)
protectedvirtual

◆ LearnAndDerive()

virtual int vtkSciVizStatistics::LearnAndDerive ( vtkMultiBlockDataSet *  model,
vtkTable *  inData 
)
protectedpure virtual

Method subclasses must override to calculate a full model from the given input data.

The model should be placed on the first output port of the passed vtkInformationVector as well as returned in the model parameter.

Implemented in vtkPSciVizMultiCorrelativeStats, vtkPSciVizKMeans, vtkPSciVizPCAStats, vtkPSciVizContingencyStats, and vtkPSciVizDescriptiveStats.

◆ AssessData()

virtual int vtkSciVizStatistics::AssessData ( vtkTable *  observations,
vtkDataObject *  dataset,
vtkMultiBlockDataSet *  model 
)
protectedpure virtual

Method subclasses must override to assess an input table given a model of the proper type.

The dataset parameter contains a shallow copy of input port 0 and should be modified to include the assessment.

Adding new arrays to point/cell/vertex/edge data should not pose a problem, but any alterations to the dataset itself will probably require that you create a deep copy before modification.

Parameters
observations- a table containing the field data of the dataset converted to a table
dataset- a shallow copy of the input dataset that should be altered to include an assessment of the output.
model- the statistical model with which to assess the observations.

Implemented in vtkPSciVizMultiCorrelativeStats, vtkPSciVizKMeans, vtkPSciVizPCAStats, vtkPSciVizContingencyStats, and vtkPSciVizDescriptiveStats.

◆ GetNumberOfObservationsForTraining()

virtual vtkIdType vtkSciVizStatistics::GetNumberOfObservationsForTraining ( vtkTable *  observations)
protectedvirtual

Subclasses may (but need not) override this function to guarantee that some minimum number of observations are included in the training data.

By default, it returns the maximum of: observations->GetNumberOfRows() * this->TrainingFraction and min( observations->GetNumberOfRows(), 100 ). Thus, it will require the entire set of observations unless there are more than 100.

[in] observations - a table containing the full number of available observations (in this process).

Member Data Documentation

◆ AttributeMode

int vtkSciVizStatistics::AttributeMode
protected

Definition at line 202 of file vtkSciVizStatistics.h.

◆ Task

int vtkSciVizStatistics::Task
protected

Definition at line 203 of file vtkSciVizStatistics.h.

◆ TrainingFraction

double vtkSciVizStatistics::TrainingFraction
protected

Definition at line 204 of file vtkSciVizStatistics.h.

◆ P

vtkSciVizStatisticsP* vtkSciVizStatistics::P
protected

Definition at line 205 of file vtkSciVizStatistics.h.


The documentation for this class was generated from the following file: