Weka Java API - Linear Regression ...

Hi there,

I have been looking at the Java API for Weka, and have been having great difficulty trying to find out how

to pass a CSV file to the regression method. Its seems that there is a method to convert the CSV file to a specific file format called ARFF, which is another text file.

My question is how should the fields of data be arranged, that being many Independent variables for case of Multiple Linear Regression and the one Dependent variable.

Should a row look like this:

x1,x2,x3,x4,x5,Y

Or the reverse

Y,x1,x2,x3,x4,x5

I am asking this because if the only way to get data into the Regression is via this ARFF file structure, then I need to know how to structure the CSV data for it to be transformed properly to ARFF.

This is what I have discovered so far.

BUT, is there a way, a method that takes in like a 2d-array structure as an INPUT to the Regression method of Weka in its java code.

Also once this data is passed in, which methods returns the array of coefficients.

Hope someone can help.

Regards,