diff --git a/src/Microsoft.ML.Core/Data/KeyType.cs b/src/Microsoft.ML.Core/Data/KeyType.cs index 877d2900fc..627f50c323 100644 --- a/src/Microsoft.ML.Core/Data/KeyType.cs +++ b/src/Microsoft.ML.Core/Data/KeyType.cs @@ -15,10 +15,10 @@ namespace Microsoft.ML.Data /// class numbers, etc. For example, in multi-class classification, the label is typically /// a class number which is naturally a KeyType. /// - /// KeyTypes have a cardinality (i.e., Count) that is strictly positive. + /// KeyTypes have a cardinality (i.e., ) that is strictly positive. /// /// Note that the underlying representation value does not necessarily match the logical value. - /// For example, if a KeyType has range 0-5000, then it has a Count of 5001, but + /// For example, if a KeyType has range 0-5000, then it has a of 5001, but /// the representational values are 1-5001. The representation value zero is reserved /// to mean a missing value (similar to NaN). /// @@ -52,13 +52,20 @@ public static bool IsValidDataType(Type type) /// /// is the cardinality of the . Note that such a key type can be converted to a - /// bit vector representation by mapping to a vector of length Count, with "id" mapped to a + /// bit vector representation by mapping to a vector of length , with "id" mapped to a /// vector with 1 in slot (id - 1) and 0 in all other slots. This is the standard "indicator" /// representation. Note that an id of 0 is used to represent the notion "none", which is - /// typically mapped, by for example, one-hot encoding, to a vector of all zeros (of length Count). + /// typically mapped, by for example, one-hot encoding, to a vector of all zeros (of length ). /// public ulong Count { get; } + /// + /// Determine if this object is equal to another instance. + /// Checks if the other item is the type of , if the + /// is the same, and if the is the same. + /// + /// The other object to compare against. + /// if both objects are equal, otherwise . public override bool Equals(DataViewType other) { if (other == this) @@ -73,16 +80,31 @@ public override bool Equals(DataViewType other) return true; } + /// + /// Determine if a instance is equal to another instance. + /// Checks if any object is the type of , if the + /// is the same, and if the is the same. + /// + /// The other object to compare against. + /// if both objects are equal, otherwise . public override bool Equals(object other) { return other is DataViewType tmp && Equals(tmp); } + /// + /// Retrieves the hash code. + /// + /// An integer representing the hash code. public override int GetHashCode() { return Hashing.CombinedHash(RawType.GetHashCode(), Count); } + /// + /// The string representation of the . + /// + /// A formatted string. public override string ToString() { InternalDataKind rawKind = this.GetRawKind();