|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.square.qa.utilities.constructs.GeneralUtilsParameterized<TypeWID,TypeQ,TypeR>
public class GeneralUtilsParameterized<TypeWID,TypeQ,TypeR>
Constructor Summary | |
---|---|
GeneralUtilsParameterized()
|
Method Summary | |
---|---|
Map<TypeR,Integer> |
getCategIntMap(Set<TypeR> responseCategories)
Map response categories to integers |
Map<TypeQ,TypeR> |
getFilteredGT(Map<TypeQ,TypeR> gt,
List<TypeQ> questions)
Filter ground truth to include input questions only |
Map<TypeWID,workersDataStruct<TypeQ,TypeR>> |
getFilteredWorkerMap(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap,
List<TypeQ> questions)
Filter worker responses to include input questions only |
Map<TypeQ,Integer> |
getQuestionIntMap(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap)
Compute a map from questions to integers |
Map<TypeQ,TypeR> |
getQuestionResultPair(Map<TypeQ,Pair<TypeR,Map<TypeR,Double>>> combined)
Get question and estimated results from combined results |
Set<TypeQ> |
getQuestions(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap)
Extract questions from workers map |
Set<TypeQ> |
getQuestionsGT(Map<TypeQ,TypeR> gt)
Extract questions from ground truth |
Map<TypeWID,Integer> |
getWorkerIntMap(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap)
Compute a map from workers to integers |
void |
printMapFileQI(Map<TypeQ,Integer> questionToInt,
File file)
Print questions mapped to integers to a file |
void |
printMapFileRI(Map<TypeR,Integer> responseToInt,
File file)
Print responses mapped to integers to a file |
void |
printMapFileWI(Map<TypeWID,Integer> workerToInt,
File file)
Print workers mapped to integers to a file |
void |
printNumberedGT(Map<TypeQ,TypeR> gt,
File file)
Print ground truth to file -- categToInt, workerToInt and questionToInt need to be valid |
void |
printNumberedResponses(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap,
File file)
Print worker responses to file -- categToInt, workerToInt and questionToInt need to be valid |
void |
printStatistics(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap,
File... outDir)
Prints workerStatistics.txt dataStatistics.txt and questionStatistics.txt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeneralUtilsParameterized()
Method Detail |
---|
public Set<TypeQ> getQuestions(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap)
workersMap
- is a Map from worker ids to an object holding question and responses
public Set<TypeQ> getQuestionsGT(Map<TypeQ,TypeR> gt)
gt
- is Map from questions to responses
public Map<TypeWID,workersDataStruct<TypeQ,TypeR>> getFilteredWorkerMap(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap, List<TypeQ> questions)
workersMap
- is a Map from workers to an object holding questions and responsesquestions
- is a List of questions
public Map<TypeQ,TypeR> getFilteredGT(Map<TypeQ,TypeR> gt, List<TypeQ> questions)
gt
- is a Map from questions to responsesquestions
- is a List of questions
public Map<TypeQ,Integer> getQuestionIntMap(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap)
workersMap
- is a Map from workers to an object holding questions and responses
public Map<TypeWID,Integer> getWorkerIntMap(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap)
workersMap
- is a Map from workers to an object holding questions and responses
public void printNumberedResponses(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap, File file) throws FileNotFoundException
workersMap
- is a Map from workers to an object holding questions and responsesfile
- is of type File -- output file
FileNotFoundException
public void printNumberedGT(Map<TypeQ,TypeR> gt, File file) throws FileNotFoundException
gt
- is a Map from questions to responsesfile
- is of type File -- output file
FileNotFoundException
public Map<TypeR,Integer> getCategIntMap(Set<TypeR> responseCategories)
responseCategories
- is a Set of type responses holding response categories
public void printMapFileRI(Map<TypeR,Integer> responseToInt, File file) throws FileNotFoundException
responseToInt
- is a Map from response categories to integersfile
- is a File -- output file
FileNotFoundException
public void printMapFileQI(Map<TypeQ,Integer> questionToInt, File file) throws FileNotFoundException
questionToInt
- is a Map from questions to integersfile
- is File -- output file
FileNotFoundException
public void printMapFileWI(Map<TypeWID,Integer> workerToInt, File file) throws FileNotFoundException
workerToInt
- is a Map from workers to integersfile
- is a File -- output file
FileNotFoundException
public void printStatistics(Map<TypeWID,workersDataStruct<TypeQ,TypeR>> workersMap, File... outDir) throws FileNotFoundException
workersMap
- is a Map from workers to an object holding questions and responsesoutDir
- of type File is the output directory to print files
FileNotFoundException
public Map<TypeQ,TypeR> getQuestionResultPair(Map<TypeQ,Pair<TypeR,Map<TypeR,Double>>> combined)
combined
- is a Map from questions to a Pair holding the most probable result and other result probabilities
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |