Class OntoMapCsv

java.lang.Object
adaptlil.gazepoint.excel.OntoMapCsv

public class OntoMapCsv extends Object
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 Details

    • OntoMapCsv

      public OntoMapCsv()
  • Method Details

    • discardedParticipantIds

      private static List<String> discardedParticipantIds()
      List of participantIDs that were discarded from the study.
      Returns:
    • participantIdsForTestDataSet

      private static List<String> 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

      public List<String> getParticipantsThatDidntTry()
    • main

      public static void main(String[] args)
    • listContainsStr

      private static boolean listContainsStr(List<String> haystack, String needle)
      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

      public static HashMap<String,Participant> mapParticipantsToId(Participant[] participants)
    • testParticipantInstances

      public static void testParticipantInstances(Participant[] participants) throws Exception
      Throws:
      Exception
    • listInstanceToInstances

      public static weka.core.Instances listInstanceToInstances(List<weka.core.Instance> instanceList, List<String> targetValues)
    • 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

      public static RecXml getRecXmlObjectFromCells(List<String> headerRow, String[] cells)
    • saveInstancesToFile

      public static void saveInstancesToFile(weka.core.Instances instances, String fileName) throws IOException
      Throws:
      IOException