CategoricalVariable Class |
Namespace: Novacta.Analytics
The CategoricalVariable type exposes the following members.
Name | Description | |
---|---|---|
CategoricalVariable |
Initializes a new instance of the
CategoricalVariable class
having the specified name.
|
Name | Description | |
---|---|---|
Categories |
Exposes the list of categories
in the CategoricalVariable.
| |
CategoryCodes |
Exposes the enumerator which iterates over the collection
of category codes
in the CategoricalVariable.
| |
CategoryLabels |
Exposes the enumerator which iterates over the collection
of category labels
in the CategoricalVariable.
| |
IsReadOnly |
Gets a value indicating whether this instance is read only.
| |
Name |
Gets or sets the variable name.
| |
NumberOfCategories |
Gets the number of categories.
|
Name | Description | |
---|---|---|
Add(Double) |
Adds a category having the specified code and a default
label to
the CategoricalVariable.
| |
Add(Double, String) |
Adds a category having the specified code and label to
the CategoricalVariable.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FromDoubleMatrix |
Converts
from DoubleMatrix to
CategoricalVariable.
| |
GetEnumerator | Returns an enumerator that iterates through the collection. | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Remove(Double) |
Removes the category having the specified code from
the CategoricalVariable.
| |
Remove(String) |
Removes the category having the specified label from
the CategoricalVariable.
| |
SetAsReadOnly |
Sets the CategoricalVariable as read only.
| |
ToDoubleMatrix |
Converts from CategoricalVariable to DoubleMatrix.
| |
ToString |
Returns a String that
represents this instance.
(Overrides ObjectToString.) | |
TryGet(Double, Category) |
Tries to get the category corresponding to a given code.
| |
TryGet(String, Category) |
Tries to get the category corresponding to a given label.
|
Name | Description | |
---|---|---|
(CategoricalVariable to DoubleMatrix) |
Performs an explicit conversion
from CategoricalVariable to DoubleMatrix.
| |
(DoubleMatrix to CategoricalVariable) |
Performs an explicit conversion from DoubleMatrix to
CategoricalVariable.
|
Name | Description | |
---|---|---|
IEnumerableGetEnumerator | Returns an enumerator that iterates through a collection. |
Instantiation
You can instantiate a CategoricalVariable object by calling its constructor. See the CategoricalVariable constructor summary.
Categories
Each of the possible values of a categorical variable is represented by an instance of type Category. Categories can be added to or removed from a given categorical variable, provided that it wasn't set as read-only by calling SetAsReadOnly. This condition can be verified by inspecting property IsReadOnly. Categories must be identifiable, both by their Code and by their Label. As a consequence, a category can be added only if, in the given categorical variable, no other category already exists having the same code or the same label. Furthermore, a category can be removed by passing its code to method Remove(Double), or its label to method Remove(String).
Use property NumberOfCategories to know how many categories are currently associated to a given variable. Property Categories lists category instances. Category codes, or labels, can be enumerated by inspecting, respectively, properties CategoryCodes and CategoryLabels.
You can verify if a category is in the variable by passing its code to method TryGet(Double, Category), or its label to method TryGet(String, Category).