C# Class BigML.Utils

Show file Open project: bigmlcom/bigml-csharp

Public Methods

Method Description
convertDistributionArrayToMap ( JsonArray distribution ) : double>.Dictionary

We switch the Array to a Map structure in order to be more easily manipulated

convertDistributionMapToSortedArray ( double>.IDictionary distribution ) : JsonArray

We switch the Array to a Map structure in order to be more easily manipulated

isNumericType ( this o ) : bool
meanOfDistribution ( IList distribution ) : double

Computes the mean of a distribution in the [[point, instances]] syntax

meanOfValues ( IList values ) : double

Computes the mean of a list of double values

mergeBins ( double>.IDictionary distribution, int limit ) : double>.Dictionary

Merges the bins of a regression distribution to the given limit number

mergeBins ( JsonArray distribution, int limit ) : JsonArray

Merges the bins of a regression distribution to the given limit number

mergeDistributions ( double>.Dictionary distribution, double>.Dictionary newDistribution ) : double>.Dictionary

Adds up a new distribution structure to a map formatted distribution

printDistribution ( JsonArray distribution ) : StringBuilder

Prints distribution data

roundOff ( double x, int n ) : double

Round a double number x to n decimal places

sameElement ( IList collection, object value ) : bool

Determines if the given collection contain the same value. We will use the contains method of the list to check if the value is inside

Method Details

convertDistributionArrayToMap() public static method

We switch the Array to a Map structure in order to be more easily manipulated
public static convertDistributionArrayToMap ( JsonArray distribution ) : double>.Dictionary
distribution JsonArray current distribution as an JsonArray instance
return double>.Dictionary

convertDistributionMapToSortedArray() public static method

We switch the Array to a Map structure in order to be more easily manipulated
public static convertDistributionMapToSortedArray ( double>.IDictionary distribution ) : JsonArray
distribution double>.IDictionary current distribution as an JsonArray instance
return JsonArray

isNumericType() public static method

public static isNumericType ( this o ) : bool
o this
return bool

meanOfDistribution() public static method

Computes the mean of a distribution in the [[point, instances]] syntax
public static meanOfDistribution ( IList distribution ) : double
distribution IList /// @return
return double

meanOfValues() public static method

Computes the mean of a list of double values
public static meanOfValues ( IList values ) : double
values IList
return double

mergeBins() public static method

Merges the bins of a regression distribution to the given limit number
public static mergeBins ( double>.IDictionary distribution, int limit ) : double>.Dictionary
distribution double>.IDictionary
limit int
return double>.Dictionary

mergeBins() public static method

Merges the bins of a regression distribution to the given limit number
public static mergeBins ( JsonArray distribution, int limit ) : JsonArray
distribution JsonArray
limit int
return JsonArray

mergeDistributions() public static method

Adds up a new distribution structure to a map formatted distribution
public static mergeDistributions ( double>.Dictionary distribution, double>.Dictionary newDistribution ) : double>.Dictionary
distribution double>.Dictionary
newDistribution double>.Dictionary /// @return
return double>.Dictionary

printDistribution() public static method

Prints distribution data
public static printDistribution ( JsonArray distribution ) : StringBuilder
distribution JsonArray
return StringBuilder

roundOff() public static method

Round a double number x to n decimal places
public static roundOff ( double x, int n ) : double
x double
n int
return double

sameElement() public static method

Determines if the given collection contain the same value. We will use the contains method of the list to check if the value is inside
public static sameElement ( IList collection, object value ) : bool
collection IList the list of elements
value object the value to check.
return bool