Package edu.cmu.tetrad.data
Class MixedDataBox
java.lang.Object
edu.cmu.tetrad.data.MixedDataBox
- All Implemented Interfaces:
DataBox
,TetradSerializable
,Serializable
Stores a 2D array of double continuousData. Note that the missing value marker for this box is -99.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMixedDataBox
(List<Node> variables, int numRows) The variables here are used only to determine which columns are discrete and which are continuous; bounds checking is not done.MixedDataBox
(List<Node> variables, int numRows, double[][] continuousData, int[][] discreteData) This constructor allows other data readers to populate the fields directly. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addVariable
(Node variable) copy()
get
(int row, int col) double[][]
int[][]
like()
int
numCols()
int
numRows()
static BoxDataSet
Generates a simple exemplar of this class to test serialization.void
Sets the value at the given row/column to the given Number value.viewSelection
(int[] rows, int[] cols)
-
Constructor Details
-
MixedDataBox
The variables here are used only to determine which columns are discrete and which are continuous; bounds checking is not done. -
MixedDataBox
public MixedDataBox(List<Node> variables, int numRows, double[][] continuousData, int[][] discreteData) This constructor allows other data readers to populate the fields directly.- Parameters:
variables
- list of discrete and continuous variablesnumRows
- number of cases in the datasetcontinuousData
- continuous datadiscreteData
- discrete data
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization. -
numRows
public int numRows() -
numCols
public int numCols() -
set
Sets the value at the given row/column to the given Number value. The value used is number.doubleValue(). -
get
-
copy
-
like
-
addVariable
-
viewSelection
- Specified by:
viewSelection
in interfaceDataBox
- Returns:
- this data box, restricted to the given rows and columns.
-
getContinuousData
public double[][] getContinuousData() -
getDiscreteData
public int[][] getDiscreteData()
-