Complete Your First Machine Learning Project in 10 Steps
By: Faiz Fablillah
Tags: Machine Learning, Machine Learning Projects, Data Science, Towards Data Science, Predictive Analytics

Complete Your First Machine Learning Project in 10 Steps

You will never go wrong with it

About a year ago, when I started telling people that I have completed core subjects with one of them being a Machine Learning (ML) course for a master’s degree, many became curious about the subject. Some asked what got me started, and some just wanted my general advice. The most common request of advice I get is how to get into learning about ML?

Photo by Tanguy Sauvin on Unsplash

My reply to this question is to pick up a simple ML problem and solve them. You will learn faster and better this way. But then I realized that I never really showed them the way to manage these projects. I might roughly discuss it over our informal conversations, but I never had a chance to write them down.

That is why I write this post. Here, I am going to explain how to complete your first ML project in 10 steps.

If you are a beginner and before you get started on your first ML project, you may want to continue reading the rest of this article. Enjoy.

1. Purpose of Machine Learning Project

The first question you need to answer is, is your ML project a one-time effort or an ongoing procedure? If it is a one-time model building effort & the rest is just the effort to manage models’ performance, then you can roughly plan the time you need to complete it. The best project is the project with a clear use case. That is why, after defining the purpose, you may want to be clear on who will use the results and how useful they will be. Just like any project, without the understanding of how to consume the output, your ML project will end as incomplete. In practice, the results are used for different kinds of analysis, including making predictions for production planning, finding a loophole in products or customer sentiments about the product, or simply getting to know your data better.

2. Gathering Data

Many get excited when they hear ideas about how ML can solve their problems but little did they know ML is just the engine and the real fuel is the data. Gathering data is the most critical aspect of the project as the value and size of the collected data will later determine the performance of our ML models. Ask your company if they will allow you to use the data you deal with every day at work. If they say no, you can still find data from open source platforms on the internet like in Kaggle or Github platforms.

Photo by Lukasz Szmigiel on Unsplash

3. Preprocessing of Data

Every ML model has a different type of output, depending upon data requirements. And every model needs a different type of data. Some models require numerical data, or some need textual data. For example, a particular algorithm needs numeric features, and some require splitting text into words, which can create complications for languages like Mandarin.

When we gather data, they have issues like typing errors, spelling mistakes, duplications, and missing values. The possible dissimilarities of missing values are (‘None’, ‘NA’, ‘NaN’, ‘’, ‘?’). You can deal with missing data by these two methods.

Numerical NANs means you calculate missing data with Mode, Mean, and Median e.g., If you have numerical data, you should go with the mean. If you are working with the clustering problem and you face outliers, try Median.

Categorical NANs means to replace the data with the most frequent values.

4. Feature Engineering

Feature engineering is also known as dimension reduction. This is a process of altering the data for a better performance of the ML model. It is a time taking task and you may need domain knowledge to do this. So, my advice is to pick a project in your domain or subjects you are familiar with. Removing unnecessary features and adding some features upon domain knowledge may also be part of this step.

5. Machine learning Category Selection

According to a book named as “Understanding Machine Learning” by Cambridge Press, there are three types of categories at the root level, as follow:

a) Supervised Learning

b) Unsupervised Learning

c) Reinforcement Learning

a) Supervised learning includes classification and regressing. Classification refers to fraud detection, image classification, spam, and diagnostics systems. Regressing endorses risk assessment and score predictions.

b) Unsupervised learning solves clustering problems like city development or target marketing.

c) Reinforcement learning helps to forecast output like robot navigation or inventory management

Previously, you have identified the purpose of your project. Now it is the time for you to determine the category of your ML task at hands based on the above.

6. Data Slicing

This is when you are performing a supervised ML project. From the same set of data, you will need to divide them into training, validating, and testing. Different data requires a different split ratio. The training data is primary data that is used for training the model and data validation to verify the model skill. The validating data check model parameter and verify model skill. Test data runs on the real data and calculate the output.

7. Adopting ML Technique(s)

There are thousands of methods available to be picked, and they are all great, but find a suitable model that fits with your data to produce the best results. There are already some established guidelines to help you choose what models work for you. Just to give you some examples, if your project deals with a prediction or forecast of continuous values, you may want to adopt Linear Regression or Neural Network. If you are working on a project that deals with multi-class classification, perhaps the Random Forest model is the best choice. You get the drill.

Photo by Diane Alkier on Unsplash

8. Parameters Tuning

Enhancement in your train data can be possible by tuning in the parameters. In complex models, initial conditions are more critical. These conditions or settings are called hyper-parameters. Hyper-parameter tuning will assist in updating and in the learning process of the parameters during training. These settings such as random search or grid search will ensure you to produce better results.

9. Results Interpretation

Does the output give us what we want? The answer is that we can analyze the output in the form of performance measures like accuracy, precision and recall. These measures will help us realize the root cause of our models’ failure or success. Once this is done, the model is ready to deploy.

10. Quick Deployment

The data scientist team can build a predictive model but mostly it is to be used by the end-users. Quick and easy development is necessary to make the model easy-to-use in corporate environment includes the Machine Learning model itself, Application Program Interface (APIs) and how you visualize the prediction output. We can say that all the processing will be done on the backend. It is the backend server that receives a request from a client in the form of JSON. Subsequently, this input sends a request to the model for processing and end up with the TensorflowJS that executes on a web browser.