def test_timeseries(fm): fm_with_time = fm.reset_index() fm_with_time['time'] = pd.to_datetime(fm_with_time['time']) col_1 = fm_with_time['time'] col_2 = fm_with_time['label'] hplot.show(hplot.timeseries(col_1, col_2)) hplot.show(hplot.timeseries(col_1, col_2), static=True)
def test_gridplot(fm): p1 = hplot.show(hplot.histogram(fm['flights.distance_group']), fig=True, static=True) p2 = hplot.show(hplot.histogram(fm['flights.distance_group'], n_bins=15), fig=True, static=True) hplot.gridplot([p1, p2], n_cols=2) hplot.gridplot([[p1], [p2]])
def test_modify_plot(fm): hplot.show(hplot.histogram(fm['flights.distance_group']), width=300, height=300, title='Distance Histogram', x_axis='axis x', y_axis='axis y', x_range=(0, 1000), y_range=(0, 1000))
def test_color(fm): colors = ['white', '#000000', 'green'] hplot.show(hplot.histogram(fm['flights.distance_group']), colors=colors) hplot.show(hplot.piechart(fm['flights.dest']), colors=colors) hplot.show(hplot.scatter(fm['distance'], fm['distance']), colors=colors) fm_with_time = fm.reset_index() fm_with_time['time'] = pd.to_datetime(fm_with_time['time']) col_1 = fm_with_time['time'] col_2 = fm_with_time['label'] hplot.show(hplot.timeseries(col_1, col_2), colors=colors)
def test_dend_plot(fit_dend): show(dendrogram(fit_dend), static=True) show(dendrogram(fit_dend))
def test_f1(Xy): X, y = Xy hplot.show(hplot.f1(X, y, RandomForestClassifier()))
def test_roc_auc(Xy): X, y = Xy hplot.show(hplot.roc_auc(X, y, RandomForestClassifier(), n_splits=3))
def test_scatter(fm): col_1 = fm['scheduled_elapsed_time'] col_2 = fm['distance'] agg = fm['flights.carrier'] hplot.show(hplot.scatter(col_1, col_2, agg)) hplot.show(hplot.scatter(col_1, col_2, agg), static=True)
def test_histogram(fm): hplot.show(hplot.histogram(fm['flights.distance_group'])) hplot.show(hplot.histogram(fm['flights.distance_group']), static=True)
def test_piechart(fm): hplot.show(hplot.piechart(fm['flights.carrier'])) hplot.show(hplot.piechart(fm['flights.carrier']), static=True)