ActiveCrowdToolkit  0.1
CrowdsourcingModels.DataMapping Class Reference

Data mapping class. This class manages the mapping between the data (which is in the form of task, worker ids, and labels) and the model data (which is in term of indices). More...

Public Member Functions

 DataMapping (IEnumerable< Datum > data, int numCommunities=-1, int labelMin=int.MaxValue, int labelMax=int.MinValue)
 Creates a data mapping. More...
 
int[][] GetTaskIndicesPerWorkerIndex (IEnumerable< Datum > data)
 Returns the matrix of the task indices (columns) of each worker (rows). More...
 
int[][] GetLabelsPerWorkerIndex (IEnumerable< Datum > data)
 Returns the matrix of the labels (columns) of each worker (rows). More...
 
Dictionary< string, int?> GetGoldLabelsPerTaskId ()
 Returns the the gold labels of each task. More...
 
Dictionary< string, int?> GetRandomLabelPerTaskId (IList< Datum > data)
 
int[] GetGoldLabelsPerTaskIndex ()
 
double[][] GetTimeSpentPerWorkerIndex (IEnumerable< Datum > data)
 
List< DatumBuildDataFromAssignedLabels (Dictionary< string, int?> AssignedLabels, IList< Datum > OriginalData)
 
int[] GetMajorityVotesPerTaskIndex ()
 For each task, gets the majority vote label if it is unique. More...
 
Dictionary< string, int?> GetMajorityVotesPerTaskId (IList< Datum > data)
 For each task Id, gets the majority vote label if it is unique. More...
 
Discrete[] GetVoteDistribPerTaskIndex ()
 For each task, gets the empirical label distribution. More...
 

Public Attributes

string[] WorkerIndexToId
 The mapping from the worker index to the worker id. More...
 
Dictionary< string, int > WorkerIdToIndex
 The mapping from the worker id to the worker index. More...
 
Dictionary< string, int > CommunityIdToIndex
 The mapping from the community id to the community index. More...
 
string[] CommunityIndexToId
 The mapping from the community index to the community id. More...
 
string[] TaskIndexToId
 The mapping from the task index to the task id. More...
 
Dictionary< string, int > TaskIdToIndex
 The mapping from the task id to the task index. More...
 
int LabelMin
 The lower bound of the labels range. More...
 
int LabelMax
 The upper bound of the labels range. More...
 

Properties

IEnumerable< DatumData [get]
 The enumerable list of data. More...
 
IEnumerable< DatumDataWithGold [get]
 The filtered enumerable list of data with gold labels. More...
 
int LabelCount [get]
 The number of label values. More...
 
int WorkerCount [get]
 The number of workers. More...
 
int TaskCount [get]
 The number of tasks. More...
 

Detailed Description

Data mapping class. This class manages the mapping between the data (which is in the form of task, worker ids, and labels) and the model data (which is in term of indices).

Constructor & Destructor Documentation

CrowdsourcingModels.DataMapping.DataMapping ( IEnumerable< Datum data,
int  numCommunities = -1,
int  labelMin = int.MaxValue,
int  labelMax = int.MinValue 
)
inline

Creates a data mapping.

Parameters
dataThe data.
numCommunitiesThe number of communities.
labelMinThe lower bound of the labels range.
labelMaxThe upper bound of the labels range.

Member Function Documentation

Dictionary<string, int?> CrowdsourcingModels.DataMapping.GetGoldLabelsPerTaskId ( )
inline

Returns the the gold labels of each task.

Returns
The dictionary keyed by task id and the value is the gold label.
int [][] CrowdsourcingModels.DataMapping.GetLabelsPerWorkerIndex ( IEnumerable< Datum data)
inline

Returns the matrix of the labels (columns) of each worker (rows).

Parameters
dataThe data.
Returns
The matrix of the labels (columns) of each worker (rows).
Dictionary<string, int?> CrowdsourcingModels.DataMapping.GetMajorityVotesPerTaskId ( IList< Datum data)
inline

For each task Id, gets the majority vote label if it is unique.

Returns
The dictionary of majority vote labels indexed by task id.
int [] CrowdsourcingModels.DataMapping.GetMajorityVotesPerTaskIndex ( )
inline

For each task, gets the majority vote label if it is unique.

Returns
The list of majority vote labels.
int [][] CrowdsourcingModels.DataMapping.GetTaskIndicesPerWorkerIndex ( IEnumerable< Datum data)
inline

Returns the matrix of the task indices (columns) of each worker (rows).

Parameters
dataThe data.
Returns
The matrix of the task indices (columns) of each worker (rows).
Discrete [] CrowdsourcingModels.DataMapping.GetVoteDistribPerTaskIndex ( )
inline

For each task, gets the empirical label distribution.

Returns

Member Data Documentation

Dictionary<string, int> CrowdsourcingModels.DataMapping.CommunityIdToIndex

The mapping from the community id to the community index.

string [] CrowdsourcingModels.DataMapping.CommunityIndexToId

The mapping from the community index to the community id.

int CrowdsourcingModels.DataMapping.LabelMax

The upper bound of the labels range.

int CrowdsourcingModels.DataMapping.LabelMin

The lower bound of the labels range.

Dictionary<string, int> CrowdsourcingModels.DataMapping.TaskIdToIndex

The mapping from the task id to the task index.

string [] CrowdsourcingModels.DataMapping.TaskIndexToId

The mapping from the task index to the task id.

Dictionary<string, int> CrowdsourcingModels.DataMapping.WorkerIdToIndex

The mapping from the worker id to the worker index.

string [] CrowdsourcingModels.DataMapping.WorkerIndexToId

The mapping from the worker index to the worker id.

Property Documentation

IEnumerable<Datum> CrowdsourcingModels.DataMapping.Data
get

The enumerable list of data.

IEnumerable<Datum> CrowdsourcingModels.DataMapping.DataWithGold
get

The filtered enumerable list of data with gold labels.

int CrowdsourcingModels.DataMapping.LabelCount
get

The number of label values.

int CrowdsourcingModels.DataMapping.TaskCount
get

The number of tasks.

int CrowdsourcingModels.DataMapping.WorkerCount
get

The number of workers.


The documentation for this class was generated from the following file: