jBNC Toolbox

jbnc.measures
Class QualityMeasureLCV

java.lang.Object
  extended byjbnc.measures.QualityMeasure
      extended byjbnc.measures.QualityMeasureLCV

public class QualityMeasureLCV
extends QualityMeasure

LCV - Local Cross Validation. Measure the quality of the bayesian network on the dataset using local cross validation (on class variable). By default 10-fold 1-time cross validation will be performed.

Since:
June 1, 1999
Author:
Jarek Sacha

Field Summary
protected  int cvFolds
          Number of cross-validation folds.
protected  int cvTimes
          Number of times the cross validation is repeated (averaged).
protected  FrequencyCalc[][] fc
           
protected  jbnc.measures.QualityMeasureLogC logC
           
protected  DatasetInt testDataset
           
protected  java.util.Vector[][] testSets
           
protected  DatasetInt trainDataset
           
 
Fields inherited from class jbnc.measures.QualityMeasure
alphaK, dataset, usePriors
 
Constructor Summary
QualityMeasureLCV()
          Constructor for the QualityMeasureLCV object
QualityMeasureLCV(DatasetInt dataset, int cvFolds)
          Create quality measure for given a dataset and a number of cross-validation folds.
QualityMeasureLCV(DatasetInt dataset, int cvFolds, int cvTimes)
          Create quality measure for given a dataset and a number of cross-validation folds and a number of cross-validation repetitions.
QualityMeasureLCV(int cvFolds)
          Create quality measure for given a number of cross-validation folds.
QualityMeasureLCV(int cvFolds, int cvTimes)
          Create quality measure for given a number of cross-validation folds and a number of cross-validation repetitions.
 
Method Summary
 double evaluate(BayesianNetworks.BayesNet net)
          Description of the Method
 int getCVFolds()
          Gets the number of cross-validation folds.
 int getCVTimes()
          Gets the number of times the cross validation is repeated (averaged).
 java.lang.String getName()
          Gets the Name attribute of the QualityMeasureLCV object
 void setDataset(DatasetInt dataset)
          Sets dataset used for grading Bayesian networks.
 
Methods inherited from class jbnc.measures.QualityMeasure
getAlphaK, getUsePriors, setAlphaK, setUsePriors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logC

protected jbnc.measures.QualityMeasureLogC logC

testSets

protected java.util.Vector[][] testSets

trainDataset

protected DatasetInt trainDataset

testDataset

protected DatasetInt testDataset

fc

protected FrequencyCalc[][] fc

cvFolds

protected int cvFolds
Number of cross-validation folds.


cvTimes

protected int cvTimes
Number of times the cross validation is repeated (averaged).

Constructor Detail

QualityMeasureLCV

public QualityMeasureLCV()
Constructor for the QualityMeasureLCV object


QualityMeasureLCV

public QualityMeasureLCV(int cvFolds)
Create quality measure for given a number of cross-validation folds. Number of cross-validation repetitions is set to 1.

Parameters:
cvFolds - Description of Parameter

QualityMeasureLCV

public QualityMeasureLCV(DatasetInt dataset,
                         int cvFolds)
Create quality measure for given a dataset and a number of cross-validation folds. Number of cross-validation repetitions is set to 1.

Parameters:
dataset - Description of Parameter
cvFolds - Description of Parameter

QualityMeasureLCV

public QualityMeasureLCV(int cvFolds,
                         int cvTimes)
Create quality measure for given a number of cross-validation folds and a number of cross-validation repetitions.

Parameters:
cvFolds - Description of Parameter
cvTimes - Description of Parameter

QualityMeasureLCV

public QualityMeasureLCV(DatasetInt dataset,
                         int cvFolds,
                         int cvTimes)
Create quality measure for given a dataset and a number of cross-validation folds and a number of cross-validation repetitions.

Parameters:
dataset - Description of Parameter
cvFolds - Description of Parameter
cvTimes - Description of Parameter
Method Detail

setDataset

public void setDataset(DatasetInt dataset)
Description copied from class: QualityMeasure
Sets dataset used for grading Bayesian networks.

Overrides:
setDataset in class QualityMeasure
Parameters:
dataset - The new Dataset value

getName

public java.lang.String getName()
Gets the Name attribute of the QualityMeasureLCV object

Specified by:
getName in class QualityMeasure
Returns:
The Name value

getCVFolds

public int getCVFolds()
Gets the number of cross-validation folds.

Returns:
The CVFolds value

getCVTimes

public int getCVTimes()
Gets the number of times the cross validation is repeated (averaged).

Returns:
The CVTimes value

evaluate

public final double evaluate(BayesianNetworks.BayesNet net)
                      throws java.lang.Exception
Description of the Method

Specified by:
evaluate in class QualityMeasure
Parameters:
net - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

SourceForge.net Logo