Пример #1
0
 def get_export_variants(self) -> Sequence[ExportVariant]:
     return [
         ExportVariant(
             name='Summary',
             column_names=(
                 'subject',
                 'garp',
                 'sarp',
                 'warp_strict',
                 'warp_nonstrict',
                 'hm_garp_lower',
                 'hm_garp_upper',
                 'hm_sarp_lower',
                 'hm_sarp_upper',
                 'hm_warp_strict_lower',
                 'hm_warp_strict_upper',
                 'hm_warp_nonstrict_lower',
                 'hm_warp_nonstrict_upper',
             ),
             get_rows=self.export_summary,
             size=len(self.subjects),
         ),
         ExportVariant(
             name='Violations by cycle length',
             column_names=('subject', 'cycle_length', 'garp', 'sarp'),
             get_rows=self.export_breakdown,
             size=len(self.subjects),
         ),
     ]
Пример #2
0
 def get_export_variants(self) -> Sequence[ExportVariant]:
     return (ExportVariant(
         name='Detailed',
         column_names=('subject', 'menu', 'default', 'choice'),
         get_rows=self.export_detailed,
         size=len(self.subjects),
     ), )
Пример #3
0
 def get_export_variants(self) -> Sequence[ExportVariant]:
     return (
         ExportVariant(
             name='Compact (human-friendly)',
             column_names=('subject', 'dist_score', 'model', 'instances'),
             get_rows=self.export_compact,
             size=len(self.subjects),
         ),
         ExportVariant(
             name='Detailed (machine-friendly)',
             column_names=('subject', 'dist_score',
                           'dist_score_upper_bound', 'model', 'instance'),
             get_rows=self.export_detailed,
             size=len(self.subjects),
         ),
     )
Пример #4
0
 def get_export_variants(self) -> Sequence[ExportVariant]:
     return (ExportVariant(
         name='Detailed',
         column_names=(
             'subject',
             'tuple_length',
             'menus',
         ),
         get_rows=self.export_detailed,
         size=len(self.subjects),
     ), )
Пример #5
0
 def get_export_variants(self) -> Sequence[ExportVariant]:
     return (ExportVariant(
         name='Detailed',
         column_names=(
             'subject',
             'observations',
             'active_choices',
             'deferrals',
         ),
         get_rows=self.export_detailed,
         size=len(self.subjects),
     ), )
Пример #6
0
 def get_export_variants(self) -> Sequence[ExportVariant]:
     return (
         ExportVariant(
             name='Summary',
             column_names=(
                 'subject',
                 'warp_pairs',
                 'warp_all',
                 'congruence',
                 'strict_general_cycles',
                 'binary_cycles',
                 'strict_binary_cycles',
             ),
             get_rows=self.export_summary,
             size=len(self.subjects),
         ),
         ExportVariant(
             name='WARP violations',
             column_names=['subject', 'warp_pairs', 'warp_all'],
             get_rows=self.export_warp,
             size=len(self.subjects),
         ),
         ExportVariant(
             name='Congruence violations (wide)',
             column_names=['subject'] +
             ['cycles_%d' % l
              for l in range(3, self.max_cycle_length + 1)] + ['total'],
             get_rows=lambda: self.export_wide('garp'),
             size=len(self.subjects),
         ),
         ExportVariant(
             name='Strict general cycles (wide)',
             column_names=['subject'] +
             ['cycles_%d' % l
              for l in range(3, self.max_cycle_length + 1)] + ['total'],
             get_rows=lambda: self.export_wide('sarp'),
             size=len(self.subjects),
         ),
         ExportVariant(
             name='Strict binary cycles (wide)',
             column_names=['subject'] +
             ['cycles_%d' % l
              for l in range(3, self.max_cycle_length + 1)] + ['total'],
             get_rows=lambda: self.export_wide('sarp_binary_menus'),
             size=len(self.subjects),
         ),
         ExportVariant(
             name='Binary cycles (wide)',
             column_names=['subject'] +
             ['cycles_%d' % l
              for l in range(3, self.max_cycle_length + 1)] + ['total'],
             get_rows=lambda: self.export_wide('garp_binary_menus'),
             size=len(self.subjects),
         ),
     )
Пример #7
0
    def get_export_variants(self) -> Sequence[ExportVariant]:
        if not self.subjects:
            return []

        _n_observ, n_alts = self.subjects[0].prices.shape

        return [
            ExportVariant(
                name='Detailed',
                column_names=\
                    ['subject'] \
                    + [f'price{i+1}' for i in range(n_alts)] \
                    + [f'quantity{i+1}' for i in range(n_alts)],
                get_rows=self.export_detailed,
                size=len(self.subjects),
            ),
        ]