|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.ga.watchmaker.cd.CDRule
public final class CDRule
Binary classification rule of the form:
if (condition1 && condition2 && ... ) then class = 1 else class = 0where conditioni = (wi): attributi oi vi
if (wi < a given threshold) then conditioni is not taken into
consideration
Constructor Summary | |
---|---|
CDRule(CDRule ind)
Copy Constructor |
|
CDRule(double threshold)
|
|
CDRule(double threshold,
Random rng)
Random rule. |
Method Summary | |
---|---|
static boolean |
areGenesEqual(CDRule rule1,
CDRule rule2,
int index)
Compares a given gene between two rules |
boolean |
areGenesEqual(int index1,
int index2)
Compares two genes from this Rule |
static int |
attributeIndex(int condInd)
Makes sure that the label is not handled by any condition. |
int |
classify(DataLine dl)
if all the active conditions are met returns 1, else returns 0. |
boolean |
equals(Object obj)
|
int |
getNbConditions()
|
boolean |
getO(int index)
operator |
double |
getV(int index)
|
double |
getW(int index)
|
int |
hashCode()
|
void |
setO(int index,
boolean o)
set the operator |
void |
setV(int index,
double v)
|
void |
setW(int index,
double w)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CDRule(double threshold)
threshold
- condition activation thresholdpublic CDRule(double threshold, Random rng)
public CDRule(CDRule ind)
Method Detail |
---|
public int classify(DataLine dl)
classify
in interface Rule
dl
- dataLine to classify
public static int attributeIndex(int condInd)
condInd
- condition index
public String toString()
toString
in class Object
public int getNbConditions()
public double getW(int index)
public void setW(int index, double w)
public boolean getO(int index)
public void setO(int index, boolean o)
o
- true if '>='; false if '<'public double getV(int index)
public void setV(int index, double v)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static boolean areGenesEqual(CDRule rule1, CDRule rule2, int index)
index
- gene index
public boolean areGenesEqual(int index1, int index2)
index1
- first gene indexindex2
- second gene index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |