randomized.cv_view¶
Module: randomized.cv_view
¶
Inheritance diagram for selectinf.randomized.cv_view
:
CV_view
¶
-
class
selectinf.randomized.cv_view.
CV_view
(glm_loss, loss_label, lasso_randomization=None, epsilon=None, scale1=None, scale2=None)[source]¶ Bases:
selectinf.randomized.query.query
-
__init__
(glm_loss, loss_label, lasso_randomization=None, epsilon=None, scale1=None, scale2=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\).
-
setup_sampler
()[source]¶ Setup query to prepare for sampling. Should set a few key attributes:
observed_score_state
observed_opt_state
opt_transform
-
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)¶
-
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?
-