def test_precomputed(self, model, expected_score): benchmark = DicarloRajalingham2018I2n() probabilities = pd.read_pickle( os.path.join(os.path.dirname(__file__), '..', 'test_metrics', f'{model}-probabilities.pkl'))['data'] probabilities = BehavioralAssembly(probabilities) candidate = PrecomputedProbabilities(probabilities) score = benchmark(candidate) assert score.raw.sel(aggregation='center') == approx(expected_score, abs=.005) assert score.sel(aggregation='center') == approx(expected_score / np.sqrt(.479), abs=.005)
def test_precomputed(self, model, expected_score): benchmark = DicarloRajalingham2018I2n() probabilities = Path( __file__ ).parent.parent / 'test_metrics' / f'{model}-probabilities.nc' probabilities = BehavioralAssembly(xr.load_dataarray(probabilities)) candidate = PrecomputedProbabilities(probabilities) score = benchmark(candidate) assert score.raw.sel(aggregation='center') == approx(expected_score, abs=.005) assert score.sel(aggregation='center') == approx(expected_score / np.sqrt(.479), abs=.005)
def test_ceiling(self): benchmark = DicarloRajalingham2018I2n() ceiling = benchmark.ceiling assert ceiling.sel(aggregation='center') == approx(.479, abs=.0064)