Classification vs Approximation – which one to opt for?
Amongst the several decisions you’ll have to make when developing predictive models is if your business issue is an approximation or a classification task. It’s a critical decision as it determines which categorization of methods you opt for to develop a model: approximation (regression tree, linear regression), classification (decision trees, Naïve Bayes).
This brief blog by AICoreSpot will enable you to make the correct decision.
When to leverage classification?
Classification functions by seeking specific patterns in similar observations from history and then attempts to identify the ones which consistently correlate with coming from a specific category. If, for instance, we desire to forecast observations:
- Is a specific email spam? Example classifications: “Not spam” and “Spam”
- Will a specific client purchase a product if offered? Example classifications: “No” and “Yes”
- What kind of success will a specific investment have? Example classifications: “Less than 10%”, “10-20%”, “Over 20%”
How does classification function?
Classification functions by seeking specific patterns in similar observations from history and then attempts to identify the ones which consistently correlate with coming from a specific category.
- With researched variable y with 2 categorical values encoded red and blue. White dots are not known – they could belong to either the red or blue categories.
- Leveraging two numeric variables x2 and x1 which are indicated on vertical and horizontal axes. As observed above, an algorithm was leveraged which calculated a functionality indicated by the black line. A majority of the blue dots are under the line and a majority of the red dots are above the line. This guess is not always precise, but the error is minimized, only 11 dots are misclassified.
- We can forecast that empty white dots above the black line are actually red and those below the black line are blue. If new dots, for instance future observations prop up, we can estimate their colour also.
Obviously, this is a really simplistic instance and there can be more complex patterns to seek amongst several hundreds of variables, all of which cannot be denoted graphically.
When to leverage Approximation?
Approximation is leveraged when we desire to forecast the probable value of the numeric variable for a specific observation. An instance would be:
- How much cash will my client spend on a specific product annually?
- What will the market price of houses be?
- How frequently will production machines face issues on a monthly basis?
How does approximation function?
Approximation seeks specific patterns in similar observations from history and attempts to identify how they influence the value of a researched variable. If for instance, we desire to forecast observations:
- With numerical variable y that we wish to forecast.
- With numeric variable x1 carrying value that we wish to leverage to forecast the initial variable.
- With categorical variable x2 with two classifications: right and left that we wish to leverage to forecast the initial variable.
- Blue circles are indicative of known observations with known x2, x1, y.
- As we can’t plot the three variables on a 2d plot, we divide them into two 2d plots. The left lying plot demonstrates how the combo of variables x2 and x1=left is related to the variable y. The second demonstrates how to combo of variables x2 and x1=right is related to the variable y.
- The black line indicates how our model forecasts the connection between x1 and y for the two variations of x2. We input orange circles in the correct place on the black line to obtain forecasted values for specific observations. Their distribution is like the blue circles.
- As can overtly be observed, distribution and overt pattern of relationship between x1 and y is differing for the two categories of x2.
- When a new observation crops up, with known x2 and x1, we will have the capability to undertake new forecasting.
Even if your target variable is numerical, at times its better to leverage classification methods over approximation. For example, if you have primarily zero target values and only a few non-zero values, modify the latter to one, in this scenario you’ll have two classifications: 1 (+ve value of the target variable) and 0. You can also divide the numerical value into several subgroups, prices of flats in high, medium, and low by the equal subset width, and forecast them leveraging classification algorithms. This procedure is referred to as discretization.