Class Classes
Methods for operating with categorical data.
Inheritance
System.Object
Classes
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Numerics
Assembly: Mars.Numerics.dll
Syntax
public static class Classes
Methods
| Improve this Doc View SourceGetRatio(Int32[], Int32[])
Calculates the prevalence of a class for each variable.
Declaration
public static double[] GetRatio(int[] positives, int[] negatives)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | positives | An array of counts detailing the occurrence of the first class. |
System.Int32[] | negatives | An array of counts detailing the occurrence of the second class. |
Returns
Type | Description |
---|---|
System.Double[] | An array containing the proportion of the first class over the total of occurrences. |
Separate<T>(T[], Int32[], Int32)
Divides values into groups given a vector
containing the group labels for every value.
Declaration
public static T[][] Separate<T>(this T[] values, int[] labels, int groups)
Parameters
Type | Name | Description |
---|---|---|
T[] | values | The values to be separated into groups. |
System.Int32[] | labels | A vector containing the class label associated with each of the values. The labels must begin on 0 and its maximum value should be the number of groups - 1. |
System.Int32 | groups | The number of groups. |
Returns
Type | Description |
---|---|
T[][] | The original values divided into groups. |
Type Parameters
Name | Description |
---|---|
T | The type of the values. |
Separate<T>(T[], Int32[])
Divides values into groups given a vector
containing the group labels for every value.
Declaration
public static T[][] Separate<T>(this T[] values, int[] labels)
Parameters
Type | Name | Description |
---|---|---|
T[] | values | The values to be separated into groups. |
System.Int32[] | labels | A vector containing the class label associated with each of the values. The labels must begin on 0 and its maximum value should be the number of groups - 1. |
Returns
Type | Description |
---|---|
T[][] | The original values divided into groups. |
Type Parameters
Name | Description |
---|---|
T | The type of the values. |