O'Reilly logo

R Data Mining by Andrea Cirillo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Model fitting

Let us define the dataset we are going to employ for our modeling activity. We will employ clean_casted_stored_data_validated_complete, removing the default_flag and the customer_code first because it is actually meaningless as an explanatory variable:

clean_casted_stored_data_validated_complete %>% (-default_flag) %>% (-customer_code) -> training_data

And we are ready now to fit our model:

multiple_regression <- lm(as.numeric(default_numeric)~., data= training_data)

You should have already noticed the small point after the ~ token. It actually means that all the available explanatory variables will be fitted against the as.numeric(default_numeric) response variable. Before looking at model assumptions validation, we could go ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required