Running Reducers

TESS User Reducer

This module porvides functions to calculate uesr weights for the TESS project. Extracts are from Ceasars PluckFieldExtractor.

panoptes_aggregation.running_reducers.tess_user_reducer.tess_user_reducer(data, **kwargs)

Calculate TESS user weights

Parameters:
  • data (list) – A list with one item containing the extract with the user’s feedback on a gold standard subject

  • store (keyword, dict) – A dictinary with two keys:

    • seed: sum of all previous seed values

    • count: sum of all previous gold standard transits seen

  • relevant_reduction (keyword, list) – A list with one item containing the results of the current subject’s stats reducer. This item is a dictinary with two keys:

    • True: number of users who correctly identified the gold standard transits in the subject

    • False: number of users who incorrectly identified the gold standard transits in the subject

Returns:

reduction – A dictinary with two keys:

  • data: A dictionary with the skill value as the only item

  • store: The updated store for the user

Return type:

dict


TESS Column Running Reducer

This module porvides functions to reduce the column task extracts for the TESS project in running mode. Extracts are from panoptes_aggregation.extractors.shape_extractor.

panoptes_aggregation.running_reducers.tess_reducer_column.tess_reducer_column_rr(data, **kwargs)

See panoptes_aggregation.reducers.tess_reducer_column.tess_reducer_column()


TESS Gold Standard Running Reducer

This module porvides functions to reduce the gold standard task extracts for the TESS project in running mode.

panoptes_aggregation.running_reducers.tess_gold_standard_reducer.tess_gold_standard_reducer_rr(data, **kwargs)

See panoptes_aggregation.reducers.tess_gold_standard_reducer.tess_gold_standard_reducer()


Gravity Spy User Reducer

This module provides functions to calculate user weights for the Gravity Spy project. Extracts are from caesar’s PluckFieldExtractor.

panoptes_aggregation.running_reducers.gravity_spy_user_reducer.gravity_spy_user_reducer(data, **kwargs)

Calculate Gravity Spy user weights based on a confusion matrix from gold standard data.

Parameters:
  • data (list) – A list with one item containing the extract with the user’s choice and the gold standard label.

  • first_level (str) – A string containing the key for the first level in the level_config object

  • level_config (dict) – This dictionary holds information about each level in the project. The key must be strings and the values are a dict with up to four keys:

    • workflow_id: the workflow ID for the level

    • new_categories: the categories added in this level (not included for the final level)

    • threshold: the min value of alpha these categories need to trigger a level up (not included for the final level)

    • next_level: the key for the next level (not included for the final level). Example:

      level_config = {
          'level_1': {
              'workflow_id': 1,
              'new_categories': [
                  'BLIP',
                  'WHISTLE'
              ],
              'threshold': 0.7,
              'next_level': 'level_2'
          },
          'level_2': {
              'workflow_id': 2
          }
      }
      
  • store (keyword, dict) – A dictionary with three keys:

    • confusion_matrix: The confusion matrix for the user (stored as nested dict). The first key is the choice given by the user, the second key is the gold standard label.

    • column_normalization: The sum of each of the columns (used for normalization). i.e. The total number of time the user has vote for each choice.

    • max_level: The maximum workflow level of the user

Returns:

reduction – A dictionary with the following keys:

  • alpha: A dictionary of values indicating how well the user classifies each category they have seen gold standard images for (diagonal of the normalized confusion matrix).

  • level_up: Bool indicating if the user should level up (used to trigger effect)

  • max_workflow_id: The workflow ID for the user’s highest unlocked level

  • max_level: The maximum workflow level of the user

  • most_useful_category: The gold standard category the user has the lowest score in (can be used to pick what gold standard category should be shown next to accelerate leveling up)

  • alpha_length: The number of values in the alpha dict, used to make sure the user has seen every gold standard class of a level before being promoted

  • normalized_confusion_matrix: The column normalized confusion matrix for the user

  • _store: The updated store (see above)

Return type:

dict


Gravity Spy Subject Reducer

This module provides functions to calculate subject reductions for the Gravity Spy project. Extracts are from caesar’s PluckFieldExtractor.

panoptes_aggregation.running_reducers.gravity_spy_subject_reducer.gravity_spy_subject_reducer(data, none_key='NONEOFTHEABOVE', **kwargs)

Calculate Gravity Spy category weights for a subject using volunteer’s confusion matrices.

Parameters:
  • data (list) – A list with one item containing the extract with the user’s choice and the resulting weights from the ML code (stored in the subject metadata)

  • none_key (string) – The key used for a “none of the above” answer

  • store (keyword, dict) – A dictionary with two keys:

    • number_views: The number of times the subject has been seen (the ML results count for 1 of these)

    • category_weights_sum: The running sum for the weights in each category

  • relevant_reduction (keyword, list) – A list with one item containing the results of the current user’s confusion matrix reducer (see panoptes_aggregation.running_reducers.gravity_spy_user_reduce.gravity_spy_user_reduce())

Returns:

reduction – A dictionary with the following keys:

  • number_views: Number of times the subject has been seen (the ML results count for 1 of these)

  • category_weights: A dictionary of values corresponding to the probability the subject belongs to each listed category (all values sum to 1)

  • max_category_weight: The max value from the category_weights dict, used to retire the subject

  • _store : The updated store (see above)

Return type:

dict