stochasticsampling
Class AdaptiveAndSelfIS

java.lang.Object
  |
  +--stochasticsampling.ImportanceSampling
        |
        +--stochasticsampling.AdaptiveAndSelfIS
All Implemented Interfaces:
ImportanceInterface

public class AdaptiveAndSelfIS
extends ImportanceSampling

Title: AdaptiveAndSelfIS.java Description: Core Bayesian Network class Copyright: Copyright (c) 2001 Company: KSU / KDD


Field Summary
 boolean AIS
           
 boolean changeProbs
           
 java.util.Vector[] ICPT
           
 boolean old
           
 boolean SIS
           
 
Constructor Summary
AdaptiveAndSelfIS(BBN nodes, int numsamples, java.lang.String evfile)
          AdaptiveAndSelfIS is the constructor and initializes variables
AdaptiveAndSelfIS(BBN nodes, int numsamples, java.lang.String evfile, java.lang.String[][] trainingData)
          AdaptiveAndSelfIS is the constructor and initializes variables
 
Method Summary
 void generateAllSamples()
          generateAllSamples generates m samples using AIS or SIS
 void generateAllSamples(java.lang.String printingsFile)
          generateAllSamples generates m samples using AIS or SIS
 double getFitness()
          getFitness returns the fitness value after sampling (1 - RMSE w/ final ICPTs)
static void main(java.lang.String[] args)
           
 void setBBN(BBN newNetwork)
          setBBN sets the Bayesian network and initializes variables, including the NodeManager
 
Methods inherited from class stochasticsampling.ImportanceSampling
generateSample, generateSample, reorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICPT

public java.util.Vector[] ICPT

AIS

public boolean AIS

SIS

public boolean SIS

old

public boolean old

changeProbs

public boolean changeProbs
Constructor Detail

AdaptiveAndSelfIS

public AdaptiveAndSelfIS(BBN nodes,
                         int numsamples,
                         java.lang.String evfile,
                         java.lang.String[][] trainingData)
                  throws java.io.IOException
AdaptiveAndSelfIS is the constructor and initializes variables
Parameters:
nodes - - the Bayesian network
numsamples - - the number of samples to be taken
evfile - - the evidence file name for the network
trainingData - - a 2D string array of sample instantiations, used to compute exactprobs when using GASLEAK

AdaptiveAndSelfIS

public AdaptiveAndSelfIS(BBN nodes,
                         int numsamples,
                         java.lang.String evfile)
                  throws java.io.IOException
AdaptiveAndSelfIS is the constructor and initializes variables
Parameters:
nodes - - the Bayesian network
totalsamples - - the number of samples to be taken
evfile - - the evidence file name for the network
Method Detail

main

public static void main(java.lang.String[] args)

setBBN

public void setBBN(BBN newNetwork)
setBBN sets the Bayesian network and initializes variables, including the NodeManager
Parameters:
newNetwork - - the Bayesian network to be set

generateAllSamples

public void generateAllSamples(java.lang.String printingsFile)
                        throws java.io.IOException
generateAllSamples generates m samples using AIS or SIS
Parameters:
printingsFile - - the output file for RMSE results

generateAllSamples

public void generateAllSamples()
                        throws java.io.IOException
generateAllSamples generates m samples using AIS or SIS
Overrides:
generateAllSamples in class ImportanceSampling

getFitness

public double getFitness()
getFitness returns the fitness value after sampling (1 - RMSE w/ final ICPTs)
Returns:
double - the fitness value