org.sci2s.eamhco.Prototype Class Reference

List of all members.

Public Member Functions

int getIndex ()
void setIndex (int index)
 Prototype (double[] inputs, double[] outputs)
 Prototype (Prototype original)
void set (Prototype original)
double[] getInputs ()
double getInput (int i)
void setInput (int i, double valor)
double[] getOutputs ()
double getOutput (int i)
double firstOutput ()
double label ()
double assignedClass ()
int numberOfInputs ()
void setFirstOutput (double val)
void setClass (double val)
void setLabel (double val)
int numberOfOutputs ()
Prototype mul (Prototype other)
double mulEscalar (Prototype other)
Prototype mul (double weight)
Prototype sqrt ()
double module ()
Prototype add (double increment)
Prototype add (Prototype other)
Prototype addMul (Prototype other, double weight)
Prototype addDiv (Prototype other, double divisor)
Prototype avg (Prototype other)
Prototype sub (Prototype other)
Prototype subMul (Prototype other, double weight)
String toString ()
boolean equals (Prototype other)
boolean equalsInputs (Prototype other)
void applyThresholds ()
void makeNull ()
void print ()
Prototype opposite ()
Prototype opposite (double a, double b)

Static Public Member Functions

static int getTypeOfAttribute (int i)
static Prototype avg (Prototype p1, Prototype p2)
static Prototype avg (Prototype p1, double w1, Prototype p2, double w2)

Static Public Attributes

static final int UNKNOW_INDEX = -1
static final int INTEGER = 0
static final int DOUBLE = 1
static final int NOMINAL = 2

Protected Attributes

int index = UNKNOW_INDEX
double[] inputs = null
double[] outputs = null

Static Protected Attributes

static int[] type

Package Attributes

boolean normalized = false

Detailed Description

Representation of a prototype. Contains several inputs an several outputs and common operations.

Author:
Isaac Triguero Vel�zquez.

Definition at line 13 of file Prototype.java.


Constructor & Destructor Documentation

org.sci2s.eamhco.Prototype.Prototype ( double[]  inputs,
double[]  outputs 
)

Constructs a Prototype.

Parameters:
inputs Inputs that will contain the new prototype
outputs Ouputs that will contain the new prototype

Definition at line 98 of file Prototype.java.

org.sci2s.eamhco.Prototype.Prototype ( Prototype  original  ) 

Constructs a Prototype from another protoype.

Parameters:
original Prototype that will be copied into the new object.

Definition at line 110 of file Prototype.java.


Member Function Documentation

Prototype org.sci2s.eamhco.Prototype.add ( Prototype  other  ) 

Performs add operation between two prototypes.

Parameters:
other A protype to be added to the implicit parameter.
Returns:
A prototype which inputs are the sum of another two, and outputs are a copy of implicit-ones.

Definition at line 382 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.add ( double  increment  ) 

Add an increment to all the inputs of the prototype

Parameters:
increment 
Returns:

Definition at line 367 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.addDiv ( Prototype  other,
double  divisor 
)

Performs add and divide operation between two prototypes.

Parameters:
other A protype to be added and divided to the implicit parameter.
divisor Constant that divides each sum.
Returns:
A prototype which inputs are the sum, divides with divisor, of another two. Outputs are a copy of implicit-ones.

Definition at line 431 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.addMul ( Prototype  other,
double  weight 
)

Performs add and product operation between two prototypes.

Parameters:
other A protype to be added and multiplied to the implicit parameter.
weight Constant to be multiplied to each sum.
Returns:
A prototype which inputs are the sum, multiplied with a weight, of another two. Outputs are a copy of implicit-ones.

Definition at line 407 of file Prototype.java.

void org.sci2s.eamhco.Prototype.applyThresholds (  ) 

Change attribute values that are not in [0.0, 1.0]. If an attribute is greater than 1.0, assigns 1.0 to it. If an attribute is smaller than 0.0, assigns 0.0 to it.

Definition at line 621 of file Prototype.java.

double org.sci2s.eamhco.Prototype.assignedClass (  ) 

Returns the assigned class of the prototype (same value as the first output of the protoype).

Returns:
Value of the assigned class.

Definition at line 201 of file Prototype.java.

static Prototype org.sci2s.eamhco.Prototype.avg ( Prototype  p1,
double  w1,
Prototype  p2,
double  w2 
) [static]

Performs averaged-based explicit operation between two prototypes.

