def signature_data_plot(sd): import ggplot as gg aes = gg.aes(x='set_exp', y='not_exp', color='pearson_r') return gg.ggplot(aes, data=sd) \ + gg.geom_point(size=15) \ + gg.scale_color_gradient(low='yellow', high='red') \ + gg.scale_x_log() + gg.scale_x_continuous(limits=(0.5, 10000)) \ + gg.scale_y_log() + gg.scale_y_continuous(limits=(0.05, 10000))
data = [] for method in methods: for model in models: for rtol in rtols: print('method: {} model: {} rtol: {}'.format(method.name, model.name, rtol), end='') # Run tic = time.time() result = method(model, rtol) toc = time.time() - tic # Compare to gold standard standard = gold_standards[model.name] diff = result - standard.values max_rel_diff = np.max(diff/standard.max) # Append to table record = (method.name, model.name, rtol, max_rel_diff, toc) print(' err: {} toc: {}'.format(max_rel_diff, toc)) data.append(record) data = DataFrame(data, columns=['method', 'model', 'rtol', 'err', 'time']) print(gg.ggplot(data, gg.aes(x='err', y='time', color='method')) + gg.geom_point(size=60.0) + gg.geom_line() + gg.scale_x_log() + gg.scale_y_log() + gg.xlim(1e-10, 1e-2))
data = [] for method in methods: for model in models: for rtol in rtols: print('method: {} model: {} rtol: {}'.format( method.name, model.name, rtol), end='') # Run tic = time.time() result = method(model, rtol) toc = time.time() - tic # Compare to gold standard standard = gold_standards[model.name] diff = result - standard.values max_rel_diff = np.max(diff / standard.max) # Append to table record = (method.name, model.name, rtol, max_rel_diff, toc) print(' err: {} toc: {}'.format(max_rel_diff, toc)) data.append(record) data = DataFrame(data, columns=['method', 'model', 'rtol', 'err', 'time']) print( gg.ggplot(data, gg.aes(x='err', y='time', color='method')) + gg.geom_point(size=60.0) + gg.geom_line() + gg.scale_x_log() + gg.scale_y_log() + gg.xlim(1e-10, 1e-2))
def test_scale_x_log_base(self): p = gg.ggplot(gg.aes(x='mpg'), gg.mtcars) + gg.scale_x_log(base=100) self.assertEqual(p.scale_x_log, 100)
def test_scale_x_log_default10(self): p = gg.ggplot(gg.aes(x='mpg'), gg.mtcars) + gg.scale_x_log() self.assertEqual(p.scale_x_log, 10)