What are the steps involved in building machine learning models?
Any machine learning model development can broadly be divided into six steps

- Problem definition involves converting a Business Problem to a machine learning problem
- Hypothesis generation is the process of creating a possible business hypothesis and potential features for the model
- Data Collection requires you to collect the data for testing your hypothesis and building the model
- Data Exploration and cleaning helps you remove outliers, missing values and then transform the data into the required format
- Modeling is where you actually build the machine learning models
- Once built, you will deploy the models
Step 1: Collect Data
Given the problem you want to solve, you will have to investigate and obtain data that you will use to feed your machine. The quality and quantity of information you get are very important since it will directly impact how well or badly your model will work. You may have the information in an existing database or you must create it from scratch. If it is a small project you can create a spreadsheet that will later be easily exported as a CSV file.
Step 2: Prepare the data
This is a good time to visualize your data and check if there are correlations between the different characteristics that we obtained. It will be necessary to make a selection of characteristics since the ones you choose will directly impact the execution times and the results. You can also reduce dimensions by applying PCA if necessary.
You must also separate the data into two groups: one for training and the other for model evaluation which can be divided approximately in a ratio of 80/20 but it can vary depending on the case and the volume of data we have.
Step 3: Choose the model
There are several models that you can choose according to the objective that you might have: you will use algorithms of classification, prediction, linear regression, clustering, i.e. k-means or K-Nearest Neighbor, Deep Learning, i.e Neural Networks, Bayesian, etc
Step 4: Train your machine model
You will need to train the datasets to run smoothly and see an incremental improvement in the prediction rate. Remember to initialize the weights of your model randomly -the weights are the values that multiply or affect the relationships between the inputs and outputs- which will be automatically adjusted by the selected algorithm the more you train them.
Step 6: Parameter Tuning
If during the evaluation you did not obtain good predictions and your precision is not the minimum desired, it is possible that you have overfitting -or underfitting problems and you must return to the training step before making a new configuration of parameters in your model. You can increase the number of times you iterate your training data- termed epochs. Another important parameter is the one known as the “learning rate”, which is usually a value that multiplies the gradient to gradually bring it closer to the global -or local- minimum to minimize the cost of the function.
Increasing your values by 0.1 units from 0.001 is not the same as this can significantly affect the model execution time. You can also indicate the maximum error allowed for your model. You can go from taking a few minutes to hours, and even days, to train your machine. These parameters are often called Hyperparameters. This “tuning” is still more of an art than a science and will improve as you experiment.
Step 7: Prediction or Inference
You are now ready to use your Machine Learning model inferring results in real-life scenarios.
Comments
Post a Comment