Package edu.cmu.tetrad.data
Class ContinuousDiscretizationSpec
java.lang.Object
edu.cmu.tetrad.data.ContinuousDiscretizationSpec
- All Implemented Interfaces:
DiscretizationSpec
,TetradSerializable
,Serializable
public final class ContinuousDiscretizationSpec
extends Object
implements TetradSerializable, DiscretizationSpec
Specifies how a column (continuous or discrete) should be discretized. For a discrete column the mapping is int[]
remap; for a continuous column the mapping is double[] cutoffs. The categories are the string labels for the
categories. This is just a small immutable class that columns can map to in order to remember how discretizations
were done so that the user doesn't have to keep typing in information over and over again.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
ConstantEVENLY_DISTRIBUTED_INTERVALS=2
static final int
The types of discretizationstatic final int
ConstantNONE=3
-
Constructor Summary
ConstructorsConstructorDescriptionContinuousDiscretizationSpec
(double[] breakpoints, List<String> categories) Constructor for ContinuousDiscretizationSpec.ContinuousDiscretizationSpec
(double[] breakpoints, List<String> categories, int method) Constructor for ContinuousDiscretizationSpec. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Getter for the fieldbreakpoints
.Getter for the fieldcategories
.int
Getter for the fieldmethod
.static DiscretizationSpec
Generates a simple exemplar of this class to test serialization.void
setMethod
(int method) Setter for the fieldmethod
.
-
Field Details
-
EVENLY_DISTRIBUTED_VALUES
public static final int EVENLY_DISTRIBUTED_VALUESThe types of discretization- See Also:
-
EVENLY_DISTRIBUTED_INTERVALS
public static final int EVENLY_DISTRIBUTED_INTERVALSConstantEVENLY_DISTRIBUTED_INTERVALS=2
- See Also:
-
NONE
public static final int NONEConstantNONE=3
- See Also:
-
-
Constructor Details
-
ContinuousDiscretizationSpec
Constructor for ContinuousDiscretizationSpec.
- Parameters:
breakpoints
- an array ofinvalid reference
double
categories
- aList
object
-
ContinuousDiscretizationSpec
Constructor for ContinuousDiscretizationSpec.
- Parameters:
breakpoints
- an array ofinvalid reference
double
categories
- aList
objectmethod
- a int
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
DiscretizationSpec
object
-
getMethod
public int getMethod()Getter for the field
method
.- Returns:
- a int
-
setMethod
public void setMethod(int method) Setter for the field
method
.- Parameters:
method
- a int
-
getCategories
Getter for the field
categories
.- Returns:
- a
List
object
-
getBreakpoints
public double[] getBreakpoints()Getter for the field
breakpoints
.- Returns:
- an array of
invalid reference
double
-