<?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 Justus Ilemobayo on Medium]]></title>
        <description><![CDATA[Stories by Justus Ilemobayo on Medium]]></description>
        <link>https://medium.com/@justusilemobayo?source=rss-c637be2310be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-C-MvKg-chk4DcmUQfq3Sw.jpeg</url>
            <title>Stories by Justus Ilemobayo on Medium</title>
            <link>https://medium.com/@justusilemobayo?source=rss-c637be2310be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:26:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@justusilemobayo/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[Leveraging AWS SageMaker for Machine Learning:]]></title>
            <link>https://justusilemobayo.medium.com/leveraging-aws-sagemaker-for-machine-learning-87f5606d8eb2?source=rss-c637be2310be------2</link>
            <guid isPermaLink="false">https://medium.com/p/87f5606d8eb2</guid>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[aws-sagemaker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Justus Ilemobayo]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 08:37:21 GMT</pubDate>
            <atom:updated>2023-07-13T08:37:21.597Z</atom:updated>
            <content:encoded><![CDATA[<h3>Leveraging AWS SageMaker for Machine Learning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*VjC45w8KBslQFEDK.jpeg" /></figure><p>AWS SageMaker is a powerful cloud-based machine learning service that enables developers and data scientists to build, train, and deploy machine learning models at scale. It provides a comprehensive set of tools and resources that simplify the end-to-end process of developing and operationalizing machine learning applications. In this article, we will explore the capabilities of AWS SageMaker and discuss how it can be leveraged to streamline the development and deployment of machine learning models.</p><ol><li>Building and Training Models: AWS SageMaker offers a range of features to simplify the model development process. It provides a Jupyter notebook interface for interactive development, allowing data scientists to experiment with different algorithms and frameworks. The platform also supports popular machine learning frameworks such as TensorFlow, PyTorch, and Apache MXNet, enabling developers to leverage their preferred tools.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xw96J5pU-QLMmFi8.jpg" /></figure><p>SageMaker provides built-in algorithms for common tasks like image classification, regression, and anomaly detection. These algorithms are highly optimized and can be easily integrated into the development pipeline. Additionally, SageMaker allows users to bring their own algorithms, providing flexibility for custom model development.</p><p>2. Data Preparation and Management: Data preprocessing and feature engineering are critical steps in machine learning. AWS SageMaker provides data scientists with a set of tools for data preparation, including data cleaning, transformation, and feature extraction. It also supports distributed data processing frameworks like Apache Spark, enabling efficient handling of large datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*87gQbl9n0aslwYki.jpg" /></figure><p>SageMaker integrates with various AWS services for data storage and management. It can seamlessly access data from Amazon S3, Amazon Redshift, and Amazon Athena, among others. This integration simplifies the process of loading and preprocessing data, making it readily available for model training.</p><p>3. Scalable Training and Hyperparameter Tuning: Training machine learning models often requires significant computational resources. SageMaker addresses this challenge by providing scalable training capabilities. It can automatically provision and manage the required compute instances, allowing developers to train models on large datasets without worrying about infrastructure management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1lkuKVwRXj61LvTe.png" /></figure><p>Hyperparameter tuning is an important aspect of model development, as it involves finding the optimal values for model parameters. SageMaker offers an automated hyperparameter tuning feature that efficiently explores the hyperparameter space and identifies the best configurations for model performance. This greatly simplifies the process of tuning models and improves the efficiency of the development workflow.</p><p>4. Model Deployment and Management: Once a model is trained, deploying it into production is made easy with AWS SageMaker. The platform supports various deployment options, including hosting models as scalable endpoints or packaging them for deployment on edge devices. This flexibility enables developers to deploy models in a way that best suits their application requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8j4aucCJseTHBeIA.png" /></figure><p>SageMaker provides built-in model monitoring and logging capabilities, allowing users to track model performance and detect any anomalies. It also supports A/B testing and can automatically roll back to a previous model version if necessary. These features help ensure the reliability and stability of deployed models.</p><p>5. Continuous Integration and Deployment: AWS SageMaker integrates seamlessly with other AWS services, enabling continuous integration and deployment (CI/CD) pipelines. Developers can leverage AWS CodePipeline and AWS CodeCommit to automate the end-to-end machine learning workflow, from code changes to model deployment. This integration promotes collaboration, reproducibility, and agility in the development process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*9nplZYvDJblu88CU.png" /></figure><h4>Conclusion</h4><p>AWS SageMaker offers a comprehensive set of tools and services that streamline the development and deployment of machine learning models. By leveraging SageMaker, developers and data scientists can focus on the core aspects of model development, while leaving the infrastructure management and scalability challenges to the platform. Whether it’s building, training, deploying, or managing machine learning models, AWS SageMaker provides a robust and efficient environment for practitioners to harness the power of machine learning at scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87f5606d8eb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Diverse Services and Products of AWS]]></title>
            <link>https://justusilemobayo.medium.com/exploring-the-diverse-services-and-products-of-aws-71a605335c08?source=rss-c637be2310be------2</link>
            <guid isPermaLink="false">https://medium.com/p/71a605335c08</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Justus Ilemobayo]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 07:39:07 GMT</pubDate>
            <atom:updated>2023-07-13T07:39:07.567Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pTHi5wmAkVEn3bm9.png" /></figure><p>Amazon Web Services (AWS) is a comprehensive cloud computing platform that offers a wide range of services and products to meet the evolving needs of businesses and individuals. From computing power and storage to databases, analytics, and machine learning, AWS provides a versatile suite of tools that empower organizations to innovate, scale, and optimize their operations. In this article, we will explore some of the key services and products offered by AWS and their applications across industries.</p><ol><li>Amazon EC2 (Elastic Compute Cloud): Amazon EC2 provides scalable virtual servers in the cloud, allowing users to quickly provision computing resources as needed. It enables businesses to deploy applications, run batch-processing workloads, and handle web traffic efficiently. With EC2, users can choose from a variety of instance types, such as general-purpose, memory-optimized, and GPU instances, to match their specific requirements.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*gm4MqshD8Jn5LY1k.jpg" /></figure><p>2. Amazon S3 (Simple Storage Service): Amazon S3 offers highly scalable and durable object storage for various data types, including documents, images, videos, and backups. It provides secure storage options and allows users to retrieve data quickly and reliably from anywhere. S3 is widely used for website hosting, data archiving, content distribution, and backup and restore operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*lSiFA9kxfmvh8chJ" /></figure><p>3. AWS Lambda: AWS Lambda is a serverless computing service that enables users to run code without provisioning or managing servers. It allows developers to focus on writing code while AWS handles the infrastructure management. Lambda is ideal for building event-driven applications, data processing pipelines, and microservices architectures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N_5Af3U__Zt8eMoM.png" /></figure><p>4. Amazon RDS (Relational Database Service): Amazon RDS simplifies the management of relational databases by automating time-consuming administrative tasks such as backups, software patching, and scaling. It supports popular database engines like MySQL, PostgreSQL, Oracle, and SQL Server. RDS provides high availability, fault tolerance, and automatic scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*FG48HWR1zoNItHuP" /></figure><p>5. Amazon Redshift: Amazon Redshift is a fully managed data warehousing service designed for high-performance analysis of large datasets. It allows organizations to store and query vast amounts of structured and semi-structured data using SQL-based queries. Redshift integrates with popular business intelligence and analytics tools, enabling users to gain insights from their data efficiently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g8Br17wfWo6iEzuG.jpg" /></figure><p>6. AWS Glue: AWS Glue is a fully managed extract, transform, and load (ETL) service that makes it easy to prepare and transform data for analysis. It automates the process of discovering, cataloging, and cleaning data, enabling organizations to derive meaningful insights from diverse data sources. Glue seamlessly integrates with other AWS services, such as S3, Redshift, and Athena, and supports popular data formats, including JSON, CSV, and Parquet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/0*mBYtPxRg2yU03wtj" /></figure><p>7. Amazon SageMaker: Amazon SageMaker is a fully managed machine learning service that empowers data scientists and developers to build, train, and deploy machine learning models at scale. It provides a comprehensive set of tools and resources for the entire machine learning workflow, from data preprocessing and model training to model deployment and monitoring. SageMaker supports popular frameworks like TensorFlow and PyTorch and offers built-in algorithms for common use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JUP8prm9YR3XJIiU" /></figure><h4><strong>Conclusion</strong></h4><p>Amazon Web Services offers a vast array of services and products that cater to diverse computing and data-related needs. From foundational infrastructure services like EC2 and S3 to advanced analytics and machine learning offerings such as Redshift and SageMaker. AWS provides a scalable and cost-effective platform for organizations to innovate, optimize operations, and accelerate growth. By leveraging AWS services, businesses can focus on their core competencies while benefiting from the reliability, security, and flexibility that the AWS ecosystem provides.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71a605335c08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Collaborating with Git and GitHub]]></title>
            <link>https://justusilemobayo.medium.com/collaborating-with-git-and-github-311d9769a88c?source=rss-c637be2310be------2</link>
            <guid isPermaLink="false">https://medium.com/p/311d9769a88c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Justus Ilemobayo]]></dc:creator>
            <pubDate>Fri, 08 Jan 2021 10:15:13 GMT</pubDate>
            <atom:updated>2021-09-09T17:12:48.313Z</atom:updated>
            <content:encoded><![CDATA[<h4>Updating a forked repository that is X commits behind!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rXxABFrxq_vWACZT" /><figcaption>Photo by <a href="https://unsplash.com/@kaleidico?utm_source=medium&amp;utm_medium=referral">Kaleidico</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Git is a distributed version-control system for tracking changes in any set of files, originally designed for coordinating work among programmers cooperating on source code during software development. (source: <a href="https://en.wikipedia.org/wiki/Git">Wikipedia</a>)</p><p>From the definition, one of the major use of Git is for collaborating on projects. This way everyone can make changes to files and update previous version without disrupting the workflow.</p><p>Some beginners find it difficult working with Git, some just assume its complex probably because of the command line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*xcPfmbegZwvxD2GkT7bw-Q.jpeg" /></figure><p>It’s actually not as complex as you think, once you get the workflow and procedure.</p><p>If you have not used Git before, check out this <a href="https://www.freecodecamp.org/news/the-beginners-guide-to-git-github/">tutorial</a> on introduction to Git and Github.</p><h3>The Problem</h3><p>You have just been given a project to develop a product along side other data scientists. A general introduction has been done and every member of the team has been assigned a task. You all agreed to use Git for version control and collaboration.</p><p>After forking the general repository and downloading the files on your local PC, you later found out that the original repository has been updated and new files have been added.</p><p>Your repository is now 71 <em>commits </em>behind, meaning you do not have these new files on your local drive or in your own repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*ReUcKcU3Ko9btDBggG1Xkw.png" /></figure><p>How then do you update your repository and the files on your local drive?</p><h4><strong>Steps in syncing a forked repository</strong></h4><p>After confirming that your repository is behind that is not in sync with the main repository.</p><ul><li>Use git remote -v to check the bookmarked repository names and their corresponding url. The <em>v </em>stands for <strong>verbose. </strong>If the main repository has not been added as an upstream, you will see only your copy of the main repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*cn2mELSNtRAsSKjB3HWYzA.png" /></figure><ul><li>Add the main repository as an upstream to the forked repository. This is important so that you’ll be able to <strong>pull </strong>changes from the main repository. To add the main repository, use</li></ul><pre>git remote add upstream <a href="https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git">https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*Ogt8aOJEOwBidxiQMI9ldQ.png" /></figure><ul><li>Once the original repository has been added, check the bookmarked repository again , using git remote -v to confirm, if it has been added. You should now get this now. Here <em>upstream</em> has been added.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*9of5GdGgDT4Tcf0xfi87_Q.png" /></figure><ul><li>Next we <em>fetch</em> the data from the main(upstream) repository. This downloads all the recent <em>commits</em> and files to your local repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*O77OTPJBoXKvl4Fb02YB9g.png" /></figure><p>The <strong>fetch </strong>command is similar to the <strong>pull </strong>command, it is important that one does this so that your local repository can be up-to-date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*WVIcW_YE6zYL9fZOs7YVRA.jpeg" /></figure><ul><li>After that, switch to the master branch, git checkout master`, if you are not already there.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*Fv4TYivAVi9rjuPC8Zev6Q.png" /></figure><ul><li>Next you merge the repos, git merge upstream/master`.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*iQQSg1b13yS8gZRWNw6-zA.jpeg" /></figure><p>This brings your repository into sync with the upstream repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*2XCDW95GbTmAwfCjOlJDtQ.png" /></figure><ul><li>Lastly, you <strong>push</strong> the changes to your remote repository, git push origin master`.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*L8q8f9A_u5OtIq-knMMgUg.jpeg" /></figure><p>This means sending the changes made to the local repo to the remote repository. Now check your remote repository, you should see this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*-aTvdcfxj3jA_yneI03-9w.png" /></figure><p>Finally, you have been able to update your repository and can access the new changes and files that have been added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*cTgQvfKA7Uy1C8tbk37sDw.jpeg" /></figure><p><strong>In conclusion</strong>, Git and GitHub are very powerful tools when it comes to collaboration whether you are a data scientist, software developer or programmer and understanding how to sync a forked repository comes in very handy.</p><p>If you found this article useful, do well to clap, comment and share. Connect with me on <a href="http://linkedin.com/in/justusilemobayo">Linkedin</a>, <a href="https://twitter.com/JustusIlemobayo">Twitter</a>, and <a href="https://github.com/Justus-coded">GitHub</a>.</p><p><strong>References</strong></p><p><a href="https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/working-with-forks">Working with forks</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=311d9769a88c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hyperparameter Tuning]]></title>
            <link>https://medium.com/aiplusoau/hyperparameter-tuning-a5fe69d2a6c7?source=rss-c637be2310be------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5fe69d2a6c7</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[hyperparameter-tuning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Justus Ilemobayo]]></dc:creator>
            <pubDate>Tue, 22 Dec 2020 00:24:13 GMT</pubDate>
            <atom:updated>2020-12-22T00:24:13.684Z</atom:updated>
            <content:encoded><![CDATA[<h3>Model Hyperparameter Tuning and Optimization(CatBoost)</h3><h4>A beginner’s guide to improving model performances</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v1xvYvJWCMqpVRX-" /><figcaption>Photo by <a href="https://unsplash.com/@brandonzack?utm_source=medium&amp;utm_medium=referral">Brandon Zack</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Remember those times when you still used analogue radio. You had to turn the knobs to tune in to your favourite radio station. You kept on doing this until the station was audible enough almost without any interference. Hence you keep tuning until you get the best performance or the desired result.</p><p>This principle is also applied in hyperparameter tuning. During modelling, you desire to have the best performance possible based on a chosen metric. After building a baseline model, you then begin to tune the hyperparameters in order to optimize performance. Most of the time you would need to tune these hyperparameters as the default ones may not be optimal.</p><p>There are two terms you would hear in machine learning, <em>parameter</em> and <em>hyperparameter</em>. Are they the same? What do they really mean?</p><h4>Parameter vs Hyperparameter</h4><p>A parameter is a value that is learned during the training of a machine learning (ML) model while a hyperparameter is a value that is set before training a ML model; these values control the learning process. Parameters change during the learning process while hyperparameters are constant. Parameters are learned automatically while hyperparameters have to be set manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvMC78S6xjD9aoy71apzjQ.png" /><figcaption>Relationship between model parameters and hyperparameters</figcaption></figure><p>Different machine learning models have different hyperparameters and tuning the right one is essential for performance. Also, the optimal hyperparameters may differ depending on the dataset. You should also note that some of these hyperparameters are more important than others, depending on the algorithm used. Examples of these hyperparameters are:</p><ul><li>The degree of polynomial features to be used in a linear model.</li><li>The maximum depth to be used for the Decision Tree algorithm.</li><li>The number of trees in my Random Forest algorithm.</li><li>The number of neurons in a Neural Network layer.</li><li>Learning rate for Gradient Descent.</li><li>The value of k in the k-nearest neighbor.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*Zmv9NPx9nq88Plbuy6eKaQ.jpeg" /></figure><p>Imagine you go to a party, you have just invited a popular DJ. The DJ arrives with his turntables. He begins to turn those knobs and mix those songs so that y’all can have a nice time. It is important that he turns the right knobs, the bass must be right, the pitch must be perfect, the volume must be okay. Any change in this would cause discomfort and disrupt the party.</p><p>This is applicable to hyperparameter tuning. Even as the DJ needs to know the different knobs to tune to give the best sound, a data scientist has to know the right hyperparameters to tune to give the best performance. To better understand the hyperparameters to tune, you should go through the documentation of the algorithm you intend to use.</p><h4>Steps taken in hyperparameter tuning</h4><ol><li>Define a model.</li><li>Define the range of possible values for all hyperparameters.</li><li>Define a method for sampling hyperparameter values.</li><li>Define evaluative criteria to judge the model.</li><li>Define a cross-validation method.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*3MDxpY_pIMs0yb4dc55KpQ.jpeg" /></figure><h4>Methods for hyperparameter tuning</h4><p>As earlier stated the overall aim of hyperparameter tuning is to optimize the performance of the model based on a certain metric. For example, Root Mean Squared Error (RMSE) for regression problems and accuracy score for classification problems.</p><p>There are several approaches to hyperparameter tuning. In this article I will be focusing on these three:</p><ul><li>Manual tuning</li><li>Grid Search</li><li>Randomized search</li></ul><p><strong>Manual Tuning</strong></p><p>In this method, you have to tune the hyperparameters manually by changing their values and running the model. This method gives you a feel of how the model performs with changes to the different parameters, hence you can tune these values to suit your expectations. Manual tuning should be used when the number of possibilities is small as a large number of possibilities would be labor-intensive.</p><p>To check the parameters for an algorithm, put a question mark (?) behind it.</p><p>CatBoostClassifier?</p><p>These are some of the parameters for <a href="https://catboost.ai/docs/concepts/about.html">CatBoostClassifier</a>.</p><pre>CatBoostClassifier<strong>(<br></strong>    iterations<strong>=None,<br></strong>    learning_rate<strong>=None,<br></strong>    depth<strong>=None,<br></strong>    l2_leaf_reg<strong>=None,<br></strong>    model_size_reg<strong>=None,...<br>    </strong>max_depth<strong>=None,<br></strong>    n_estimators<strong>=None,</strong></pre><p>In this example, I will be tuning the maximum depth manually.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9c16d74232f93f0f4f2a2af2c0bf5ae/href">https://medium.com/media/b9c16d74232f93f0f4f2a2af2c0bf5ae/href</a></iframe><p>Here we see the effect of maximum depth on the model’s performance. In this example, an increase in maximum depth results in an increase in the performance of the model. This may not be true for all cases.</p><p><strong>Grid Search</strong></p><p>This is an automated way of hyperparameter tuning. This method works by exhaustively searching through all the values in the hyperparameter space. It basically computes all the possible combinations of all the hyperparameters, evaluates the performance for each combination using cross validation, and saves the best hyperparameters. This makes grid search computationally expensive.</p><p>For this method, we need to specify a grid which is a python dictionary that contains hyperparameters and their corresponding values.</p><pre>#Method 1</pre><pre>grid = dict()<br>grid[&#39;n_estimators&#39;] = [100, 200, 300]<br>grid[&#39;max_depth&#39;] = [3,4,5]</pre><pre>Method 2</pre><pre>grid = {&#39;max_depth&#39;: [3,4,5],&#39;n_estimators&#39;:[100, 200, 300]}</pre><p>Specifying these hyperparameters, grid search will go through every possible combination.</p><pre>CatBoostClassifier(n_estimators=100, max_depth=3) CatBoostClassifier(n_estimators=100, max_depth=4) CatBoostClassifier(n_estimators=100, max_depth=5)</pre><pre>CatBoostClassifier(n_estimators=200, max_depth=3) CatBoostClassifier(n_estimators=200, max_depth=4) CatBoostClassifier(n_estimators=200, max_depth=5)</pre><pre>CatBoostClassifier(n_estimators=300, max_depth=3) CatBoostClassifier(n_estimators=300, max_depth=4) CatBoostClassifier(n_estimators=300, max_depth=5)</pre><p>Below is an implementation of GridSearchCV</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7fbcfa2b6ae1511313541056fb2aee4/href">https://medium.com/media/e7fbcfa2b6ae1511313541056fb2aee4/href</a></iframe><p>GridSearchCV takes a number of hyperparameters. The most important ones are <em>estimator</em>,<strong> param_grid</strong>, <strong>scoring</strong><em>,</em> and <strong><em>cv</em></strong><em>.</em> <em>Estimator</em> specifies the algorithm to be used, <em>param_grid</em> is a dictionary containing all the hyperparameters for the algorithm specified, <em>scoring</em> is the metric used to evaluate performance e.g accuracy for classification and RMSE for regression, while <strong><em>cv</em> </strong>is the number of folds to be used for cross-validation.</p><p>GridSearchCV has a number of attributes that can be used on the model. Some of these attributes are <strong>best_estimator_</strong>,<em> </em><strong>best_score_</strong>, <strong>best_params_</strong>. You can check the full documentation for GridSearchCV <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html">here</a>.</p><p><strong>Random Search</strong></p><p>As the name implies, this method searches the hyperparameter space randomly for the best performance. This makes it fast and less computationally expensive. Instead of providing a set of values, we provide a statistical distribution for each hyperparameter. First implemented by Bergstra and Bengio, random search has been proven to outperform grid search.</p><p>Below is an implementation of RandomizedSearchCV.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0fa5c0c9d0b0d3bcc97403e1b632b9cb/href">https://medium.com/media/0fa5c0c9d0b0d3bcc97403e1b632b9cb/href</a></iframe><p>The hyperparameters for Randomized Search are similar to Grid Search. They also have similar attributes. You can check the full documentation for RandomizedSearchCV <a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.RandomizedSearchCV.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*KTr6fY-beuzwICSDJeofww.jpeg" /></figure><p>Now that you understand hyperparameter tuning, it’s time for you to practice on some real data. As earlier stated hyperparameter tuning is computationally expensive, depending on the method used, the algorithm, and the number of hyperparameters defined. You can speed up the process of computing by utilizing GPU’s on <a href="http://kaggle.com/">Kaggle</a> and <a href="https://colab.research.google.com/">Google collaboratory.</a></p><h4>Conclusion</h4><p>In conclusion, hyperparameter tuning is an essential part of model building. Every data scientist who wants to build models with optimal performance must under this concept. If you found value in this article, do well to clap, comment and share.</p><p>Connect with me on <a href="http://linkedin.com/in/justusilemobayo">Linkedin</a>, <a href="http://twitter.com/justusilemobayo">Twitter</a>, <a href="https://github.com/Justus-coded">Github</a>.</p><p><em>Editor’s Note: </em><a href="https://twitter.com/AIplus_OAU"><strong><em>AIPlusOAU</em></strong></a><em> is a subsidiary of </em><a href="https://www.datasciencenigeria.org/"><strong><em>Data Science Nigeria</em></strong></a><em> based in Obafemi Awolowo University, Ile-Ife, Osun State. Our aim is to raise a community of Data Scientists, Machine Learning/AI Engineers, and Researchers. We are dedicated to supporting young talents to start and grow their Data Science skills.</em></p><p><em>Do follow AIplusOAU on</em><a href="https://twitter.com/AIplus_OAU"><em> </em><strong><em>Twitter</em></strong></a><em> for emerging trends in Data Science, Machine Learning, and AI.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5fe69d2a6c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/aiplusoau/hyperparameter-tuning-a5fe69d2a6c7">Hyperparameter Tuning</a> was originally published in <a href="https://medium.com/aiplusoau">AI+Club OAU</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>