Skip to content
Snippets Groups Projects
Commit 44f70a83 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

more details

parent 83f595ad
Branches
Tags v2.0.14
1 merge request!61Title and histograms subplots
Pipeline #
...@@ -73,12 +73,12 @@ def roc(ctx, scores, evaluation, **kwargs): ...@@ -73,12 +73,12 @@ def roc(ctx, scores, evaluation, **kwargs):
only dev scores are provided, you must use flag `--no-evaluation`. only dev scores are provided, you must use flag `--no-evaluation`.
Examples: Examples:
$ bob measure roc dev-scores $ bob measure roc -v dev-scores
$ bob measure roc dev-scores1 eval-scores1 dev-scores2 $ bob measure roc -v dev-scores1 eval-scores1 dev-scores2
eval-scores2 eval-scores2
$ bob measure roc -o my_roc.pdf dev-scores1 eval-scores1 $ bob measure roc -v -o my_roc.pdf dev-scores1 eval-scores1
""" """
process = figure.Roc(ctx, scores, evaluation, load.split) process = figure.Roc(ctx, scores, evaluation, load.split)
process.run() process.run()
...@@ -114,12 +114,12 @@ def det(ctx, scores, evaluation, **kwargs): ...@@ -114,12 +114,12 @@ def det(ctx, scores, evaluation, **kwargs):
only dev scores are provided, you must use flag `--no-evaluation`. only dev scores are provided, you must use flag `--no-evaluation`.
Examples: Examples:
$ bob measure det dev-scores $ bob measure det -v dev-scores
$ bob measure det dev-scores1 eval-scores1 dev-scores2 $ bob measure det -v dev-scores1 eval-scores1 dev-scores2
eval-scores2 eval-scores2
$ bob measure det -o my_det.pdf dev-scores1 eval-scores1 $ bob measure det -v -o my_det.pdf dev-scores1 eval-scores1
""" """
process = figure.Det(ctx, scores, evaluation, load.split) process = figure.Det(ctx, scores, evaluation, load.split)
process.run() process.run()
...@@ -149,9 +149,9 @@ def epc(ctx, scores, **kwargs): ...@@ -149,9 +149,9 @@ def epc(ctx, scores, **kwargs):
for each experiment. for each experiment.
Examples: Examples:
$ bob measure epc dev-scores eval-scores $ bob measure epc -v dev-scores eval-scores
$ bob measure epc -o my_epc.pdf dev-scores1 eval-scores1 $ bob measure epc -v -o my_epc.pdf dev-scores1 eval-scores1
""" """
process = figure.Epc(ctx, scores, True, load.split) process = figure.Epc(ctx, scores, True, load.split)
process.run() process.run()
...@@ -189,12 +189,12 @@ def hist(ctx, scores, evaluation, **kwargs): ...@@ -189,12 +189,12 @@ def hist(ctx, scores, evaluation, **kwargs):
as well, use ``--show-dev`` option. as well, use ``--show-dev`` option.
Examples: Examples:
$ bob measure hist dev-scores $ bob measure hist -v dev-scores
$ bob measure hist dev-scores1 eval-scores1 dev-scores2 $ bob measure hist -v dev-scores1 eval-scores1 dev-scores2
eval-scores2 eval-scores2
$ bob measure hist --criterion min-hter --show-dev dev-scores1 eval-scores1 $ bob measure hist -v --criterion min-hter --show-dev dev-scores1 eval-scores1
""" """
process = figure.Hist(ctx, scores, evaluation, load.split) process = figure.Hist(ctx, scores, evaluation, load.split)
process.run() process.run()
...@@ -209,7 +209,6 @@ def hist(ctx, scores, evaluation, **kwargs): ...@@ -209,7 +209,6 @@ def hist(ctx, scores, evaluation, **kwargs):
@common_options.output_log_metric_option() @common_options.output_log_metric_option()
@common_options.output_plot_file_option(default_out='eval_plots.pdf') @common_options.output_plot_file_option(default_out='eval_plots.pdf')
@common_options.points_curve_option() @common_options.points_curve_option()
@common_options.n_bins_option()
@common_options.lines_at_option() @common_options.lines_at_option()
@common_options.const_layout_option() @common_options.const_layout_option()
@common_options.figsize_option() @common_options.figsize_option()
...@@ -237,14 +236,14 @@ def evaluate(ctx, scores, evaluation, **kwargs): ...@@ -237,14 +236,14 @@ def evaluate(ctx, scores, evaluation, **kwargs):
* evaluation scores * evaluation scores
Examples: Examples:
$ bob measure evaluate dev-scores $ bob measure evaluate -v dev-scores
$ bob measure evaluate scores-dev1 scores-eval1 scores-dev2 $ bob measure evaluate -v scores-dev1 scores-eval1 scores-dev2
scores-eval2 scores-eval2
$ bob measure evaluate /path/to/sys-{1,2,3}/scores-{dev,eval} $ bob measure evaluate -v /path/to/sys-{1,2,3}/scores-{dev,eval}
$ bob measure evaluate -l metrics.txt -o my_plots.pdf dev-scores eval-scores $ bob measure evaluate -v -l metrics.txt -o my_plots.pdf dev-scores eval-scores
''' '''
# first time erase if existing file # first time erase if existing file
ctx.meta['open_mode'] = 'w' ctx.meta['open_mode'] = 'w'
......
...@@ -4,6 +4,7 @@ import logging ...@@ -4,6 +4,7 @@ import logging
import click import click
from click.types import INT, FLOAT from click.types import INT, FLOAT
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import tabulate
from matplotlib.backends.backend_pdf import PdfPages from matplotlib.backends.backend_pdf import PdfPages
from bob.extension.scripts.click_helper import (bool_option, list_float_option) from bob.extension.scripts.click_helper import (bool_option, list_float_option)
...@@ -245,19 +246,15 @@ def n_bins_option(**kwargs): ...@@ -245,19 +246,15 @@ def n_bins_option(**kwargs):
def table_option(**kwargs): def table_option(**kwargs):
'''Get table option for tabulate package '''Get table option for tabulate package
More informnations: https://pypi.python.org/pypi/tabulate More informnations: https://pypi.org/project/tabulate/
''' '''
def custom_table_option(func): def custom_table_option(func):
def callback(ctx, param, value): def callback(ctx, param, value):
ctx.meta['tablefmt'] = value ctx.meta['tablefmt'] = value
return value return value
return click.option( return click.option(
'--tablefmt', type=click.STRING, default='rst', '--tablefmt', type=click.Choice(tabulate.tabulate_formats),
show_default=True, help='Format for table display: `plain`, ' default='rst', show_default=True, help='Format of printed tables.',
'`simple`, `grid`, `fancy_grid`, `pipe`, `orgtbl`, '
'`jira`, `presto`, `psql`, `rst`, `mediawiki`, `moinmoin`, '
'`youtrack`, `html`, `latex`, '
'`latex_raw`, `latex_booktabs`, `textile`',
callback=callback, **kwargs)(func) callback=callback, **kwargs)(func)
return custom_table_option return custom_table_option
...@@ -460,7 +457,7 @@ def x_label_option(dflt=None, **kwargs): ...@@ -460,7 +457,7 @@ def x_label_option(dflt=None, **kwargs):
return value return value
return click.option( return click.option(
'-xl', '--x-lable', type=click.STRING, default=dflt, '-xl', '--x-lable', type=click.STRING, default=dflt,
help='Label for x-axis', show_default=True, help='Label for x-axis',
callback=callback, **kwargs)(func) callback=callback, **kwargs)(func)
return custom_x_label_option return custom_x_label_option
......
...@@ -470,6 +470,8 @@ look at the implementations at :py:mod:`bob.measure.plot` to understand how to ...@@ -470,6 +470,8 @@ look at the implementations at :py:mod:`bob.measure.plot` to understand how to
use the |project| methods to compute the curves and interlace that in the way use the |project| methods to compute the curves and interlace that in the way
that best suits you. that best suits you.
.. _bob.measure.command_line:
Full applications Full applications
----------------- -----------------
...@@ -583,6 +585,11 @@ where `my_det.pdf` will contain DET plots for the two experiments. ...@@ -583,6 +585,11 @@ where `my_det.pdf` will contain DET plots for the two experiments.
different plots. You can force gather everything in the same plot using different plots. You can force gather everything in the same plot using
``--no-split`` option. ``--no-split`` option.
.. note::
The ``--figsize`` and ``--style`` options are two powerful options that can
dramatically change the appearance of your figures. Try them! (e.g.
``--figsize 12,10 --style grayscale``)
Evaluate Evaluate
======== ========
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment