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 ...

Get R Data Mining 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.