Package linearregression; import WEKA. classifiers. evaluation; import WEKA. classifiers. functions. linearregression; import WEKA. core. instance; import WEKA. core. instances; import WEKA. core. converters. converterutils. datasource; public class legression {/*** @ Param ARGs * @ throws exception */public static void main (string [] ARGs) throws exception {// todo auto-generated method stubdatasource train_data = new datasource ("E: // train. ARFF "); // read the training data datasource test_data = new datasource (" E: // test. ARFF "); // read the test data instances instrain = train_data.getdataset (); instances instest = test_data.getdataset (); instrain. setclassindex (instrain. numattributes ()-1); // sets the indexinstest of the target in the training set. setclassindex (instest. numattributes ()-1); // set the indexlinearregression LR = new linearregression () of the target test set; // define the type LR of the classifier. buildclassifier (instrain); // training classifier evaluation EVAL = new evaluation (instrain); eval. evaluatemodel (LR, instest); // evaluates the effect of system. out. println (eval. meanabsoluteerror (); // calculate Mae }}