public class PNArray
extends java.lang.Object
Constructor and Description |
---|
PNArray()
Default Constructor
|
PNArray(myDataset train,
DataBase dataBase)
Parameters Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
copy(PNArray a)
Function to copy from a PNArray to ours.
|
double |
getN()
It returns the value of the negative weight of the PNArray
|
double |
getN(int var,
int value)
It returns the negative weight of a given literal
|
double |
getP()
It returns the value of the positive weight of the PNArray
|
double |
getP(int var,
int value)
It returns the positive weight of a given literal
|
void |
incrPositive(int pos)
It increases the positive value P of the PNArray by adding the weight of a training example given by its position in the training dataset
|
void |
ini(int clas)
It initializes a PNArray with a given class
|
void |
ini(Rule r)
It initializes a PNArray from a given rule
|
void |
reduceNegative(int pos)
It reduces the negative value P of the PNArray by extracting the weight of a training example given by its position in the training dataset
|
void |
reducePositive(int pos)
It reduces the positive value P of the PNArray by extracting the weight of a training example given by its position in the training dataset
|
public void copy(PNArray a)
Function to copy from a PNArray to ours.
a
- PNArray Object to be copiedpublic void ini(int clas)
It initializes a PNArray with a given class
clas
- int Class which we create a PNArray from.public void ini(Rule r)
It initializes a PNArray from a given rule
r
- Rule Given rule to fill a PNArraypublic void reducePositive(int pos)
It reduces the positive value P of the PNArray by extracting the weight of a training example given by its position in the training dataset
pos
- int Position of the example in the datasetpublic void reduceNegative(int pos)
It reduces the negative value P of the PNArray by extracting the weight of a training example given by its position in the training dataset
pos
- int Position of the example in the datasetpublic void incrPositive(int pos)
It increases the positive value P of the PNArray by adding the weight of a training example given by its position in the training dataset
pos
- int Position of the example in the datasetpublic double getP()
It returns the value of the positive weight of the PNArray
public double getN()
It returns the value of the negative weight of the PNArray
public double getP(int var, int value)
It returns the positive weight of a given literal
var
- int attribute of the literalvalue
- int attribute's value of the literalpublic double getN(int var, int value)
It returns the negative weight of a given literal
var
- int attribute of the literalvalue
- int attribute's value of the literal