Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QueryDistribution

Defines a distribution to be queried in a call to {@link com.bayesserver.inference.IInference#query}.

Hierarchy

  • QueryDistribution

Index

Constructors

constructor

  • Initializes a new instance of the {@link com.bayesserver.inference.QueryDistribution} class. The enabled property defaults to true.

    Parameters

    Returns QueryDistribution

  • Initializes a new instance of the {@link com.bayesserver.inference.QueryDistribution} class.

    Parameters

    • distribution: IDistribution

      The distribution to query.

    • isEnabled: boolean

      Sets the {@link com.bayesserver.inference.QueryDistribution#getIsEnabled} property.

    Returns QueryDistribution

Accessors

comparison

  • 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.

    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 {@link com.bayesserver.inference.IInference#getBaseEvidence}.

    Returns QueryComparison

  • 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.

    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 {@link com.bayesserver.inference.IInference#getBaseEvidence}.

    Parameters

    Returns void

distance

  • get distance(): number | null
  • set distance(value: number | null): void
  • The distance between this query calculated with base evidence or no evidence, and when calculated with evidence. Only calculated when {@link com.bayesserver.inference.QueryDistribution#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.

    Returns number | null

  • The distance between this query calculated with base evidence or no evidence, and when calculated with evidence. Only calculated when {@link com.bayesserver.inference.QueryDistribution#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.

    Parameters

    • value: number | null

    Returns void

distribution

  • Gets the distribution to query.

    Returns IDistribution

    The distribution.

isEnabled

  • get isEnabled(): boolean
  • set isEnabled(value: boolean): void
  • Gets a value indicating whether the distribution should be queried.

    Returns boolean

    true if the distribution should be queried; otherwise, false.

  • Sets a value indicating whether the distribution should be queried.

    Parameters

    • value: boolean

      true if the distribution should be queried; otherwise, false.

    Returns void

    true if the distribution should be queried; otherwise, false.

logLikelihood

  • get logLikelihood(): number | null
  • set logLikelihood(value: number | null): void
  • The log-likelihood specific to the evidence used to calculate this query. Only calculated when {@link com.bayesserver.inference.QueryDistribution#getQueryLogLikelihood} is true.

    The log-likelihood value will equal the overall {@link com.bayesserver.inference.IQueryOutput#getLogLikelihood} unless{@link com.bayesserver.inference.IQueryOptions#getQueryEvidenceMode} is set to {@link com.bayesserver.inference.QueryEvidenceMode#RetractQueryEvidence}, and there is evidence on at least one variable in the {@link com.bayesserver.IDistribution}.

    When evidence is retracted for a particular query, this value contains the log likelihood of the remaining evidence.

    Returns number | null

  • The log-likelihood specific to the evidence used to calculate this query. Only calculated when {@link com.bayesserver.inference.QueryDistribution#getQueryLogLikelihood} is true.

    The log-likelihood value will equal the overall {@link com.bayesserver.inference.IQueryOutput#getLogLikelihood} unless{@link com.bayesserver.inference.IQueryOptions#getQueryEvidenceMode} is set to {@link com.bayesserver.inference.QueryEvidenceMode#RetractQueryEvidence}, and there is evidence on at least one variable in the {@link com.bayesserver.IDistribution}.

    When evidence is retracted for a particular query, this value contains the log likelihood of the remaining evidence.

    Parameters

    • value: number | null

    Returns void

queryDistance

  • 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.

    The distance can be calculated against no evidence, or against base evidence which can be set on {@link com.bayesserver.inference.IInference#getBaseEvidence}.

    Returns QueryDistance

  • 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.

    The distance can be calculated against no evidence, or against base evidence which can be set on {@link com.bayesserver.inference.IInference#getBaseEvidence}.

    Parameters

    Returns void

queryLogLikelihood

  • get queryLogLikelihood(): boolean
  • set queryLogLikelihood(value: boolean): void
  • Determines whether or not to calculate the {@link com.bayesserver.inference.QueryDistribution#getLogLikelihood} specific to the evidence used to calculate this query. For more information see {@link com.bayesserver.inference.QueryDistribution#getLogLikelihood}.

    Returns boolean

  • Determines whether or not to calculate the {@link com.bayesserver.inference.QueryDistribution#getLogLikelihood} specific to the evidence used to calculate this query. For more information see {@link com.bayesserver.inference.QueryDistribution#getLogLikelihood}.

    Parameters

    • value: boolean

    Returns void

Methods

toString

  • toString(): string
  • Returns a {@link String} that represents this instance.

    Returns string

    A {@link String} that represents this instance.