jBNC Toolbox

jbnc.dataset
Class Dataset

java.lang.Object
  extended byjbnc.dataset.Dataset
Direct Known Subclasses:
DatasetInt

public class Dataset
extends java.lang.Object

Represents a data set.

Since:
June 1, 1999
Author:
Jarek Sacha
See Also:
NamesReader, DatasetReader

Field Summary
 java.util.Vector cases
          Vector of vectors representing cases.
protected  boolean discardIncompleteCases
          LOCAL
 AttributeSpecs[] names
          Description of each of the attributes in a case.
 
Constructor Summary
Dataset()
          Set everything to null .
 
Method Summary
 void clear()
           
 java.lang.Object clone()
          Performs a shallow copy of itself.
 void discardAllOfType(AttributeType type)
          Discards all attributes that match the given type.
 boolean getDiscardIncompleteCases()
           
 void openC45(java.lang.String fileStem)
           
 void openC45(java.lang.String namesFile, java.lang.String dataFile)
           
 void saveC45(java.lang.String fileStem)
           
 void saveC45(java.lang.String namesFile, java.lang.String dataFile)
           
 void saveCasesC45(java.lang.String fileName)
           
 void saveNamesC45(java.lang.String fileName)
           
 void setDiscardIncompleteCases(boolean discardIncompleteCases)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cases

public java.util.Vector cases
Vector of vectors representing cases. Each case attribute is allocated in type defined by 'names'.


names

public AttributeSpecs[] names
Description of each of the attributes in a case. Typically the last attribute in a case represent the class this case belongs to.


discardIncompleteCases

protected boolean discardIncompleteCases
LOCAL

Constructor Detail

Dataset

public Dataset()
Set everything to null .

Method Detail

setDiscardIncompleteCases

public void setDiscardIncompleteCases(boolean discardIncompleteCases)
Parameters:
discardIncompleteCases -

getDiscardIncompleteCases

public boolean getDiscardIncompleteCases()
Returns:
discardIncompleteCases

openC45

public void openC45(java.lang.String fileStem)
             throws java.lang.Exception
Parameters:
fileStem -
Throws:
java.lang.Exception

openC45

public void openC45(java.lang.String namesFile,
                    java.lang.String dataFile)
             throws java.lang.Exception
Parameters:
namesFile -
dataFile -
Throws:
java.lang.Exception

saveC45

public void saveC45(java.lang.String fileStem)
             throws java.lang.Exception
Parameters:
fileStem -
Throws:
java.lang.Exception

saveC45

public void saveC45(java.lang.String namesFile,
                    java.lang.String dataFile)
             throws java.lang.Exception
Parameters:
namesFile -
dataFile -
Throws:
java.lang.Exception

saveCasesC45

public void saveCasesC45(java.lang.String fileName)
                  throws java.lang.Exception
Parameters:
fileName -
Throws:
java.lang.Exception

saveNamesC45

public void saveNamesC45(java.lang.String fileName)
                  throws java.lang.Exception
Parameters:
fileName -
Throws:
java.lang.Exception

clear

public void clear()

discardAllOfType

public void discardAllOfType(AttributeType type)
Discards all attributes that match the given type. Removes columns from the data set and entries from the names vector.

Parameters:
type - Type of attributes to be discarded.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Performs a shallow copy of itself. Member variables in the clone dataset are references to variables in the parent dataset. Only primitive types members, like boolean, are actually copied.

Returns:
a clone of this dataset.
Throws:
java.lang.CloneNotSupportedException

SourceForge.net Logo