Interface PythonCiService
- All Superinterfaces:
AutoCloseable, Closeable
- All Known Implementing Classes:
ProcessPythonCiService
An interface for performing conditional independence tests using Python.
This service is designed to interact with a Python backend for statistical
operations, enabling users to calculate p-values for conditional independence
relationships in a dataset.
-
Method Summary
Modifier and TypeMethodDescriptionvoidPrepares the service for operation if it has not been initialized yet.doublepValue(int xIndex, int yIndex, int[] zIndices, double alpha) Computes the p-value for a conditional independence test based on the specified variables and parameters.default voidsetVerbose(boolean verbose) Sets the verbosity mode for the service.default voidupdateParams(Map<String, Object> params) Updates the parameters for the service with the provided map of key-value pairs.
-
Method Details
-
initializeIfNeeded
Prepares the service for operation if it has not been initialized yet. This method ensures that the necessary state, resources, or configurations are set up based on the provided dataset, variable list, and parameters.- Parameters:
data- the dataset on which the service operates, containing the data required for conditional independence tests.vars- the list of variables (nodes) relevant to the operations, representing the context in which tests or analyses are conducted.params- a map of configuration parameters used to customize the initialization, such as specific settings for the Python backend or statistical operations.
-
pValue
Computes the p-value for a conditional independence test based on the specified variables and parameters. The method evaluates whether the variables indexed by xIndex and yIndex are conditionally independent given the variables indexed by zIndices.- Parameters:
xIndex- the index of the first variable in the conditional independence test.yIndex- the index of the second variable in the conditional independence test.zIndices- an array of indices representing the conditioning set of variables.alpha- the significance level used for the test, helping to determine the threshold for rejecting the null hypothesis of independence.- Returns:
- a double representing the p-value of the conditional independence test. A smaller p-value indicates stronger evidence against the null hypothesis of independence.
- Throws:
InterruptedException- if the thread executing the method is interrupted during execution.
-
setVerbose
default void setVerbose(boolean verbose) Sets the verbosity mode for the service. When verbosity is enabled, additional logs or debug information may be emitted to assist in tracking the execution flow or diagnosing issues.- Parameters:
verbose- a boolean flag indicating whether to enable or disable verbosity. If true, verbose output is enabled; if false, it is disabled.
-
updateParams
Updates the parameters for the service with the provided map of key-value pairs. This method allows customization or reconfiguration of the service at runtime by changing its operational parameters.- Parameters:
params- a map containing key-value pairs representing the parameters to be updated. Each key is a string identifying the parameter, and the associated value determines the new configuration or setting to be applied.
-