public class Instance
extends java.lang.Object
Title: Instance
Description: Structure for an instance used in the data-set
Modifier and Type | Field and Description |
---|---|
static int |
NOMINAL
Attribute nominal type flag.
|
static int |
NUMERICO
Attribute numeric type flag.
|
Constructor and Description |
---|
Instance(double[] m,
int cl,
int size)
Builder
|
Instance(int size)
Builder without data
|
Modifier and Type | Method and Description |
---|---|
void |
addCovered()
Increments the "covered" value
|
boolean |
compare(Instance m)
It compares if two examples are the same
|
Instance |
copy()
It makes a copy of the example
|
double |
getAttribute(int i)
It returns the value of the attribute i-th of the example
|
int |
getClas()
It returns the class of the example
|
int |
getCovered()
It returns the "covered" value, that is, the number of rules that covers the example
|
double[] |
getMuest()
It returns the example itself (array of values)
|
int |
getNattributes()
It returns the number of attributes of the example
|
long |
getPosFile()
It returns the position of the example in the input data file
|
int |
getType()
It returns the type of the instance
|
void |
print()
It shows the content of the example
|
void |
setAttribute(int i,
double val)
It sets a value for an attribute
|
void |
setClass(int i)
It assigns the class
|
void |
setCovered(int value)
It gives a "covered" value
|
void |
setMuest(double[] ds)
It assigns the values for the instance
|
void |
setPosFile(long l)
It assigns the position of the example in the input data file
|
void |
setType(int type)
It sets the type of the instance
|
public static int NOMINAL
public static int NUMERICO
public Instance(double[] m, int cl, int size)
m
- an array of attributescl
- the class of the instancesize
- the size of the instance (number of attributes)public Instance(int size)
size
- the size of the instance (number of attributes)public int getClas()
public double[] getMuest()
public void setClass(int i)
i
- class idpublic void setMuest(double[] ds)
ds
- an array of values for the instancepublic long getPosFile()
public void setPosFile(long l)
l
- file positionpublic double getAttribute(int i)
i
- attribute positionpublic int getNattributes()
public void setAttribute(int i, double val)
i
- attribute positionval
- new valuepublic void print()
public Instance copy()
public boolean compare(Instance m)
m
- Example to comparepublic int getCovered()
public void setCovered(int value)
value
- new valuepublic void addCovered()
public void setType(int type)
type
- int type of the instancepublic int getType()