Data Modelling in Practice
摘要
In practice, when handling data modelling, we start by asking an interesting question, followed by collecting relevant data, preprocessing the data, selecting a model, and communicating the results. These five steps are often viewed as a cyclical process, where we can move forward or backward as needed. In this chapter, we focus on data preprocessing and model selection. We use the Breast Cancer Wisconsin (Diagnostic) dataset provided in scikit-learn. While this dataset is primarily designed for binary classification, we can repurpose it for a regression task by selecting one of the continuous features as the target variable. Here, we consider the mean radius as the dependent variable. Thus, we illustrate data modelling using both regression and classification algorithms. Our primary focus is on model selection and the trade-off between bias and variance, as demonstrated through regression analysis. For classification, we emphasise how performance metrics help interpret and evaluate the model’s results.