com.datumbox.framework.core.common.dataobjects
Class Record
- java.lang.Object
-
- com.datumbox.framework.core.common.dataobjects.Record
-
- All Implemented Interfaces:
- java.io.Serializable
public class Record extends java.lang.Object implements java.io.SerializableThe Record is the object that stores all the entries of the Dataset and it contains information about the x, y, predicted class and probabilities of the predictions. The record is immutable. In general Machine Learning methods can work with a variety of different types (Numbers, Boolean, Categorical and Ordinal). The types of the provided data are not known at compile time but rather on runtime and they heavily depend on the case or method. As a result all the data of x and y in the Record object, are stored internally as Objects. Moreover note that the column names of X are also defined as Object. This is because depending on the case, the columns can be Strings, Integers or even Tuples in the case of categorical features (tuples are implemented as immutable List<Object>). For the response variable y it applies the same; depending on the method it can be a Number, Boolean, Categorical or Ordinal. As a result it is also stored as Object.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Record(AssociativeArray x, java.lang.Object y)Constructor which takes as arguments the x and y data.Record(AssociativeArray x, java.lang.Object y, java.lang.Object yPredicted, AssociativeArray yPredictedProbabilities)Constructor which takes as arguments the x, y, predicted y and predicted probaibilites.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Checks if the provided object is equal to the current instance.AssociativeArraygetX()It returns an AssociativeArray with all the xData of the Record.java.lang.ObjectgetY()It returns the real response variable of the Record.java.lang.ObjectgetYPredicted()It returns the predicted response variable of the Record.AssociativeArraygetYPredictedProbabilities()If prediction probabilities are available for the particular algorithm, then this method will return these probabilities.inthashCode()The hash code of the record.java.lang.StringtoString()
-
-
-
Constructor Detail
-
Record
public Record(AssociativeArray x, java.lang.Object y)
Constructor which takes as arguments the x and y data. If the real response variable y is unknown you should pass a null value.- Parameters:
x-y-
-
Record
public Record(AssociativeArray x, java.lang.Object y, java.lang.Object yPredicted, AssociativeArray yPredictedProbabilities)
Constructor which takes as arguments the x, y, predicted y and predicted probaibilites.- Parameters:
x-y-yPredicted-yPredictedProbabilities-
-
-
Method Detail
-
getX
public AssociativeArray getX()
It returns an AssociativeArray with all the xData of the Record. The data are stored in an unmodifiable map to ensure they can't be changed.- Returns:
-
getY
public java.lang.Object getY()
It returns the real response variable of the Record. If unknown it will have a null value.- Returns:
-
getYPredicted
public java.lang.Object getYPredicted()
It returns the predicted response variable of the Record. The predicted variable has a non-null value when a prediction is made by the machine learning model.- Returns:
-
getYPredictedProbabilities
public AssociativeArray getYPredictedProbabilities()
If prediction probabilities are available for the particular algorithm, then this method will return these probabilities. This is supported by all the classification and some clustering algorithms.- Returns:
-
hashCode
public int hashCode()
The hash code of the record. Depends only on x and y.- Overrides:
hashCodein classjava.lang.Object- Returns:
-
equals
public boolean equals(java.lang.Object obj)
Checks if the provided object is equal to the current instance. It checks only x and y.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj-- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG