JSMILE Learning: Dataset

From DSL

Jump to: navigation, search

This class holds data that can be used for learning. All learning algorithms take a data set as input.

[edit] Constants

  • static final float DefaultMissingFloat

The default value for a missing value in case of a continuous variable.


  • static final int DefaultMissingInt

The default value for a missing value in case of a discrete variable.


[edit] Methods

  • int getRecordCount()

The number of records.


  • int getVariableCount()

The number of variables.


  • void addEmptyRecord()

Adds an empty record to the data set. The record will contain missing value markers.


  • void addFloatVariable(String id)

Adds a continuous variable to the data set. This method used DefaultMissingFloat as missing value marker.


  • void addFloatVariable(String id, float missingValue)

Adds a continuous variable to the data set and specify the value that indicates a missing value.


  • void addIntVariable(String id)

Adds a discrete variable to the data set. This method used DefaultMissingInt as missing value marker.


  • void addIntVariable(String id, int missingValue)

Adds a discrete variable to the data set and specify the value that indicates a missing value.


  • float getFloat(int variable, int record)

Returns the corresponding continuous element in the data set. This method throws a SmileException when an invalid variable or record index is passed.


  • int getInt(int variable, int record)

Returns the corresponding discrete element in the data set. This method throws a SmileException when an invalid variable or record index is passed.


  • int getNodeHandle(int variable)

Returns the handle of the variable. This method throws a SmileException when an invalid variable index is passed.


  • String[] getStateNames(int variable)

Returns the state names of the variable. This method throws a SmileException when an invalid variable index is passed.


  • String getVariableId(int variable)

Returns the id of the variable. This method throws a SmileException when an invalid variable index is passed.


  • void setFloat(int variable, int record, float value)

Sets the corresponding continuous element to a new value. This method throws a SmileException when an invalid variable or record index is passed.


  • void setInt(int variable, int record, int value)

Sets the corresponding discrete element to a new value. This method throws a SmileException when an invalid variable or record index is passed.


  • void setNodeHandle(int variable, int handle)

Sets the handle of the variable. This method throws a SmileException when an invalid variable index or handle is passed.


  • void setStateNames(int variable, String[] names)

Sets the state names of a variable. This method throws a SmileException when an invalid variable index is passed.

Personal tools