Skip to content

Guava Table<Integer, String, String> to JSAT DataSet #43

Description

@salamanders

I got it working... but it was brutal, about 300 lines of code. I feel like I did it the hard way, but I wasn't sure if there was an easier way after reading the CSV parser code.

  1. Parsing the Strings into Longs, Doubles, Strings
  2. Finding out the "worst" type for each column and normalizing across the column
  3. Making lookup tables for each column that needs it (small number of ints, or Strings)
  4. Generate a dataset based on the output column name

Is there an easier way to do this?
Can it be part of the library?

class TableDataLoader

  • TableDataLoader(Table<Long, String, String>)
  • getDataSet(String)
  • tableToDataSet_Classification(ColumnInfo, List, SortedSet, int, int)
  • tableToDataSet_Regression(ColumnInfo, List, SortedSet, int, int)

class ColumnInfo

  • ColumnInfo(String, Map<Long, String>)
  • collectionToSortedUniqueStringList(Collection)
  • parseColumn(Map<Long, String>)
  • parseToLowestObject(String, Class<?>)
  • constructJSATCategoricalData()
  • constructLabelLookups()
  • getCategoricalData()
  • getName()
  • getType()
  • isLookup()
  • getRowValue(Number)
  • getKeyFromLookupId(int)
  • getAllRowKeys()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions