Class QueryDistribution
Defines a distribution to be queried in a call to BayesServer.Inference.IInference.Query.
Inheritance
Implements
Inherited Members
Namespace: BayesServer.Inference
Assembly: BayesServer.Inference.dll
Syntax
public sealed class QueryDistribution : INotifyPropertyChanged
Constructors
QueryDistribution(IDistribution)
Initializes a new instance of the QueryDistribution class. The enabled property defaults to true.
Declaration
public QueryDistribution(IDistribution distribution)
Parameters
Type | Name | Description |
---|---|---|
IDistribution | distribution | The distribution to query. |
QueryDistribution(IDistribution, Boolean)
Initializes a new instance of the QueryDistribution class.
Declaration
public QueryDistribution(IDistribution distribution, bool isEnabled)
Parameters
Type | Name | Description |
---|---|---|
IDistribution | distribution | The distribution to query. |
System.Boolean | isEnabled | Sets the IsEnabled property. |
Properties
Comparison
Gets or sets a value indicating whether queried values should be adjusted to show how they compare to the same query with no evidence, or base evidence.
Declaration
public QueryComparison Comparison { get; set; }
Property Value
Type | Description |
---|---|
QueryComparison |
Remarks
Using comparisons is useful when you want to measure the difference or lift of a prediction value, for example when spotting unusual patterns during data exploration, or making recommendations.
The comparison can be calculated based on no evidence, or against base evidence which can be set on BaseEvidence.
Distance
The distance between this query calculated with base evidence or no evidence, and when calculated with evidence. Only calculated when QueryDistance is not None.
Declaration
public double? Distance { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
Remarks
This value can be null when the QueryDistance is set to None or the distance is undefined for the given queries.
Distribution
Gets the distribution to query.
Declaration
public IDistribution Distribution { get; }
Property Value
Type | Description |
---|---|
IDistribution | The distribution. |
IsEnabled
Gets or sets a value indicating whether the distribution should be queried.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
LogLikelihood
The log-likelihood specific to the evidence used to calculate this query. Only calculated when QueryLogLikelihood is true
.
Declaration
public double? LogLikelihood { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
Remarks
The log-likelihood value will equal the overall LogLikelihood unless QueryEvidenceMode is set to RetractQueryEvidence, and there is evidence on at least one variable in the IDistribution.
When evidence is retracted for a particular query, this value contains the log likelihood of the remaining evidence.
QueryDistance
Gets or sets a value indicating whether the distance should be calculated between the query calculated with base evidence (or no evidence), and the same query calculated with evidence.
Declaration
public QueryDistance QueryDistance { get; set; }
Property Value
Type | Description |
---|---|
QueryDistance |
Remarks
The distance can be calculated against no evidence, or against base evidence which can be set on BaseEvidence.
QueryLogLikelihood
Determines whether or not to calculate the LogLikelihood specific to the evidence used to calculate this query. For more information see LogLikelihood.
Declaration
public bool QueryLogLikelihood { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Copy()
Copies this instance, creating a copy of the distribution as well.
Declaration
public QueryDistribution Copy()
Returns
Type | Description |
---|---|
QueryDistribution | A copy of this instance. |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
Overrides
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |