Welcome to py-irt’s documentation!

OneParameterLogistic

class py_irt.models.one_param_logistic.OneParamLog(*, priors: str, num_items: int, num_subjects: int, verbose: bool = False, device: str = 'cpu', vocab_size: Optional[int] = None, dropout: Optional[float] = None, hidden: Optional[int] = None, **kwargs)

1PL IRT model

fit(models, items, responses, num_epochs)

Fit the IRT model with variational inference

fit_MCMC(models, items, responses, num_epochs)

Fit the IRT model with MCMC

guide_hierarchical(models, items, obs)

Initialize a 1PL guide with hierarchical priors

guide_vague(models, items, obs)

Initialize a 1PL guide with vague priors

model_hierarchical(models, items, obs)

Initialize a 1PL model with hierarchical priors

model_vague(models, items, obs)

Initialize a 1PL model with vague priors

predict(subjects, items, params_from_file=None)

predict p(correct | params) for a specified list of model, item pairs

summary(traces, sites)

Aggregate marginals for MCM

TwoParameterLogistic

class py_irt.models.two_param_logistic.TwoParamLog(*, priors: str, num_items: int, num_subjects: int, verbose=False, device: str = 'cpu', **kwargs)

2PL IRT model

fit_MCMC(models, items, responses, num_epochs)

Fit the IRT model with MCMC

guide_hierarchical(subjects, items, obs)

Initialize a 2PL guide with hierarchical priors

guide_vague(subjects, items, obs)

Initialize a 2PL guide with vague priors

model_hierarchical(subjects, items, obs)

Initialize a 2PL model with hierarchical priors

model_vague(subjects, items, obs)

Initialize a 2PL model with vague priors

predict(subjects, items, params_from_file=None)

predict p(correct | params) for a specified list of model, item pairs

summary(traces, sites)

Aggregate marginals for MCM

Theta Estimation

Functions to facilitate theta estimation

py_irt.scoring.calculate_diff_threshold(p_correct, theta)

Calculate the difficulty threshold where the probability correct given theta is equal to p_correct p_correct: the desired probability threshold theta: estimated model ability at current timestep

py_irt.scoring.calculate_theta(difficulties, response_pattern, num_obs=-1)

Given learned item difficulties and a model response pattern, estimate theta if num_obs > 0, then sample from the observed values for a computational speedup

py_irt.scoring.theta_fn(difficulties, response_pattern)

Estimate theta for a given response pattern

Indices and tables