Exemple #1
0
 def __init__(self):
   dataset = data.synthetic_item_response_theory()
   del dataset['test_student_ids']
   del dataset['test_question_ids']
   del dataset['test_correct']
   super(SyntheticItemResponseTheory, self).__init__(
       name='synthetic_item_response_theory',
       pretty_name='Synthetic Item-Response Theory',
       **dataset)
Exemple #2
0
  def testSyntheticItemResponseTheory(self):
    num_train_points = int(0.75 * 30012)
    num_test_points = 30012 - num_train_points

    dataset = data.synthetic_item_response_theory(train_fraction=0.75)

    self.assertEqual((num_train_points,), dataset['train_student_ids'].shape)
    self.assertEqual((num_train_points,), dataset['train_question_ids'].shape)
    self.assertEqual((num_train_points,), dataset['train_correct'].shape)
    self.assertEqual((num_test_points,), dataset['test_student_ids'].shape)
    self.assertEqual((num_test_points,), dataset['test_question_ids'].shape)
    self.assertEqual((num_test_points,), dataset['test_correct'].shape)
Exemple #3
0
def synthetic_item_response_theory():
    """One-parameter logistic item-response theory (IRT) model.

  This uses a dataset sampled from the prior. This dataset is a simulation of
  400 students each answering a subset of 100 unique questions, with a total of
  30012 questions answered.

  Returns:
    target: StanModel.
  """
    dataset = data.synthetic_item_response_theory()
    del dataset['test_student_ids']
    del dataset['test_question_ids']
    del dataset['test_correct']
    return item_response_theory.item_response_theory(**dataset)