{"action":"created","issue":{"url":"https://api.github.com/repos/EdwardRaff/JSAT/issues/43","repository_url":"https://api.github.com/repos/EdwardRaff/JSAT","labels_url":"https://api.github.com/repos/EdwardRaff/JSAT/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/EdwardRaff/JSAT/issues/43/comments","events_url":"https://api.github.com/repos/EdwardRaff/JSAT/issues/43/events","html_url":"https://github.com/EdwardRaff/JSAT/issues/43","id":170979991,"number":43,"title":"Guava Table<Integer, String, String> to JSAT DataSet","user":{"login":"salamanders","id":85366,"avatar_url":"https://avatars.githubusercontent.com/u/85366?v=3","gravatar_id":"","url":"https://api.github.com/users/salamanders","html_url":"https://github.com/salamanders","followers_url":"https://api.github.com/users/salamanders/followers","following_url":"https://api.github.com/users/salamanders/following{/other_user}","gists_url":"https://api.github.com/users/salamanders/gists{/gist_id}","starred_url":"https://api.github.com/users/salamanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salamanders/subscriptions","organizations_url":"https://api.github.com/users/salamanders/orgs","repos_url":"https://api.github.com/users/salamanders/repos","events_url":"https://api.github.com/users/salamanders/events{/privacy}","received_events_url":"https://api.github.com/users/salamanders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-12T23:53:54Z","updated_at":"2016-08-13T03:51:48Z","closed_at":null,"body":"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.\r\n\r\n1. Parsing the Strings into Longs, Doubles, Strings\r\n2. Finding out the \"worst\" type for each column and normalizing across the column\r\n3. Making lookup tables for each column that needs it (small number of ints, or Strings)\r\n4. Generate a dataset based on the output column name\r\n\r\nIs there an easier way to do this?\r\nCan it be part of the library?\r\n\r\nclass TableDataLoader\r\n* **TableDataLoader(Table<Long, String, String>)**\r\n* **getDataSet(String)**\r\n* tableToDataSet_Classification(ColumnInfo, List<CategoricalData>, SortedSet<Number>, int, int)\r\n* tableToDataSet_Regression(ColumnInfo, List<CategoricalData>, SortedSet<Number>, int, int)\r\n\r\nclass ColumnInfo\r\n* ColumnInfo(String, Map<Long, String>)\r\n* collectionToSortedUniqueStringList(Collection<Object>)\r\n* parseColumn(Map<Long, String>)\r\n* parseToLowestObject(String, Class<?>)\r\n* **constructJSATCategoricalData()**\r\n* constructLabelLookups()\r\n* getCategoricalData()\r\n* getName()\r\n* getType()\r\n* isLookup()\r\n* **getRowValue(Number)**\r\n* getKeyFromLookupId(int)\r\n* getAllRowKeys()\r\n"},"comment":{"url":"https://api.github.com/repos/EdwardRaff/JSAT/issues/comments/239600168","html_url":"https://github.com/EdwardRaff/JSAT/issues/43#issuecomment-239600168","issue_url":"https://api.github.com/repos/EdwardRaff/JSAT/issues/43","id":239600168,"user":{"login":"EdwardRaff","id":2008786,"avatar_url":"https://avatars.githubusercontent.com/u/2008786?v=3","gravatar_id":"","url":"https://api.github.com/users/EdwardRaff","html_url":"https://github.com/EdwardRaff","followers_url":"https://api.github.com/users/EdwardRaff/followers","following_url":"https://api.github.com/users/EdwardRaff/following{/other_user}","gists_url":"https://api.github.com/users/EdwardRaff/gists{/gist_id}","starred_url":"https://api.github.com/users/EdwardRaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EdwardRaff/subscriptions","organizations_url":"https://api.github.com/users/EdwardRaff/orgs","repos_url":"https://api.github.com/users/EdwardRaff/repos","events_url":"https://api.github.com/users/EdwardRaff/events{/privacy}","received_events_url":"https://api.github.com/users/EdwardRaff/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T03:51:48Z","updated_at":"2016-08-13T03:51:48Z","body":"Hmm, do you really need `Long` as an option? For all but the largest values a double can store them losslessly. JSAT is going to save it as a double in the end anyway. That would simplify your code too. \r\n\r\nHow many use cases would an abstract class for this be helpful for? Is the use case you are imagining where you get datasets at runtime and *don't* know what types of features are in the data in advance? \r\n\r\n"}}
{"actor":{"display_login":"EdwardRaff"}}