|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.misc.monotone.Coordinates
public class Coordinates
This is a simple implementation of the data space. The
Coordinates holds the internal weka value of an instance,
but with the class removed . The class is immutable,
and works best when all attibutes are nominal (ordinal), although
it will not give an error when working with numeric attributes.
In the latter case, performance will degrade because of the way
in which the hashcode is calculated.
This implementation is part of the master's thesis: "Studie en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd rangschikken", Stijn Lievens, Ghent University, 2004.
| Constructor Summary | |
|---|---|
Coordinates(Instance instance)
Create the Coordinates for the given instance. |
|
| Method Summary | |
|---|---|
int |
dimension()
Gets the dimension of the data space, this is the number of attributes, exluding the class attribute. |
boolean |
equals(java.lang.Object o)
Indicates if the object o equals this. |
java.lang.String |
getRevision()
Returns the revision string. |
double |
getValue(int index)
Get the value of the attribute with index index,
ignoring the class attribute. |
void |
getValues(double[] values)
Get the values of the coordinates. |
int |
hashCode()
Gets the hash code value for this object. |
boolean |
smallerOrEqual(Coordinates cc)
Checks if this is smaller or equal than cc. |
boolean |
strictlySmaller(Coordinates cc)
Checks if this is strictly smaller than cc. |
java.lang.String |
toString()
Get a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Coordinates(Instance instance)
Coordinates for the given instance.
instance - the Instance on which the
Coordinates will be based| Method Detail |
|---|
public double getValue(int index)
index,
ignoring the class attribute. Indices are counted starting from
0.
index - the index of the requested attribute
public void getValues(double[] values)
values - array serving as output, and the first
dimension() values are filled in.public boolean equals(java.lang.Object o)
o equals this.
equals in class java.lang.Objecto - the reference object with which to compare
true if o equals
this, false otherwise
public boolean strictlySmaller(Coordinates cc)
throws java.lang.IllegalArgumentException
this is strictly smaller than cc.
This means that for all indices i it holds that
this.getValue(i) <= cc.getValue(i) and that there is
at least one index i such that
this.getValue(i) ≠ cc.getValue(i)
cc - the Coordinates that this is
compared to
true if this is strictly
smaller than cc, false otherwise
java.lang.IllegalArgumentException - if the dimensions of both objects differ
public boolean smallerOrEqual(Coordinates cc)
throws java.lang.IllegalArgumentException
this is smaller or equal than cc.
This means that for all indices i it holds that
this.getValue(i) <= cc.getValue(i).
cc - the Coordinates that this is
compared to
true if this is
smaller or equal than cc, false otherwise
java.lang.IllegalArgumentException - if the dimensions of both objects differpublic int hashCode()
hashCode in class java.lang.Objectpublic int dimension()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||