def test_variance_of_errors_all_single_scored(): # this test should raise a UserWarning sc1 = [1, 2, 3, None, None] sc2 = [None, None, None, 2, 3] df = pd.DataFrame({'sc1': sc1, 'sc2': sc2}) with warnings.catch_warnings(record=True) as warning_list: variance_of_errors_human = variance_of_errors(df) ok_(variance_of_errors_human is None) assert issubclass(warning_list[-1].category, UserWarning)
def test_variance_of_errors_sparse_matrix(self): human_scores = self.human_score_columns df_humans = self.data_sparse[human_scores] variance_errors_human = variance_of_errors(df_humans) expected_v_e = 0.5150882 assert_almost_equal(variance_errors_human, expected_v_e, 7)
def test_variance_of_errors_full_matrix(self): human_scores = self.human_score_columns df_humans = self.data_full[human_scores] variance_errors_human = variance_of_errors(df_humans) expected_v_e = 0.509375 eq_(variance_errors_human, expected_v_e)