Class DiscreteEstimator
Estimates a discrete distribution from samples.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class DiscreteEstimator : Estimator<Discrete>, Accumulator<Discrete>, Accumulator<int>, SettableTo<DiscreteEstimator>, ICloneable
Constructors
DiscreteEstimator(Int32)
Creates a new discrete distribution estimator
Declaration
public DiscreteEstimator(int dimension)
Parameters
Type | Name | Description |
---|---|---|
Int32 | dimension | Dimension |
Fields
N
Number of samples
Declaration
public double N
Field Value
Type | Description |
---|---|
Double |
NProb
Vector of counts for each domain value
Declaration
public Vector NProb
Field Value
Type | Description |
---|---|
Vector |
Properties
Dimension
Dimension of the discrete distribution
Declaration
public int Dimension { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Add(Discrete)
Adds a discrete distribution item to the estimator
Declaration
public void Add(Discrete distribution)
Parameters
Type | Name | Description |
---|---|---|
Discrete | distribution | A Discrete instance |
Add(Discrete, Double)
Adds a weighted discrete distribution item to the estimator
Declaration
public void Add(Discrete distribution, double weight)
Parameters
Type | Name | Description |
---|---|---|
Discrete | distribution | A Discrete instance |
Double | weight | Weight |
Add(Int32)
Adds an discrete sample to the estimator
Declaration
public void Add(int sample)
Parameters
Type | Name | Description |
---|---|---|
Int32 | sample | The sample value |
Clear()
Clears the estimator
Declaration
public void Clear()
Clone()
Returns a clone of this estimator.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object |
GetDistribution(Discrete)
Gets the estimated distribution
Declaration
public Discrete GetDistribution(Discrete result)
Parameters
Type | Name | Description |
---|---|---|
Discrete | result | Where to put the estimated distribution |
Returns
Type | Description |
---|---|
Discrete | The estimated distribution |
SetTo(DiscreteEstimator)
Sets the state of this estimator from the specified estimator.
Declaration
public void SetTo(DiscreteEstimator value)
Parameters
Type | Name | Description |
---|---|---|
DiscreteEstimator | value |