Package adaptlil.gazepoint.excel
Class OntoMapCsv
java.lang.Object
adaptlil.gazepoint.excel.OntoMapCsv
This is a hacky one time use to make training data for participants. This file is for historic purposes and data replication.
This is not intended for main use as it pertains to creating data for the deep learning model and is dependent on
your goals.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionList of participantIDs that were discarded from the study.getRandomTestParticipantsIds
(int numTestParticipants, HashMap<String, Participant> mapParticipants) static RecXml
getRecXmlObjectFromCells
(List<String> headerRow, String[] cells) private static boolean
listContainsStr
(List<String> haystack, String needle) Iterate through list of strings and return true if the needle matches.static weka.core.Instances
listInstanceToInstances
(List<weka.core.Instance> instanceList, List<String> targetValues) private static void
logTestParticipants
(File outputDir, List<String> testParticipantIds) static void
static HashMap<String,
Participant> mapParticipantsToId
(Participant[] participants) mapParticipantsToStudyData
(String dir, boolean isGazePointFolder, String filter) Maps participiant names to their task data.static void
saveInstancesToFile
(weka.core.Instances instances, String fileName) static void
saveParticipantDataAsSeparateFile
(boolean useParticipantForTrainingData, Participant p, List<weka.core.Instance> instanceList, List<String> nominalValues, File answerFile, File outputDir) Save an individual participant's gaze training/test data to a single file.static void
saveTestAndTrainingToOneFile
(List<weka.core.Instance> trainInstanceList, List<weka.core.Instance> testInstanceList, List<String> nominalValues, File outputDir) Save training and test data to a single filestatic void
testParticipantInstances
(Participant[] participants)
-
Constructor Details
-
OntoMapCsv
public OntoMapCsv()
-
-
Method Details
-
discardedParticipantIds
List of participantIDs that were discarded from the study.- Returns:
-
participantIdsForTestDataSet
-
mapParticipantsToStudyData
private static Map<String,List<File>> mapParticipantsToStudyData(String dir, boolean isGazePointFolder, String filter) Maps participiant names to their task data. Excludes the discarded participants.- Parameters:
dir
-isGazePointFolder
-filter
-- Returns:
-
getParticipantsThatDidntTry
-
main
-
listContainsStr
Iterate through list of strings and return true if the needle matches.- Parameters:
haystack
-needle
-- Returns:
-
getRandomTestParticipantsIds
private static List<String> getRandomTestParticipantsIds(int numTestParticipants, HashMap<String, Participant> mapParticipants) -
logTestParticipants
private static void logTestParticipants(File outputDir, List<String> testParticipantIds) throws IOException - Throws:
IOException
-
mapParticipantsToId
-
testParticipantInstances
- Throws:
Exception
-
listInstanceToInstances
-
saveTestAndTrainingToOneFile
public static void saveTestAndTrainingToOneFile(List<weka.core.Instance> trainInstanceList, List<weka.core.Instance> testInstanceList, List<String> nominalValues, File outputDir) throws IOException Save training and test data to a single file- Parameters:
trainInstanceList
-testInstanceList
-nominalValues
-outputDir
-- Throws:
IOException
-
saveParticipantDataAsSeparateFile
public static void saveParticipantDataAsSeparateFile(boolean useParticipantForTrainingData, Participant p, List<weka.core.Instance> instanceList, List<String> nominalValues, File answerFile, File outputDir) throws IOException Save an individual participant's gaze training/test data to a single file.- Parameters:
useParticipantForTrainingData
-p
-instanceList
-nominalValues
-answerFile
-outputDir
-- Throws:
IOException
-
getRecXmlObjectFromCells
-
saveInstancesToFile
public static void saveInstancesToFile(weka.core.Instances instances, String fileName) throws IOException - Throws:
IOException
-