@requires_sklearn
def test_gat_chance_level():
 gat = _get_data()
 ax = gat.plot_diagonal(chance=False)
 ax = gat.plot_diagonal()
 assert_equals(chance(ax), 0.5)
 gat = _get_data(event_id=dict(aud_l=1, vis_l=3, aud_r=2, vis_r=4))
 ax = gat.plot_diagonal()
 assert_equals(chance(ax), 0.25)
 ax = gat.plot_diagonal(chance=1.234)
 assert_equals(chance(ax), 1.234)
 assert_raises(ValueError, gat.plot_diagonal, chance='foo')
 del gat.scores_
 assert_raises(RuntimeError, gat.plot)

@ requires_sklearn def test_gat_chance_level ( ) : gat = _get_data ( ) ax = gat . plot_diagonal ( chance = False ) ax = gat . plot_diagonal ( ) assert_equals ( chance ( ax ) , 0.5 ) gat = _get_data ( event_id = dict ( aud_l = 1 , vis_l = 3 , aud_r = 2 , vis_r = 4 ) ) ax = gat . plot_diagonal ( ) assert_equals ( chance ( ax ) , 0.25 ) ax = gat . plot_diagonal ( chance = 1.234 ) assert_equals ( chance ( ax ) , 1.234 ) assert_raises ( ValueError , gat . plot_diagonal , chance = 'foo' ) del gat . scores_ assert_raises ( RuntimeError , gat . plot )
test gat plot_times chance level .