Represents a discrete classification of a Variable.

Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (Extreme.Numerics)

Syntax

Visual Basic (Declaration)
Public Class CategoricalScale _
	Implements IEnumerable
C#
public class CategoricalScale : IEnumerable
C++
public ref class CategoricalScale : IEnumerable

Methods

IconTypeDescription
Equals(Object)
Determines whether the specified Object is equal to the current Object.
Finalize()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetCaption(Int32)
Gets a textual representation of the level at the specified index.
GetCaptions()
Gets an array containing the captions of the levels in this CategoricalScale.
GetComparer()
Gets an IComparer object that can be used to compare the levels of this CategoricalScale.
GetEnumerator()
Returns an IEnumerator object that can be used to iterate through the levels of the CategoricalScale.
GetHashCode()
Serves as a hash function for a particular type.
GetLevelIndex(Object)
Gets the index of the specified level in this CategoricalScale.
GetLevels()
Gets an array containing the levels of this CategoricalScale.
GetType()
Gets the Type of the current instance.
Map(Object[]())
Returns an array of indexes corresponding to the
Map(Object)
Gets the index of the specified level in this CategoricalScale.
MemberwiseClone()
Creates a shallow copy of the current Object.
ToString()
Returns a String that represents the current Object.

Constructors

IconTypeDescription
CategoricalScaleNew(SortOrder)
Constructs a new categorical scale.
CategoricalScaleNew(Type, SortOrder)
Constructs a factor from an enumeration type.
CategoricalScaleNew(Type)
Constructs a factor from an enumeration type.
CategoricalScaleNew(ICollection, String[](), SortOrder)
Constructs a categorical scale from an ICollection.
CategoricalScaleNew(ICollection)
Constructs a categorical scale from an ICollection.

Properties

IconTypeDescription
Count
Gets the number of levels in this CategoricalScale.
IsOrdered
Gets a value that indicates whether the categorical scale is ordered or unordered.
Item(Int32)
Gets the level corresponding to the specified level index.

In C#, this property is the indexer for the DateTimeScale class.

Remarks

Use the CategoricalScale class to represent the possible values for a categorical variable. The unique values are called levels. Every level is assigned an index, ranging from 0 to the number of distinct values minus 1.

The Map(Object[]()) method finds the level index corresponding to an object.

Using a CategoricalScale, a categorical variable can be transformed into a numerical variable by replacing the level value by its level index. However, care should be taken that no new meaning is assigned to the numerical value of the level index. A variable that represents color using the categories 'red', 'green' and 'blue' can be converted into a numerical variable with possible values 0, 1, and 2. However, it is completely meaningless to talk about the mean or variance of this variable.

Several derived classes provide functionality tailored to specific kinds of data. These classes extend the Map(Object[]()) methods:

ClassDescriptionDateTimeScaleRepresents a class whose levels are contiguous time intervals.NumericalScaleRepresents a class whose levels are contiguous numerical intervals.

CategoricalScale objects are used by CategoricalVariable objects to map levels to numerical values (level indexes).

Inheritance Hierarchy

System.Object
  Extreme.Statistics.CategoricalScale