Parameters:
p1 One protype to be merged.
w1 Weight of prototype p1.
p2 Other protype to be merged.
w2 Weight of prototype p2.
Returns:
A prototype which inputs are (w1*p1.p1_inputs + w2*p2_inputs)/(w1+w2). Outputs are a copy of p1.

Definition at line 481 of file Prototype.java.

static Prototype org.sci2s.eamhco.Prototype.avg ( Prototype  p1,
Prototype  p2 
) [static]

Performs average operation between two prototypes.

Parameters:
p1 One protype to be merged.
p2 Other protype to be merged.
Returns:
A prototype which inputs are the sum, divided between two of another two. Outputs are a copy of p1.

Definition at line 468 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.avg ( Prototype  other  ) 

Performs average operation between two prototypes.

Parameters:
other A protype to be merged to the implicit parameter.
Returns:
A prototype which inputs are the sum, divided between two of another two. Outputs are a copy of implicit-ones.

Definition at line 445 of file Prototype.java.

boolean org.sci2s.eamhco.Prototype.equals ( Prototype  other  ) 

Test if two prototypes are equals

Parameters:
other The other prototype to be compared with the caller.
Returns:
true if the two prototypes are equal, false in other case.

Definition at line 599 of file Prototype.java.

boolean org.sci2s.eamhco.Prototype.equalsInputs ( Prototype  other  ) 

Test if two prototypes have the same inputs

Parameters:
other The other prototype to be compared with the caller.
Returns:
true if the two prototypes have the same inputs, false in other case.

Definition at line 610 of file Prototype.java.

double org.sci2s.eamhco.Prototype.firstOutput (  ) 

Returns the first output of the protoype.

Returns:
Value of the output of the first attribute.

Definition at line 183 of file Prototype.java.

int org.sci2s.eamhco.Prototype.getIndex (  ) 

Informs of the index of the prototype.

Returns:
Index of the prototype.

Definition at line 52 of file Prototype.java.

double org.sci2s.eamhco.Prototype.getInput ( int  i  ) 

Returns a specific input of the protoype.

Parameters:
i Index of the input attribute.
Returns:
Value of the input of that attribute.

Definition at line 144 of file Prototype.java.

double [] org.sci2s.eamhco.Prototype.getInputs (  ) 

Returns the inputs of the protoype.

Returns:
Array with the inputs of the prototype.

Definition at line 134 of file Prototype.java.

double org.sci2s.eamhco.Prototype.getOutput ( int  i  ) 

Returns a specific output of the protoype. Not to be used. Use label() instead.

Parameters:
i Index of the output attribute.
Returns:
Value of the output of that attribute.

Definition at line 174 of file Prototype.java.

double [] org.sci2s.eamhco.Prototype.getOutputs (  ) 

Returns the outputs of the protoype.

Returns:
Array with the outputs of the prototype.

Definition at line 164 of file Prototype.java.

static int org.sci2s.eamhco.Prototype.getTypeOfAttribute ( int  i  )  [static]

Return the type of the attribute.

Parameters:
i ith attribute.

Definition at line 43 of file Prototype.java.

double org.sci2s.eamhco.Prototype.label (  ) 

Returns the label of the prototype (aka first output).

Returns:
Label of the prototype (AKA assigned class or first output).

Definition at line 192 of file Prototype.java.

void org.sci2s.eamhco.Prototype.makeNull (  ) 

Round integer attributes. Convert the prototype in the null prototype

Definition at line 660 of file Prototype.java.

double org.sci2s.eamhco.Prototype.module (  ) 
Returns:
the module of a Prototype, like the sqrt(a1^2 + a2^2...)

Definition at line 351 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.mul ( double  weight  ) 

Performs product operation between one prototype and a double.

Parameters:
weight Constant to be multiplied to each sum.
Returns:
A prototype which inputs product with a weight.

Definition at line 305 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.mul ( Prototype  other  ) 

Multiply component by component like a scalar product.

Note:
Two prototype must have the same size.
Parameters:
weight Constant to be multiplied to each sum.
Returns:
A prototype which inputs product with other..

Definition at line 258 of file Prototype.java.

double org.sci2s.eamhco.Prototype.mulEscalar ( Prototype  other  ) 

Multiply component by component like a scalar product.

Note:
Two prototype must have the same size.
Parameters:
weight Constant to be multiplied to each sum.
Returns:
A prototype which inputs product with other..

Definition at line 282 of file Prototype.java.

int org.sci2s.eamhco.Prototype.numberOfInputs (  ) 

Returns the number of attributes that has an input.

Returns:
Number of inputs of an example (prototype).

