org.knime.base.node.mine.svm.util
Class DoubleVector

java.lang.Object
  extended by org.knime.base.node.mine.svm.util.DoubleVector

public class DoubleVector
extends Object

This class is used to represent a vector (in the sense of input data sample). A vector contains double values and the class value.

Author:
Stefan, University of Konstanz, Nicolas Cebron, University of Konstanz

Constructor Summary
DoubleVector(ArrayList<Double> values, String classvalue)
          Default constructor with no associated RowKey.
DoubleVector(ModelContentRO predParams, String id)
          Loads a vector from a predParams object.
DoubleVector(RowKey key, ArrayList<Double> values, String classvalue)
          Default constructor.
 
Method Summary
 String getClassValue()
           
 RowKey getKey()
           
 int getNumberValues()
           
 double getValue(int i)
          return the i'th value in the vector.
 void saveTo(ModelContentWO predParams, String id)
          Save the vector to a ModelContent object.
 void setClassValue(String value)
          Sets the class value of the DoubleVector.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleVector

public DoubleVector(RowKey key,
                    ArrayList<Double> values,
                    String classvalue)
Default constructor.

Parameters:
key - the RowKey of the row associated with this vector.
values - the double values of the vector.
classvalue - the class value.

DoubleVector

public DoubleVector(ArrayList<Double> values,
                    String classvalue)
Default constructor with no associated RowKey.

Parameters:
values - the double values of the vector.
classvalue - the class value.

DoubleVector

public DoubleVector(ModelContentRO predParams,
                    String id)
             throws InvalidSettingsException
Loads a vector from a predParams object.

Parameters:
predParams - from where to load
id - used to identify this vector uniquely
Throws:
InvalidSettingsException - if a key is not found
Method Detail

getKey

public RowKey getKey()
Returns:
the RowKey of the row associated with this vector. Can be null.

getClassValue

public String getClassValue()
Returns:
the class value

getValue

public double getValue(int i)
return the i'th value in the vector.

Parameters:
i - the index of the value to return
Returns:
the value at this index

getNumberValues

public int getNumberValues()
Returns:
the number of values.

toString

public String toString()

Overrides:
toString in class Object

saveTo

public void saveTo(ModelContentWO predParams,
                   String id)
Save the vector to a ModelContent object.

Parameters:
predParams - where to save the vector
id - used to identify this vector uniquely

setClassValue

public void setClassValue(String value)
Sets the class value of the DoubleVector.

Parameters:
value - the new class value.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.