The 7 Key Steps To Build Your Machine Learning Model

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. It is also common to use the web scraping technique to automatically collect information from various sources such as APIs.

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.

Additionally, you must balance the amount of data we have for each result -class- so that it is significant as the learning may be biased towards a type of response and when your model tries to generalize knowledge it will fail.

ou 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.

At this stage, you can also pre-process your data by normalizing, eliminating duplicates, and making error corrections.

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 regressionclustering, i.e. k-means or K-Nearest Neighbor, Deep Learning, i.e Neural Networks, Bayesian, etc.

There are various models to be used depending on the data you are going to process such as images, sound, text, and numerical values. In the following table, we will see some models and their applications that you can apply in your projects:

Model Applications
Logistic Regression Price prediction
Fully connected networks Classification
Convolutional Neural Networks Image processing
Recurrent Neural Networks Voice recognition
Random Forest Fraud Detection
Reinforcement Learning Learning by trial and error
Generative Models Image creation
K-means Segmentation
k-Nearest Neighbors Recommendation systems
Bayesian Classifiers Spam and noise filtering

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 5: Evaluation

You will have to check the machine created against your evaluation data set that contains inputs that the model does not know and verify the precision of your already trained model. If the accuracy is less than or equal to 50%, that model will not be useful since it would be like tossing a coin to make decisions. If you reach 90% or more, you can have good confidence in the results that the model gives you.

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. There are usually many parameters to adjust and when combined they can trigger all your options. Each algorithm has its own parameters to adjust. To name a few more, in Artificial Neural Networks (ANNs) you must define in its architecture the number of hidden layers it will have and gradually test with more or less and with how many neurons each layer. This will be a work of great effort and patience to give good results.

Step 7: Prediction or Inference

You are now ready to use your Machine Learning model inferring results in real-life scenarios.


Original post:

54 comentários em “The 7 Key Steps To Build Your Machine Learning Model

  1. I am the co-founder of JustCBD brand ( and I’m presently aiming to expand my wholesale side of company. I really hope that someone at targetdomain give me some advice ! I thought that the best way to do this would be to connect to vape companies and cbd retailers. I was hoping if anybody could suggest a qualified web-site where I can get Vape Shop B2B Database with Email Addresses I am currently looking at, and On the fence which one would be the most suitable choice and would appreciate any support on this. Or would it be simpler for me to scrape my own leads? Suggestions?

  2. I am the owner of JustCBD brand ( and I’m presently aiming to expand my wholesale side of company. I am hoping someone at targetdomain is able to provide some guidance ! I considered that the most effective way to accomplish this would be to reach out to vape shops and cbd retail stores. I was really hoping if someone could suggest a qualified site where I can buy Vape Shop B2B Data I am presently checking out, and Not exactly sure which one would be the most ideal option and would appreciate any assistance on this. Or would it be easier for me to scrape my own leads? Suggestions?

  3. An outstanding share! I’ve just forwarded this onto a coworker who has been conducting a little research on this. And he in fact ordered me lunch due to the fact that I found it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanx for spending time to talk about this issue here on your website.

  4. I really love your blog.. Great colors & theme. Did you create this site yourself? Please reply back as I’m attempting to create my own personal website and would like to find out where you got this from or just what the theme is named. Cheers!

  5. Howdy! This article could not be written any better! Going through this article reminds me of my previous roommate! He continually kept preaching about this. I most certainly will send this post to him. Pretty sure he’s going to have a good read. Thank you for sharing!

  6. After looking over a handful of the articles on your site, I truly appreciate your technique of blogging. I book marked it to my bookmark site list and will be checking back in the near future. Please check out my web site too and let me know what you think.

  7. Hello! This is my first comment here so I just wanted
    to give a quick shout out and tell you I genuinely enjoy reading through your articles.
    Can you suggest any other blogs/websites/forums that deal with the same topics?

    Thanks a ton!

  8. Hi, I do believe this is a great site. I stumbledupon it 😉
    I’m going to revisit yet again since i have saved as a favorite it.
    Money and freedom is the best way to change, may you be rich and continue to help others.

  9. I know this if off topic but I’m looking into starting my own blog and
    was curious what all is needed to get set up?

    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very internet smart so I’m not 100% sure.
    Any tips or advice would be greatly appreciated. Thanks adreamoftrains web hosting

  10. Howdy! I know this is kind of off topic but I was
    wondering which blog platform are you using for this website?
    I’m getting sick and tired of WordPress because I’ve had problems
    with hackers and I’m looking at options for another platform.
    I would be awesome if you could point me in the direction of
    a good platform.

  11. Hi there! I could have sworn I’ve been to this blog before but after looking at a few of the posts I realized it’s new to me. Anyways, I’m definitely pleased I found it and I’ll be bookmarking it and checking back often!

  12. Achieving your fitness goal does not need a certified personal trainer or an expensive gym membership, especially when you have the budget and the space to consider practically every workout machine on the market.

  13. Good day I am so glad I found your web site, I really found you
    by accident, while I was browsing on Yahoo for something else, Nonetheless I am here now and would just like
    to say thanks for a fantastic post and a all round exciting blog (I also love the theme/design), I
    don’t have time to read through it all at the minute but
    I have bookmarked it and also added in your RSS feeds, so when I have time I will be back to
    read a lot more, Please do keep up the awesome jo. 3gqLYTc
    cheap flights

  14. I must thank you for the efforts you’ve put in writing this website. I am hoping to check out the same high-grade content by you later on as well. In truth, your creative writing abilities has inspired me to get my very own site now 😉

  15. Hey! I’m at work browsing your blog from my new apple iphone!
    Just wanted to say I love reading through your
    blog and look forward to all your posts! Carry on the superb work!

  16. Hello there! I just wish to give you a huge thumbs up for the great information you have right here on this post. I will be returning to your site for more soon.

  17. I’ve been exploring for a bit for any high-quality articles or weblog posts
    in this sort of area . Exploring in Yahoo I at last stumbled upon this web site.
    Reading this info So i’m glad to exhibit that I’ve
    an incredibly just right uncanny feeling I discovered just what I needed.
    I most indisputably will make certain to don?t forget
    this site and give it a look on a relentless basis.

  18. I am curious to find out what blog system you have been utilizing?
    I’m having some small security problems with my latest website and I’d
    like to find something more safeguarded. Do you have any suggestions?

  19. Howdy! I simply would like to give you a huge thumbs up for the excellent information you have got right here on this post. I will be returning to your site for more soon.

  20. I have to thank you for the efforts you have put in penning this website. I really hope to view the same high-grade blog posts by you in the future as well. In truth, your creative writing abilities has inspired me to get my own site now 😉

  21. I’m pretty pleased to uncover this site. I want to to thank you for your time for this particularly wonderful read!! I definitely savored every bit of it and I have you book-marked to look at new information on your site.

  22. You have made some decent points there. I checked on the net for additional information about the issue and found most people will go along with your views on this website.

  23. Good post. I learn something totally new and challenging on websites I stumbleupon every day. It’s always interesting to read articles from other authors and practice a little something from other sites.

  24. I blog quite often and I seriously thank you for your information. The article has truly peaked my interest. I am going to book mark your site and keep checking for new details about once a week. I opted in for your Feed too.

  25. I’m amazed, I must say. Rarely do I encounter a blog that’s both educative and entertaining, and without a doubt, you have hit the nail on the head. The problem is something that too few men and women are speaking intelligently about. I’m very happy that I found this during my hunt for something relating to this.

Leave a Reply

Your email address will not be published. Required fields are marked *