RBNLearning
Class Sampler

java.lang.Object
  extended by RBNLearning.Sampler

public class Sampler
extends java.lang.Object


Constructor Summary
Sampler()
           
 
Method Summary
 SparseRelStruc makeCitationGraph(int numauthors, double posauthors, double meanpapers, double meancites)
          Build a structure representing authors, papers and citations numauthors: number of authors posauthors: probability of an author being a positive example (high h number)
 SparseRelStruc makeRandomColoredGraph(int size, double edgeprob, double redprob, double blueprob)
          Constructs a random graph (given by binary relation 'edge') over 'size' nodes.
 SparseRelStruc makeRandomGraph(int size, double edgeprob, boolean acyclic, int compnum)
          Constructs a random graph (given by binary relation 'edge') over 'size' nodes.
 SparseRelStruc makeRandomPedigree(int size, double founderprop)
          Constructs a random pedigree-like structure: nodes have either two or zero parents
 SparseRelStruc makeRandomTypedDomain(int size, java.lang.String[] types, double[] typeprobs)
          Constructs a domain of size 'size' with objects of types 'types'.
 void makeSampleStruc(Primula pr)
           
 SparseRelStruc makeSlotchainBase(int numoftype, int numrels, int numsuccs, int numtypes, int numcomp)
          Constructs a random structure for investigating slotchain like dependencies: domain consists of 'numtypes' different types of objects; 'numoftype' objects of each type.
 OneStrucData sampleOneStrucData(double pcmissing)
          Samples OneStrucData with a percentage of pcmissing values missing (completely at random)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sampler

public Sampler()
Method Detail

makeSampleStruc

public void makeSampleStruc(Primula pr)

sampleOneStrucData

public OneStrucData sampleOneStrucData(double pcmissing)
Samples OneStrucData with a percentage of pcmissing values missing (completely at random)


makeRandomGraph

public SparseRelStruc makeRandomGraph(int size,
                                      double edgeprob,
                                      boolean acyclic,
                                      int compnum)
Constructs a random graph (given by binary relation 'edge') over 'size' nodes. Edges are independent with probability 'edgeprob'. When acyclic = true then an acyclic graph is produced. Graph consists of compnum connected components. The nodes in component k are in the relation comp_k. Unary relations 'node' containing all nodes, and 'root' containing all nodes without edge-predecessors are also created.


makeRandomColoredGraph

public SparseRelStruc makeRandomColoredGraph(int size,
                                             double edgeprob,
                                             double redprob,
                                             double blueprob)
Constructs a random graph (given by binary relation 'edge') over 'size' nodes. Edges are independent with probability 'edgeprob'. Nodes are colored red,blue,green with probabilities redprob,blueprob,(1-redprob-blueprob)


makeRandomTypedDomain

public SparseRelStruc makeRandomTypedDomain(int size,
                                            java.lang.String[] types,
                                            double[] typeprobs)
Constructs a domain of size 'size' with objects of types 'types'. typeprob[i] is the probability that an object will be assigned type types[i]. The elements of typeprobs should sum up to 1.


makeRandomPedigree

public SparseRelStruc makeRandomPedigree(int size,
                                         double founderprop)
Constructs a random pedigree-like structure: nodes have either two or zero parents


makeSlotchainBase

public SparseRelStruc makeSlotchainBase(int numoftype,
                                        int numrels,
                                        int numsuccs,
                                        int numtypes,
                                        int numcomp)
Constructs a random structure for investigating slotchain like dependencies: domain consists of 'numtypes' different types of objects; 'numoftype' objects of each type. Types are type_1,...,type_numtypes. Between objects of type_i and type_i+1 there are 'numrels' different relations 'rel_i_k' k=0,...,numrels-1. Each object of type i has exactly 'numsuccs' successors of type i+1 in each rel_i_k There are numcomp disjoint connected components of this structure

Parameters:
size -
numsuccs -
numtypes -
Returns:

makeCitationGraph

public SparseRelStruc makeCitationGraph(int numauthors,
                                        double posauthors,
                                        double meanpapers,
                                        double meancites)
                                 throws RBNCompatibilityException,
                                        RBNSyntaxException
Build a structure representing authors, papers and citations numauthors: number of authors posauthors: probability of an author being a positive example (high h number)

Parameters:
numauthors -
Returns:
Throws:
RBNCompatibilityException
RBNSyntaxException