<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David TA on Medium]]></title>
        <description><![CDATA[Stories by David TA on Medium]]></description>
        <link>https://medium.com/@davidtafr?source=rss-5080085e5a8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*I5V4IvUO6nvNxV22-FlO4w.png</url>
            <title>Stories by David TA on Medium</title>
            <link>https://medium.com/@davidtafr?source=rss-5080085e5a8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:28:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davidtafr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to create Machine Learning models in 5 seconds ?]]></title>
            <link>https://davidtafr.medium.com/how-to-create-machine-learning-models-in-5-seconds-f7570bb189e2?source=rss-5080085e5a8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7570bb189e2</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[small-data]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[scikit-learn]]></category>
            <category><![CDATA[automl]]></category>
            <dc:creator><![CDATA[David TA]]></dc:creator>
            <pubDate>Tue, 18 May 2021 12:50:21 GMT</pubDate>
            <atom:updated>2021-05-18T12:50:21.895Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to create Machine Learning models in 5 seconds ?</h3><h4>The ultimate Jupyter Notebooks for quick models generation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hDVxc2VpxJsmjBAh9zUjRA.jpeg" /><figcaption>Machine Learning just easy as a vending machine ? <a href="https://www.pexels.com/fr-fr/@apasaric">Aleksandar Pasaric</a> from Pexels</figcaption></figure><p>When I decided to follow a new career path in Data Sciences, my first job as an intern in consultancy was to evaluate datasets to create use cases. As this task was a bit repetitive, my first thought was to create a Notebook with the ability to <strong>quickly generate machine learning models and evaluate them using the important relevant metrics</strong>.</p><p>Thanks to libraries such as <a href="https://scikit-learn.org/stable/">Scikit-learn</a>, with just a little knowledge in coding you can create machine learning models with a few lines of code !</p><p>Of course, the reality of everyday data scientist work is different — I will explain why at the end of this article !</p><p>Okay ! Let’s start creating our models :</p><p>My advice is to use the distribution platform, <a href="https://www.anaconda.com/">Anaconda</a>. It is really easy to install on Windows or Mac, and it will provide you with everything you need to create machine learning models. Once Anaconda is installed, you can launch “JupyterLab”, or the web-based version, “Notebook”.<br>If you want an alternative solution with no installation required, you can use <a href="https://colab.research.google.com/">Google Colab</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUAhWtt4xlzN3PDmuaiNkw.png" /><figcaption><a href="https://www.anaconda.com/">Anaconda, The World’s Most Popular Data Science Platform</a></figcaption></figure><p>Then, you can visit my <a href="https://github.com/DavidTa12/Jupyter">Github</a> repository and download the 2 Notebooks. Classifications and Regressions :</p><h3>1. Classifications</h3><p>My <a href="https://github.com/DavidTa12/Jupyter/blob/main/1%20Classifications%20-%20The%20Ultimate%20Notebook.ipynb">first Notebook</a> will allow you to create classification models.<br>The first step is to run the “Imports” cell in order to load all of the libraries I use in my Notebooks :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02fcdd9ab2603c1038d163c59ca6caff/href">https://medium.com/media/02fcdd9ab2603c1038d163c59ca6caff/href</a></iframe><p>If you are missing a library, just use :</p><pre>conda install + the name of the missing library</pre><pre>or :</pre><pre>pip install + the name of the missing library</pre><p>Now we can create our first model. You have to import the dataset — it can be a .csv or .xlsx (use pd.read_xcel if you use an Excel file).<br>Replace the multiclass.csv with the name of your .csv. Use the complete path to your file if it is in another folder.<br>If your .csv uses “;” as a separator, just change sep=”;”.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34d9e55fdacb4665898592ba01f9fc10/href">https://medium.com/media/34d9e55fdacb4665898592ba01f9fc10/href</a></iframe><p><strong>A) Classification with auto-sklearn</strong></p><p>auto-sklearn is an automated machine learning tool that is very powerful in creating models by using the best algorithm(s), hyperparameters, and some data preprocessing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fiX0RbbyEBJWIG0QmCaVg.png" /><figcaption>A powerful auto machine learning tool</figcaption></figure><p>Some important parameters you have to define before using auto-sklearn :</p><p><strong>time_left_for_this_task</strong> : defined at 3600 secs by default — this means you let auto-sklearn work for one hour finding the best model. (Lower this value if you are in a rush, or increase it if you want to spend more time finding the best model possible)<br><strong>ensemble_size</strong> : define at 1 if you only want to use one algorithm in your model, or leave at 50 (default value) if you want to use several algorithms (ensemble models).<br><strong>metric</strong> : this allows you to define which metric the model should focus on improving. To see all available metrics, <a href="https://automl.github.io/auto-sklearn/master/api.html#built-in-metrics">click here</a>.</p><p>To use auto-sklearn, you have to define your target :<br>y = df[‘fetal_health’] and remplace “fetal_heath” by the target of your own dataset.<br>Same for X, you have to drop the target :<br>X = df.drop(“fetal_health”, axis=1).</p><p><strong>B) Classification Algorithms</strong></p><p>If you do not have a lot of time, or do not want to use auto-sklearn, you may use the cells below that can create models with <strong>Logistic Regression, K-NN, Random Forrest, or Gradient Boosting</strong> algorithms. The goal of my Notebook is to quickly evaluate the models with the important metrics in classification : <strong>Accuracy, Precision, Recall, F1, MCC, Kappa and the Confusion Matrix</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPkDMEezUKgO9_v_9KxdJw.jpeg" /></figure><h3>2. Regressions</h3><p>My second Notebook for regressions works the same way as for classifications. The only difference is that you have distribution graphs: a depiction of <strong>actual vs predicted, and a histogram of errors</strong>.<br>The important regressions metrics used are : <strong>R², MAE, MAPE, MSE, RMSE and Max Error</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHEfawG3gfua-pcAKyJ4VQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p6TTvxQGLbUEQFvwBT5WgA.jpeg" /></figure><h4>What do I use these 2 Notebooks for ?</h4><p>I use them to test my customers’ datasets: based on the results, <strong>I immediately know if I will need to conduct important preprocessing and data engineering work or not</strong>.</p><p>Thanks to auto machine learning tools, we do not need to spend time on optimizing hyperparameters anymore.<br>Today, <strong>data scientist work is mainly about preprocessing and data engineering</strong> in order to obtain better models (stay tuned — I will write an article about it soon !)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*dHS26L8kOWEcAszhVbw-Uw.png" /><figcaption>Understanding the data you are working on is crucial !</figcaption></figure><p>Nowadays, more and more companies use data science platforms to allow their employees to generate machine learning models without any coding knowledge. Many people manipulate data everyday in their jobs, but not all of them use machine learning to streamline their working process. This is the reason why I joined <a href="https://www.mydatamodels.com/">MyDataModels</a>: to try and democratize ML tools that can help people to create value more quickly and efficiently.</p><p>Feel free to comment on this article to ask me any questions about data science — you can also reach me on <a href="https://www.linkedin.com/in/davidta12/">Linkedin</a> ! Many other useful articles are coming your way : stay tuned 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7570bb189e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>