Class QuantileEstimator
Subsamples data to provide accurate estimation of quantiles.
Inheritance
QuantileEstimator
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
[DataContract]
public class QuantileEstimator : CanGetProbLessThan<double>, CanGetQuantile<double>
Constructors
QuantileEstimator(Double)
Creates a new QuantileEstimator.
Declaration
public QuantileEstimator(double maximumError)
Parameters
Type |
Name |
Description |
Double |
maximumError |
The allowed error in the return value of GetProbLessThan. Must be greater than 0 and less than 1. As a rule of thumb, set this to the reciprocal of the number of desired quantiles.
|
Fields
MaximumError
Declaration
[DataMember]
public readonly double MaximumError
Field Value
Methods
Add(QuantileEstimator)
Add all samples stored in another QuantileEstimator, compacting them as necessary.
Declaration
public void Add(QuantileEstimator that)
Parameters
Add(Double)
Declaration
public void Add(double item)
Parameters
Type |
Name |
Description |
Double |
item |
|
Add(Double, Int32)
Declaration
public void Add(double item, int weight)
Parameters
AddRange(IEnumerable<Double>)
Declaration
public void AddRange(IEnumerable<double> items)
Parameters
Deflate()
Divide all sample weights by 2.
Declaration
GetCount()
Gets the total weight of retained items, which is an approximate count of the number of items added.
Declaration
Returns
GetProbBetween(Double, Double)
Returns the probability mass in an interval.
Declaration
public double GetProbBetween(double lowerBound, double upperBound)
Parameters
Returns
Type |
Description |
Double |
A number between 0 and 1, inclusive.
|
GetProbLessThan(Double)
Returns the quantile rank of x. This is a probability such that GetQuantile(probability) == x, whenever x is inside the support of the distribution. May be discontinuous due to duplicates.
Declaration
public double GetProbLessThan(double x)
Parameters
Type |
Name |
Description |
Double |
x |
|
Returns
GetQuantile(Double)
Returns the largest value x such that GetProbLessThan(x) <= probability.
Declaration
public double GetQuantile(double probability)
Parameters
Type |
Name |
Description |
Double |
probability |
A real number in [0,1].
|
Returns
Inflate()
Multiply all sample weights by 2.
Declaration
SetRandomSeed(Int32)
Sets the seed used for random number generation.
Declaration
public void SetRandomSeed(int seed)
Parameters
Type |
Name |
Description |
Int32 |
seed |
Specify the seed to use for random number generation.
|
ToString()
Declaration
public override string ToString()
Returns
Overrides
ValueEquals(QuantileEstimator)
Returns true if that contains the same information as this.
Declaration
public bool ValueEquals(QuantileEstimator that)
Parameters
Returns
Implements