public class CNode extends Object implements 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.
|
weka.classifiers.Classifier |
getClassifier()
Returns the underlying classifier.
|
int[] |
getParentsY()
getParentsY - get the parents (indices) of this node
|
static void |
main(String[] args)
Main - run some tests.
|
double |
sample(weka.core.Instance x,
double[] ypred,
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 Exception
Exception
public void build(weka.core.Instances D, weka.classifiers.Classifier H) throws Exception
Exception
public double[] distribution(weka.core.Instance x, double[] ypred) throws Exception
Exception
public double[] distributionT(weka.core.Instance x_) throws Exception
Exception
public double sample(weka.core.Instance x, double[] ypred, Random r) throws Exception
Exception
public weka.core.Instance transform(weka.core.Instance x, double[] ypred) throws Exception
Exception
public void updateTransform(weka.core.Instance t_, double[] ypred) throws Exception
Exception
public double classify(weka.core.Instance x, double[] ypred) throws Exception
Exception
public static weka.core.Instances transform(weka.core.Instances D, int c, int[] pa_c) throws Exception
D
- original Instancesc
- to be the class Attributepa_c
- the parent indices of cException
public weka.classifiers.Classifier getClassifier()
Copyright © 2017. All Rights Reserved.