1
votes

I have converted an excel file to csv and opened the csv file on WEKA to classify the data using linear regression but it doesn't allow me to select 'linear regression' option under the 'function' branch. This is my format

@RELATION   book                

@ATTRIBUTE  bookID  STRING          
@ATTRIBUTE  author  STRING          
@ATTRIBUTE  genre   STRING          
@ATTRIBUTE  publisher   STRING          
@ATTRIBUTE  yearPublished   NUMERIC         
@ATTRIBUTE  rating  NUMERIC         

@DATA                   
book1,  suzzane-collins,    horror, scholastic, 2008,   4011425
book2,  jay-rowling,    fantasy,    scholastic, 2004,   1560433
book3,  harper-lee, comedy, harper-classics,    2006,   2708232
book4,  jane-austen,    romance,    modern-library, 2008,   1560433
book5,  stephenie-meyer,    romance,    little-brown,   2006,   40114255
book6,  john-lewis, thriller,   harper-collins, 2002,   352728
book7,  margarte,   mystery,    grand-central,  1964,   780522
book8,  George-orwell,  humour, nal,    2003,   1679178
book9,  markus-zusak,   legend, grand-central,  2006,   780522
book10, shel-silverstein,   folklore,   harper-collins, 1964,   592994
1
Did you solve your problem? - randombee

1 Answers

1
votes

For linear regression, your attributes have to be @NUMERIC. If you want to do the regression based only on the last two attributes, then you will have to specify that (by checking those attributes) in the "Preprocess" tab in Weka so that it only uses the right ones. You can check this example to see what you are doing wrong. They explain how to run basic linear regression in WEKA from scratch.