Vector.Create Categorical Method
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Create | Constructs a categorical vector from a list of values. |
Create | Constructs a new categorical vector of the specified length. |
Create | Constructs a categorical vector from a list of values. |
Create | Constructs a categorical vector from a list of values. |
Create | Constructs a categorical vector from a list of values. |
Create | Constructs a categorical vector from an index and level indexes. |
CreateCategorical<T>(IList<T>)
Constructs a categorical vector from a list of values.
public static CategoricalVector<T> CreateCategorical<T>(
IList<T> values
)
Parameters
- values IList<T>
- A list of values.
Type Parameters
- T
- The element type of the vector.
Return Value
CategoricalVector<T>A categorical vector with the specified values.
CreateCategorical<T>(Int32)
Constructs a new categorical vector of the specified length.
public static CategoricalVector<T> CreateCategorical<T>(
int length
)
Parameters
- length Int32
- The length of the new vector.
Type Parameters
- T
Return Value
CategoricalVector<T>CreateCategorical<T>(IList<T>, ArrayMutability)
Constructs a categorical vector from a list of values.
public static CategoricalVector<T> CreateCategorical<T>(
IList<T> values,
ArrayMutability mutability = ArrayMutability.Immutable
)
Parameters
- values IList<T>
- A list of values.
- mutability ArrayMutability (Optional)
- Specifies how the vector's values may be changed. The default is immutable.
Type Parameters
- T
- The element type of the vector.
Return Value
CategoricalVector<T>A categorical vector with the specified values.
CreateCategorical<T>(IList<T>, Index<T>, ArrayMutability)
Constructs a categorical vector from a list of values.
public static CategoricalVector<T> CreateCategorical<T>(
IList<T> values,
Index<T> categoryIndex,
ArrayMutability mutability = ArrayMutability.Immutable
)
Parameters
- values IList<T>
- A list of values.
- categoryIndex Index<T>
- The index used to encode the categories.
- mutability ArrayMutability (Optional)
- Specifies how the vector's values may be changed. The default is immutable.
Type Parameters
- T
- The element type of the vector.
Return Value
CategoricalVector<T>A categorical vector with the specified values.
CreateCategorical<T>(IList<T>, SortOrder, ArrayMutability)
Constructs a categorical vector from a list of values.
public static CategoricalVector<T> CreateCategorical<T>(
IList<T> values,
SortOrder sortOrder = SortOrder.Ascending,
ArrayMutability mutability = ArrayMutability.Immutable
)
Parameters
- values IList<T>
- A list of values.
- sortOrder SortOrder (Optional)
- Optional. Specifies the sort order of the category index. The default is ascending. If None, categories appear in the order they first appear in values.
- mutability ArrayMutability (Optional)
- Optional. Specifies how the vector's values may be changed. The default is immutable.
Type Parameters
- T
- The element type of the vector.
Return Value
CategoricalVector<T>A categorical vector with the specified values.
CreateCategorical<T>(Index<T>, IList<Int32>, ArrayMutability)
Constructs a categorical vector from an index and level indexes.
public static CategoricalVector<T> CreateCategorical<T>(
Index<T> index,
IList<int> levels,
ArrayMutability mutability = ArrayMutability.Immutable
)
Parameters
- index Index<T>
- An index.
- levels IList<Int32>
- A list of integer level indexes.
- mutability ArrayMutability (Optional)
- Specifies how the vector's values may be changed. The default is immutable.
Type Parameters
- T
- The element type of the vector.
Return Value
CategoricalVector<T>A categorical vector with category index index and level indexes levels.
Remarks
To specify a missing value, set its level index to -1.