Definition at line 210 of file Prototype.java.

int org.sci2s.eamhco.Prototype.numberOfOutputs (  ) 

Returns the number of attributes that has an output.

Returns:
Number of outputs of an example (prototype).

Definition at line 246 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.opposite ( double  a,
double  b 
)

Opposite of a prototype

Returns:

Definition at line 711 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.opposite (  ) 

Opposite of a prototype

Returns:

Definition at line 694 of file Prototype.java.

void org.sci2s.eamhco.Prototype.print (  ) 

Print the prototype.

Definition at line 674 of file Prototype.java.

void org.sci2s.eamhco.Prototype.set ( Prototype  original  ) 

Copy the values of a Prototype from another protoype.

Parameters:
original Prototype that will be copied into the new object.

Definition at line 123 of file Prototype.java.

void org.sci2s.eamhco.Prototype.setClass ( double  val  ) 

Assigns a new class (aka new first output) to the prototype.

Parameters:
val Value to be assigned to the first output (aka label) of the prototype.

Definition at line 228 of file Prototype.java.

void org.sci2s.eamhco.Prototype.setFirstOutput ( double  val  ) 

Assigns a new value to the first output of the prototype.

Parameters:
val Value to be assigned to the first output (aka label) of the prototype.

Definition at line 219 of file Prototype.java.

void org.sci2s.eamhco.Prototype.setIndex ( int  index  ) 

Assigns a new index to the prototype.

Parameters:
index New index to be assigned.

Definition at line 61 of file Prototype.java.

void org.sci2s.eamhco.Prototype.setInput ( int  i,
double  valor 
)

Set a input for an attribute

Parameters:
i Index of the input attribute.
valor Value to set. Isaac.

Definition at line 156 of file Prototype.java.

void org.sci2s.eamhco.Prototype.setLabel ( double  val  ) 

Assigns a new label (aka first output, class) to the prototype.

Parameters:
val Value to be assigned to the first output (aka class) of the prototype.*

Definition at line 237 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.sqrt (  ) 

Performs sqrt operation to all the inputs of the prototype.

Returns:
A prototype which inputs are the sqrt(original).

Definition at line 329 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.sub ( Prototype  other  ) 

Performs substract operation between two prototypes.

Parameters:
other A protype to be substract to the implicit parameter.
Returns:
A prototype which inputs are the difference of another two, and outputs are a copy of implicit-ones.

Definition at line 499 of file Prototype.java.

Prototype org.sci2s.eamhco.Prototype.subMul ( Prototype  other,
double  weight 
)

Performs substract and product operation between two prototypes.

Parameters:
other A protype to be substract and multiplied to the implicit parameter.
weight Constant to be multiplied to each difference.
Returns:
A prototype which inputs are the difference (multiplied with a weight) of another two. Outputs are a copy of implicit-ones.

Definition at line 522 of file Prototype.java.

String org.sci2s.eamhco.Prototype.toString (  ) 

Converts the prototype to a String object

Returns:
String representation of a prototype.

Definition at line 542 of file Prototype.java.


Member Data Documentation

final int org.sci2s.eamhco.Prototype.DOUBLE = 1 [static]

Double type of attributes.

Definition at line 26 of file Prototype.java.

Index of the prototype in the set, used as an identifier.

Definition at line 20 of file Prototype.java.

double [] org.sci2s.eamhco.Prototype.inputs = null [protected]

Normalized inputs of the prototype (values in [0,1]).

Definition at line 67 of file Prototype.java.

final int org.sci2s.eamhco.Prototype.INTEGER = 0 [static]

Integer type of attributes.

Definition at line 24 of file Prototype.java.

final int org.sci2s.eamhco.Prototype.NOMINAL = 2 [static]

Nominal type of attributes.

Definition at line 28 of file Prototype.java.

boolean org.sci2s.eamhco.Prototype.normalized = false [package]

Informs if the prototype is normalized in [0, 1].

Definition at line 16 of file Prototype.java.

double [] org.sci2s.eamhco.Prototype.outputs = null [protected]

Normalized outputs of the prototype (values in [0,1]).

Definition at line 70 of file Prototype.java.

int [] org.sci2s.eamhco.Prototype.type [static, protected]

Type of each attribute of the set.

Definition at line 22 of file Prototype.java.

final int org.sci2s.eamhco.Prototype.UNKNOW_INDEX = -1 [static]

Informs that the prototype has not got a definided index.

Definition at line 18 of file Prototype.java.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 18:34:03 2010 by  doxygen 1.6.1