Generating linear regression models

Most of the linear regression modelling follows a general pattern--there will be many independent variables that will collectively produce a result, which is a dependent variable. For instance, we can generate a regression model to predict the price of a house based on different attributes/features of a house (mostly numeric, real values) such as its size in square feet, number of bedrooms, number of washrooms, importance of its location, and so on.

In this recipe, we will use Weka's linear regression classifier to generate a regression model.

How to do it...

  1. In this recipe, the linear regression model we will be creating is based on the cpu.arff dataset, which can be found in the data directory of the Weka installation ...

Get Java Data Science Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.