public class CNode
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
CNode(int j,
int[] inX,
int[] paY)
CNode - A Node 'j', taking inputs from all parents inX and paY.
|
| Modifier and Type | Method and Description |
|---|---|
void |
build(weka.core.Instances D,
weka.classifiers.Classifier H)
Build - Create transformation for this node, and train classifier of type H upon it.
|
double |
classify(weka.core.Instance x,
double[] ypred)
Return the argmax on #distribution(Instance, double[]).
|
double[] |
distribution(weka.core.Instance x,
double[] ypred)
The distribution this this node, given input x.
|
double[] |
distributionT(weka.core.Instance x_)
Same as #distribution(Instance, double[]), but the Instance is pre-transformed with ypred inside.
|
int[] |
getParentsY()
getParentsY - get the parents (indices) of this node
|
static void |
main(java.lang.String[] args)
Main - run some tests.
|
double |
sample(weka.core.Instance x,
double[] ypred,
java.util.Random r)
Sample the distribution given by #distribution(Instance, double[]).
|
weka.core.Instance |
transform(weka.core.Instance x,
double[] ypred)
Transform - turn [y1,y2,y3,x1,x2] into [y1,y2,x1,x2].
|
weka.core.Instances |
transform(weka.core.Instances D)
Transform - transform dataset D for this node.
|
static weka.core.Instances |
transform(weka.core.Instances D,
int c,
int[] pa_c)
Transform.
|
void |
updateTransform(weka.core.Instance t_,
double[] ypred) |
public CNode(int j,
int[] inX,
int[] paY)
j - the label index of this nodeinX - attribute indices going into this nodepaY - label indices going into this nodepublic int[] getParentsY()
public weka.core.Instances transform(weka.core.Instances D)
throws java.lang.Exception
java.lang.Exceptionpublic void build(weka.core.Instances D,
weka.classifiers.Classifier H)
throws java.lang.Exception
java.lang.Exceptionpublic double[] distribution(weka.core.Instance x,
double[] ypred)
throws java.lang.Exception
java.lang.Exceptionpublic double[] distributionT(weka.core.Instance x_)
throws java.lang.Exception
java.lang.Exceptionpublic double sample(weka.core.Instance x,
double[] ypred,
java.util.Random r)
throws java.lang.Exception
java.lang.Exceptionpublic weka.core.Instance transform(weka.core.Instance x,
double[] ypred)
throws java.lang.Exception
java.lang.Exceptionpublic void updateTransform(weka.core.Instance t_,
double[] ypred)
throws java.lang.Exception
java.lang.Exceptionpublic double classify(weka.core.Instance x,
double[] ypred)
throws java.lang.Exception
java.lang.Exceptionpublic static weka.core.Instances transform(weka.core.Instances D,
int c,
int[] pa_c)
throws java.lang.Exception
D - original Instancesc - to be the class Attributepa_c - the parent indices of cjava.lang.Exceptionpublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception