|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.roughset.MDCutPoints
MDCutPoints
represents a set of cuts on numerical
attributes, used in
weka.filters.DynamicReductDiscretize
and
weka.filters.RSDiscretize
.
Constructor Summary | |
MDCutPoints()
Dummy constructor. |
|
MDCutPoints(Instances i)
Creates a new MDCutPoints instance by sorting the
instances on each successive numerical attribute and creating
SortedClasses -objects each time, representing the
instances. |
|
MDCutPoints(Reduct r)
|
Method Summary | |
void |
addCut(CutPoint cut)
Add a new cutPoint to the set. |
boolean |
attributeDiscretized(Attribute a)
Is attribute a discretized? |
Instances |
binaryInstances(Instances insts)
Create a new dataset where each cutpoint becomes a binary attribute. |
boolean |
equals(Object o)
|
void |
fillNonDiscretized(Instances inst)
Add all possible cuts for the nondiscretized attributes in the set |
CutPoint |
getCut(int i)
|
CutPoint |
getMaxCut()
Get the cutpoint that discerns the most objects. |
CutPoint |
getMaxCut(Attribute a)
Get the cut on attribute athat discerns the most pairs of objects modulo their decision values. |
CutPoint |
getMaxCut(SortedClasses classes)
|
MDCutPoints |
getSubset(Attributes a)
Translate a set of attributes into the corresponding set of cuts by this method. |
static void |
main(String[] args)
Method for testing the MDCutPoints |
boolean |
removeCut(CutPoint c)
|
int |
size()
|
double[][] |
toDoubleArray(Instances insts)
We use the representation of cutpoints that weka.filters.Discretizefilter uses so that we can
steal the convertInstance(Instance i) -method from
there in our own classes that use this class as the
representation of cutpoints. |
String |
toInfoString()
Outputs not only the attributes and values of the cuts, but also discernibility-related information |
Reduct |
toReduct(Instances insts)
Translate the cuts to a Reduct which is simply a set
of attributes associated with a new table of binary values. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MDCutPoints(Reduct r)
public MDCutPoints(Instances i) throws Exception
MDCutPoints
instance by sorting the
instances on each successive numerical attribute and creating
SortedClasses
-objects each time, representing the
instances. Each class represents a set of objects that all have
the same value on the current numerical attribute. Those sets are
given as arguments for the constructors of each
CutPoint
that is constructed.
i
- an Instances
value
Exception
- if an error occurspublic MDCutPoints()
MDCutPoints
instance.
Method Detail |
public void addCut(CutPoint cut) throws Exception
cut
- a CutPoint
value
Exception
- if the argument is null.public CutPoint getCut(int i)
public boolean removeCut(CutPoint c)
public CutPoint getMaxCut(Attribute a)
CutPoint
.
a
- an Attribute
value
CutPoint
valuepublic CutPoint getMaxCut()
CutPoint
valuepublic CutPoint getMaxCut(SortedClasses classes) throws NullPointerException
NullPointerException
public boolean attributeDiscretized(Attribute a)
a
- an Attribute
value
boolean
valuepublic void fillNonDiscretized(Instances inst)
inst
- an Instances
valuepublic Instances binaryInstances(Instances insts)
Create a new dataset where each cutpoint becomes a binary attribute. Encode "less than" as 0 and "greater than or equal" as 1 (see toAttributes() below). Then, insert the data from the old table into the new one. We will want to use this table for calculating a reduct, which will correspond to a set of cuts in the old table.
insts
- an Instances
value
Instances
valuepublic Reduct toReduct(Instances insts)
Reduct
which is simply a set
of attributes associated with a new table of binary values.
insts
- an Instances
value
Reduct
valuepublic MDCutPoints getSubset(Attributes a) throws Exception
toString()
-values of the cutspoints in this set and
keeps those that are matched to an attribute name.
a
- an Attributes
value
MDCutPoints
value
Exception
- if an error occurspublic double[][] toDoubleArray(Instances insts)
weka.filters.Discretizefilter
uses so that we can
steal the convertInstance(Instance i)
-method from
there in our own classes that use this class as the
representation of cutpoints.
insts
- an Instances
value
double[][]
valuepublic String toString()
toString
in class Object
public String toInfoString()
String
valuepublic boolean equals(Object o)
equals
in class Object
public int size()
public static void main(String[] args)
MDCutPoints
args
- a String[]
value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |