## 4 The Application of AWS Machine Learning (AML) for the Surface Finishing Process
### Amazon Web Services Machine Learning--An Example Deburring Data Application
#### 4.4.2 Developing the Machine Learning Model on AML  
There are two processes involved in the development of a machine learning model on AML: (1) the training process and (2) the testing/evaluation process. In the training process, users need to specify the following:  
* The input training data source
* The data attribute that contains the target variable
* The data transformation instructions (recipe)
* The training parameters required to control the learning algorithm  
To start the evaluation process on AML, we require a machine learning model that will be created after the training process. A data source with a scheme similar to that of the training data source must be created before it proceeds to the evaluation. The actual values of the target variable must also be included in the evaluation data source, as AML will compare the actual values with the predicted ones. The general process flow for developing a machine learning model on AML is illustrated in Figure 8.  
Since our aims are to predict the chamfer length based on the features extracted from the three axes of the (X, Y, and Z) vibration signal, a multivariate linear regression is used. It is worth noting that the inputs and output must have a linear relationship for the model to perform effectively. This requirement has been tested for the features and the chamfer length. The full data used for creating the machine  
Figure 8: The process flow for model creation on the Amazon Web Services Machine Learning (AML). Figure 7: An overview of the monitoring system. learning model are presented in Tables 2 and 3. We used 50% of the dataset to train the model and the other 50% to test and evaluate the model. By utilising the framework provided by AML, a regression model was created and evaluated. Two CSV files, one containing the training data and one containing the testing data, were first uploaded onto Amazon S3, which is a cloud-based database developed by AWS. The motivation for using this database was due to the ease through which the data could be access by AML. Following this, we used the AML interface to create an input data source pointing to the training CSV file. The interface automatically assigns a datatype based on the values in the CSV file. The datatype will be assigned as binary, categorical, numeric, or text. Users can change the datatype accordingly if the assigned datatype was incorrect. For our dataset, we assign the numeric datatype to the chamfer length and to the corresponding X-axis, Y-axis, and Z-axis power spectrum density magnitude values. The pass is assigned as a categorical datatype. Subsequently, the interface will request the user to select the target variable. Based on the datatype of the selected target variable, the interface will decide on the type of algorithm to use to train the model. If a numeric datatype was selected, the linear regression algorithm is used; if a categorical datatype was selected, the multinomial logistic regression algorithm is used; and if a binary datatype was selected, the logistic regression algorithm is used. Table 4 gives the associations between the machine learning models and the target variable datatypes. In our case, as the target variable--i.e., the chamfer length--is a numeric datatype, the AML client automatically assigns the linear regression algorithm for the model. The AML client allows users to use the default recipe or to code their own recipe, which sets the parameters for the machine learning training process. The default recipe provided by AML will split the data source in two, 70% of the data source being used for the training set and the remaining 30% being used to evaluate the machine learning model performance, as shown in Figure 9. \begin{table}
\begin{tabular}{c c} \hline \hline
**Target Variable Datatype** & **Machine Learning Model** \\ \hline Binary & Logistic regression \\ Categorical & Multinomial logistic regression \\ Numeric & Linear regression \\ \hline \hline \end{tabular}
\end{table}