public final class QueryDistribution extends Object implements Cloneable
Inference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.Constructor and Description |
---|
QueryDistribution(Distribution distribution)
Initializes a new instance of the
QueryDistribution class. |
QueryDistribution(Distribution distribution,
boolean isEnabled)
Initializes a new instance of the
QueryDistribution class. |
Modifier and Type | Method and Description |
---|---|
QueryDistribution |
copy()
Copies this instance, creating a copy of the distribution as well.
|
QueryComparison |
getComparison()
Gets a value indicating whether queried values should be adjusted to show how they compare to the same query with no evidence, or base evidence.
|
Double |
getDistance()
The distance between this query calculated with base evidence or no evidence, and when calculated with evidence.
|
Distribution |
getDistribution()
Gets the distribution to query.
|
boolean |
getIsEnabled()
Gets a value indicating whether the distribution should be queried.
|
Double |
getLogLikelihood()
The log-likelihood specific to the evidence used to calculate this query.
|
QueryDistance |
getQueryDistance()
Gets 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.
|
boolean |
getQueryLogLikelihood()
Determines whether or not to calculate the
getLogLikelihood() specific to the evidence used to calculate this query. |
void |
setComparison(QueryComparison value)
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.
|
void |
setDistance(Double value)
The distance between this query calculated with base evidence or no evidence, and when calculated with evidence.
|
void |
setIsEnabled(boolean value)
Sets a value indicating whether the distribution should be queried.
|
void |
setLogLikelihood(Double value)
The log-likelihood specific to the evidence used to calculate this query.
|
void |
setQueryDistance(QueryDistance value)
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.
|
void |
setQueryLogLikelihood(boolean value)
Determines whether or not to calculate the
getLogLikelihood() specific to the evidence used to calculate this query. |
String |
toString()
Returns a
String that represents this instance. |
public QueryDistribution(Distribution distribution)
QueryDistribution
class. The enabled property defaults to true.distribution
- The distribution to query.public QueryDistribution(Distribution distribution, boolean isEnabled)
QueryDistribution
class.distribution
- The distribution to query.isEnabled
- Sets the getIsEnabled()
property.public QueryDistribution copy()
public QueryDistance getQueryDistance()
The distance can be calculated against no evidence, or against base evidence which can be set on Inference.getBaseEvidence()
.
public void setQueryDistance(QueryDistance value)
The distance can be calculated against no evidence, or against base evidence which can be set on Inference.getBaseEvidence()
.
public QueryComparison getComparison()
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 Inference.getBaseEvidence()
.
public void setComparison(QueryComparison value)
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 Inference.getBaseEvidence()
.
public boolean getQueryLogLikelihood()
getLogLikelihood()
specific to the evidence used to calculate this query. For more information see getLogLikelihood()
.public void setQueryLogLikelihood(boolean value)
getLogLikelihood()
specific to the evidence used to calculate this query. For more information see getLogLikelihood()
.public Double getLogLikelihood()
getQueryLogLikelihood()
is true
.
The log-likelihood value will equal the overall QueryOutput.getLogLikelihood()
unlessQueryOptions.getQueryEvidenceMode()
is set to QueryEvidenceMode.RETRACT_QUERY_EVIDENCE
, and there is evidence on at least one variable in the Distribution
.
When evidence is retracted for a particular query, this value contains the log likelihood of the remaining evidence.
public void setLogLikelihood(Double value)
getQueryLogLikelihood()
is true
.
The log-likelihood value will equal the overall QueryOutput.getLogLikelihood()
unlessQueryOptions.getQueryEvidenceMode()
is set to QueryEvidenceMode.RETRACT_QUERY_EVIDENCE
, and there is evidence on at least one variable in the Distribution
.
When evidence is retracted for a particular query, this value contains the log likelihood of the remaining evidence.
public Double getDistance()
getQueryDistance()
is not None.
This value can be null when the QueryDistance is set to None or the distance is undefined for the given queries.public void setDistance(Double value)
getQueryDistance()
is not None.
This value can be null when the QueryDistance is set to None or the distance is undefined for the given queries.public boolean getIsEnabled()
true
if the distribution should be queried; otherwise, false
.public void setIsEnabled(boolean value)
value
- true
if the distribution should be queried; otherwise, false
.public Distribution getDistribution()
Copyright © 2023. All rights reserved.