randomized.screening¶
Module: randomized.screening
¶
Inheritance diagram for selectinf.randomized.screening
:
Classes¶
marginal_screening
¶
-
class
selectinf.randomized.screening.
marginal_screening
(observed_data, covariance, randomizer, threshold, perturb=None)[source]¶ Bases:
selectinf.randomized.screening.screening
-
__init__
(observed_data, covariance, randomizer, threshold, perturb=None)[source]¶ - Parameters
randomization : selection.randomized.randomization.randomization
Instance of a randomization scheme. Describes the law of \(\omega\).
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
static
type1
(observed_data, covariance, marginal_level, randomizer_scale, perturb=None)[source]¶ Threshold
-
full_targets
(features, dispersion=1.0)¶ Entries of the mean of Sigma[E,E]^{-1}Z_E
-
get_sampler
()¶
-
marginal_targets
(features)¶ Entries of the mean of Z_E
-
multivariate_targets
(features, dispersion=1.0)¶ Entries of the mean of Sigma[E,E]^{-1}Z_E
-
randomize
(perturb=None)¶ The actual randomization step.
- Parameters
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
property
sampler
¶ Sampler of optimization (augmented) variables.
-
selective_MLE
(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})¶ - Parameters
observed_target : ndarray
Observed estimate of target.
target_cov : ndarray
Estimated covaraince of target.
target_score_cov : ndarray
Estimated covariance of target and score of randomized query.
level : float, optional
Confidence level.
solve_args : dict, optional
Arguments passed to solver.
-
set_sampler
(sampler)¶
-
setup_sampler
()¶ Setup query to prepare for sampling. Should set a few key attributes:
observed_score_state
observed_opt_state
opt_transform
-
solve
()¶
-
summary
(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)¶ Produce p-values and confidence intervals for targets of model including selected features
- Parameters
target : one of [‘selected’, ‘full’]
features : np.bool
Binary encoding of which features to use in final model and targets.
parameter : np.array
Hypothesized value for parameter – defaults to 0.
level : float
Confidence level.
ndraw : int (optional)
Defaults to 1000.
burnin : int (optional)
Defaults to 1000.
compute_intervals : bool
Compute confidence intervals?
dispersion : float (optional)
Use a known value for dispersion, or Pearson’s X^2?
-
useC
= True¶
-
screening
¶
-
class
selectinf.randomized.screening.
screening
(observed_data, covariance, randomizer, perturb=None)[source]¶ Bases:
selectinf.randomized.query.gaussian_query
-
__init__
(observed_data, covariance, randomizer, perturb=None)[source]¶ - Parameters
randomization : selection.randomized.randomization.randomization
Instance of a randomization scheme. Describes the law of \(\omega\).
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
get_sampler
()¶
-
randomize
(perturb=None)¶ The actual randomization step.
- Parameters
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
property
sampler
¶ Sampler of optimization (augmented) variables.
-
selective_MLE
(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})¶ - Parameters
observed_target : ndarray
Observed estimate of target.
target_cov : ndarray
Estimated covaraince of target.
target_score_cov : ndarray
Estimated covariance of target and score of randomized query.
level : float, optional
Confidence level.
solve_args : dict, optional
Arguments passed to solver.
-
set_sampler
(sampler)¶
-
setup_sampler
()¶ Setup query to prepare for sampling. Should set a few key attributes:
observed_score_state
observed_opt_state
opt_transform
-
solve
()¶
-
summary
(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)¶ Produce p-values and confidence intervals for targets of model including selected features
- Parameters
target : one of [‘selected’, ‘full’]
features : np.bool
Binary encoding of which features to use in final model and targets.
parameter : np.array
Hypothesized value for parameter – defaults to 0.
level : float
Confidence level.
ndraw : int (optional)
Defaults to 1000.
burnin : int (optional)
Defaults to 1000.
compute_intervals : bool
Compute confidence intervals?
dispersion : float (optional)
Use a known value for dispersion, or Pearson’s X^2?
-
useC
= True¶
-
stepup
¶
-
class
selectinf.randomized.screening.
stepup
(observed_data, covariance, randomizer, stepup_Z, perturb=None)[source]¶ Bases:
selectinf.randomized.screening.screening
-
__init__
(observed_data, covariance, randomizer, stepup_Z, perturb=None)[source]¶ - Parameters
randomization : selection.randomized.randomization.randomization
Instance of a randomization scheme. Describes the law of \(\omega\).
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
full_targets
(features, dispersion=1.0)¶ Entries of the mean of Sigma[E,E]^{-1}Z_E
-
get_sampler
()¶
-
marginal_targets
(features)¶ Entries of the mean of Z_E
-
multivariate_targets
(features, dispersion=1.0)¶ Entries of the mean of Sigma[E,E]^{-1}Z_E
-
randomize
(perturb=None)¶ The actual randomization step.
- Parameters
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
property
sampler
¶ Sampler of optimization (augmented) variables.
-
selective_MLE
(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})¶ - Parameters
observed_target : ndarray
Observed estimate of target.
target_cov : ndarray
Estimated covaraince of target.
target_score_cov : ndarray
Estimated covariance of target and score of randomized query.
level : float, optional
Confidence level.
solve_args : dict, optional
Arguments passed to solver.
-
set_sampler
(sampler)¶
-
setup_sampler
()¶ Setup query to prepare for sampling. Should set a few key attributes:
observed_score_state
observed_opt_state
opt_transform
-
solve
()¶
-
summary
(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)¶ Produce p-values and confidence intervals for targets of model including selected features
- Parameters
target : one of [‘selected’, ‘full’]
features : np.bool
Binary encoding of which features to use in final model and targets.
parameter : np.array
Hypothesized value for parameter – defaults to 0.
level : float
Confidence level.
ndraw : int (optional)
Defaults to 1000.
burnin : int (optional)
Defaults to 1000.
compute_intervals : bool
Compute confidence intervals?
dispersion : float (optional)
Use a known value for dispersion, or Pearson’s X^2?
-
useC
= True¶
-
topK
¶
-
class
selectinf.randomized.screening.
topK
(observed_data, covariance, randomizer, K, abs=False, perturb=None)[source]¶ Bases:
selectinf.randomized.screening.screening
-
__init__
(observed_data, covariance, randomizer, K, abs=False, perturb=None)[source]¶ - Parameters
randomization : selection.randomized.randomization.randomization
Instance of a randomization scheme. Describes the law of \(\omega\).
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
full_targets
(features, dispersion=1.0)¶ Entries of the mean of Sigma[E,E]^{-1}Z_E
-
get_sampler
()¶
-
marginal_targets
(features)¶ Entries of the mean of Z_E
-
multivariate_targets
(features, dispersion=1.0)¶ Entries of the mean of Sigma[E,E]^{-1}Z_E
-
randomize
(perturb=None)¶ The actual randomization step.
- Parameters
perturb : ndarray, optional
Value of randomization vector, an instance of \(\omega\).
-
property
sampler
¶ Sampler of optimization (augmented) variables.
-
selective_MLE
(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})¶ - Parameters
observed_target : ndarray
Observed estimate of target.
target_cov : ndarray
Estimated covaraince of target.
target_score_cov : ndarray
Estimated covariance of target and score of randomized query.
level : float, optional
Confidence level.
solve_args : dict, optional
Arguments passed to solver.
-
set_sampler
(sampler)¶
-
setup_sampler
()¶ Setup query to prepare for sampling. Should set a few key attributes:
observed_score_state
observed_opt_state
opt_transform
-
solve
()¶
-
summary
(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)¶ Produce p-values and confidence intervals for targets of model including selected features
- Parameters
target : one of [‘selected’, ‘full’]
features : np.bool
Binary encoding of which features to use in final model and targets.
parameter : np.array
Hypothesized value for parameter – defaults to 0.
level : float
Confidence level.
ndraw : int (optional)
Defaults to 1000.
burnin : int (optional)
Defaults to 1000.
compute_intervals : bool
Compute confidence intervals?
dispersion : float (optional)
Use a known value for dispersion, or Pearson’s X^2?
-
useC
= True¶
-