The basic task of machine learning is to convert numerical data into classified data. For example, if you have a dataset with a person's height (in inches), such as 59.5, 64.0, and 75.5, you might want to convert this numeric data to classified data, such as 0, 1, and 2, to indicate low, medium, and high. This process is sometimes commonly known as "data boxing." In machine learning literature, this process is often referred to as "discretization of continuous data".
You may need to scatter data in the following situations. Many machine learning algorithms (such as Naive Bayes Classification and prediction) apply only to categorical data. Therefore, if your raw data is numeric data and you want to apply Naive Bayes, you must scatter the data. You can also mix numeric data with classified data, such as data that is often found in an Excel spreadsheet. Because only a handful of machine learning algorithms apply to mixed data, you can convert numeric data to classified data and then use machine learning algorithms that apply to categorical data. For example, the classification utility can be used for data clustering analysis.
Perhaps due to the lack of attractiveness of this topic, there are very few available resources to accurately describe how to implement discretization algorithms. In this article, I'll introduce a powerful discretization algorithm. Although these ideas are not up to date, the implementation described in this article has not been published before, as far as I know.
The best way to understand the view in this article is to look at the demo shown in Figure 1. The demo sets 20 data points to indicate the height of the person in inches. The histogram in Figure 2 shows the original data. The demo analyzes the data and creates a Discretizer object, and then displays an internal representation of the object. The Discretizer retains a copy of the different values from the original data in the sorted (from low to High) array named "." The calculated number of categories is 3 and is stored in the member variable K.
Figure 1 Converting numeric data to classified data
Figure 2 Raw data to be sorted