learning.samplers

Module: learning.samplers

Inheritance diagram for selectinf.learning.samplers:

digraph inheritancee06632721c { rankdir=LR; size="8.0, 12.0"; "learning.samplers.normal_sampler" [URL="#selectinf.learning.samplers.normal_sampler",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="Our basic model for noise, and input to "]; "learning.samplers.split_sampler" [URL="#selectinf.learning.samplers.split_sampler",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="Data splitting noise source."]; }

Classes

normal_sampler

class selectinf.learning.samplers.normal_sampler(center, covariance)[source]

Bases: object

Our basic model for noise, and input to selection algorithms. This represents Gaussian data with a center, e.g. X.T.dot(y) in linear regression and a covariance Sigma.

This object emits noisy versions of center as

center + scale * N(0, Sigma)

__init__(center, covariance)[source]
Parameters

center : np.float(p)

Center of Gaussian noise source.

covariance : np.float((p, p))

Covariance of noise added (up to scale factor).

split_sampler

class selectinf.learning.samplers.split_sampler(sample_stat, covariance)[source]

Bases: object

Data splitting noise source. This is approximately Gaussian with center np.sum(sample_stat, 0) and noise suitably scaled, depending on splitting fraction.

This object emits noisy versions of center as

center + scale * N(0, Sigma)

__init__(sample_stat, covariance)[source]
Parameters

sample_stat : np.float((n, p))

Data matrix. In linear regression this is X * y[:, None]

covariance : np.float((p, p))

Covariance of np.sum(sample_stat, 0). Could be computed e.g. by bootstrap or parametric method given a design X.