<?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 Shakir Audu on Medium]]></title>
        <description><![CDATA[Stories by Shakir Audu on Medium]]></description>
        <link>https://medium.com/@shakiraudu?source=rss-a33acdb4e302------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LlAJ-iU4xgvHlb77_DjaSg.gif</url>
            <title>Stories by Shakir Audu on Medium</title>
            <link>https://medium.com/@shakiraudu?source=rss-a33acdb4e302------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 02:39:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shakiraudu/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[ML CONCEPTS: Model Evaluation and Validation]]></title>
            <link>https://medium.com/@shakiraudu/ml-concepts-model-evaluation-and-validation-e8d170e399f9?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8d170e399f9</guid>
            <category><![CDATA[model-validation]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[regularization]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[evaluation]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Wed, 18 Oct 2023 20:32:30 GMT</pubDate>
            <atom:updated>2023-10-18T20:32:30.689Z</atom:updated>
            <content:encoded><![CDATA[<h4>Strategies to validate and assess the performance of machine learning models.</h4><p>Machine Learning models have become very popular nowadays and have been applied in so many core professions from healthcare to finance, agriculture and social sciences. When building a successful ML model, it is a crucial step to evaluate and validate them to ensure that they give accurate predictions and can be successfully deployed.</p><p>Models are built to be adaptive i.e. they are built to learn, so that they would then generalize well with unseen data instead of models memorizing results but do poorly with new data.</p><p>Furthermore, some of these models are vital and can be life changing so making sure that they are extremely accurate while building them is important.</p><p>For example, In healthcare, models have been used to reduce the risk of infectious diseases and improve decision making, so making sure these models are safe to deploy can be life saving. A model has to be <strong>evaluated and validated</strong> to ensure the accuracy of its performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EAa9wl-VQiUfu-Mm" /><figcaption>Photo by <a href="https://unsplash.com/@deepmind?utm_source=medium&amp;utm_medium=referral">Google DeepMind</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Lets have a look at the <strong>Fundamental Concepts and Terminologies</strong> during Model Evaluation and Validation:</p><ol><li><strong>Training and Testing data</strong>: Datasets are typically divided into 2 parts. One is used to train the model and the other to determine the performance of the model. In addition to the training and testing data, a validation set is used to assess model performance and to select the best hyperparameters.</li><li><strong>Evaluation Metrics: </strong>Evaluation metrics are used to quantitatively measure a model’s performance. The choice of the metric usually depends on the type of problem, is it a classification, regression or clutering problem.</li></ol><p><em>You can learn more on the </em><a href="https://medium.com/@shakiraudu/assessing-the-performance-of-a-machine-learning-model-433dd3fa0db"><em>different Evaluation Metrics here</em></a><em> in on of my previous posts.</em></p><p>3. <strong>Cross Validation: C</strong>ross-validation is a technique used to assess a model’s performance by splitting the data into multiple subsets (folds) for training and testing utilizing the entire dataset for both training and testing. Common methods include k-fold cross-validation and leave-one-out cross-validation (LOOCV). Its limitation is it can be computationally intensive, particularly for large datasets or complex models.</p><p>4. <strong>Bias-Variance Trade-off:</strong> Striking a balance between bias and variance is essential for a model to generalize well. Models with high bias (underfit) have too many assumptions, while models with high variance (overfit) are overly complex.</p><p>5. <strong>Hyperparameters:</strong> Hyperparameters are parameters of a model that are not learned from the data but must be set prior to training to help. Hyperparameters control the flexibility or complexity of a machine learning model for example, the learning rate of an algorithm, the number of hidden layers in a neural network, and the depth of a decision tree.</p><p>6. <strong>Grid Search and Random Search:</strong> Grid search and random search are hyperparameter optimization techniques used to fine-tune machine learning models. Both techniques help find the best combination of hyperparameters to optimize a model’s performance. The benefit of using grid search is that it ensures that you explore all possible hyperparameter values within the specified range. As for random search, it is preferred when dealing with larger hyperparameter spaces or when you want to find good hyperparameters without an exhaustive search.</p><p>Understanding these fundamental concepts is essential for anyone working in machine learning and data science. Effective model evaluation and validation are crucial for building robust and accurate machine learning models that can be applied effectively to many real-world problems.</p><p>Machine learning models can suffer from overfitting (where they perform well on the training data but poorly on test data) or underfitting (where they are too simplistic to capture patterns). Model evaluation helps us identify these issues and take corrective actions, such as adjusting model complexity or using regularization techniques.</p><p>When building a machine learning model, one might have to use several of these concepts because model evaluation allows us to compare different models and algorithms to select the one that performs best for a specific task.</p><p>In summary, evaluation and validation play a central role in the development and deployment of machine learning models. They help us ensure that models are accurate, robust, and trustworthy, which is critical for their successful application in a wide range of domains and industries.</p><p><em>I write about different Machine Learning concepts and try to make them very easy to understand. These concepts are introductory and will lead towards more advanced concepts.</em></p><p><em>Thanks for reading, all comments and suggestions are welcome.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8d170e399f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Concepts: Feature Engineering and Feature Selection]]></title>
            <link>https://medium.com/@shakiraudu/ml-concepts-feature-selection-and-feature-engineering-94244f5d3a79?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/94244f5d3a79</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[feature-selection]]></category>
            <category><![CDATA[feature-engineering]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Wed, 21 Jun 2023 10:56:50 GMT</pubDate>
            <atom:updated>2023-06-22T07:04:50.824Z</atom:updated>
            <content:encoded><![CDATA[<h4>Techniques to select relevant features and create new ones for better model performance.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qjoyT4fIhusVzp9Q" /><figcaption>Photo by <a href="https://unsplash.com/de/@duythanh?utm_source=medium&amp;utm_medium=referral">Duy Thanh Nguyen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To build effective and efficient Machine Learning models, it is crucial to select relevant features, create new ones, or transform existing features to use for training. A feature represents any measurable piece of data that can be used for analysis and are often columns in a dataset.</p><p>When working with high-dimensional datasets which often is the case, it is important to identify and retain the most informative and discriminative features while discarding irrelevant, redundant, or noisy ones.</p><p><strong>Feature Engineering</strong> is the process of transforming and manipulating the existing features or creating new features based on domain knowledge or insights gained from the data.</p><p>This can be achieved by applying mathematical operations, aggregating data over different time periods, creating interaction terms, or deriving statistical measures. For example, in a text classification task, new features can be created by counting the number of times specific words or phrases are in the text.</p><p><strong>Feature selection </strong><em>on the other hand </em>is the process of selecting a subset of relevant features or variables from a larger set of available features in a dataset. Datasets often contain a large number of features, which can lead to the curse of dimensionality and most times the relevant features are fewer than the irrelevant ones.</p><p>High-dimensional data tends to be computationally expensive, require more training data, and increase the risk of overfitting. Feature selection mitigates these issues as well by reducing the dimensionality of the data, resulting in more efficient and scalable models</p><blockquote>I write about different Machine Learning concepts and try to make them very easy to understand using intuitive and practical examples. These concepts are introductory and will lead towards more advanced concepts like deep learning, CNNs and Time Series Analysis. Thanks for the support …</blockquote><p>Here are some of the most commonly used techniques for creating and selecting features:</p><h4>Handling Missing Data</h4><p>Missing data is a common challenge in datasets. Techniques such as imputation can be used to fill in missing values with estimated or inferred values. Imputation techniques include mean, median, mode or more advanced methods like regression imputation.</p><h4>One-Hot Encoding</h4><p>One-hot encoding is used to represent categorical variables as binary vectors. Each category is transformed into a binary feature, where a value of 1 indicates the presence of the category and 0 indicates its absence. This technique allows categorical variables to be used in machine learning algorithms that expect numerical inputs.</p><p>For example, say you’re analysing data for a social service agency, and you want to change gender feature to numerical inputs, males can represent 1 and females 0 or vice versa.</p><h4>Binning</h4><p>Binning involves grouping continuous numerical values into bins or intervals. This can help capture non-linear relationships between variables or handle outliers. Binning techniques include equal width binning, equal frequency binning, or using domain knowledge to define custom bins.</p><p>Histograms are an example of binning used to observe the underlying distribution in a data set. It aims to reduce the complexity of the dataset and focus on the broader category.</p><h4>Polynomial Features:</h4><p>Polynomial feature generation involves creating new features by performing mathematical operations on existing features. This technique can capture non-linear relationships between variables. For example, creating quadratic inputs by multiplying or combining features.</p><h4>Scaling and Normalization</h4><p>Scaling and normalization techniques are used to bring numerical features to a similar scale or range. This ensures that features with different scales do not dominate the learning process. Techniques such as Min-Max scaling, Standardization (mean-std scaling), or Robust scaling can be applied.</p><h4>Univariate Feature Selection</h4><p>This technique evaluates each feature individually, considering their relationship with the target variable. Statistical tests such as chi-square test, t-test, or ANOVA can be used to measure the correlation or dependency between each feature and the target. Features with high scores or p-values below a certain threshold are selected as relevant.</p><h4>Correlation Analysis:</h4><p>Correlation analysis measures the statistical relationship between pairs of features. Features highly correlated with the target variable or with other features may be redundant and can be removed. Correlation coefficients like Pearson’s correlation, Spearman’s rank correlation, or mutual information can be computed to assess feature dependencies.</p><p>Correlation doesn’t equal causation. You can’t draw any conclusions regarding the causal effect of one type of data on the other, but you can determine the size, degree, and direction of the relationship. In simple terms, <em>How do different data points relate to each other.</em></p><h4>Recursive Feature Elimination</h4><p>Recursive Feature Elimination (RFE) is an iterative technique that starts with all features and recursively removes the least important ones based on their contribution to the model’s performance.</p><p>The model is trained and evaluated at each iteration, and the least important feature(s) are eliminated until a desired number of features or a specific performance threshold is reached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQro2-EGWc7MukKIzzE7CA.jpeg" /><figcaption>Recursive Feature Elimination with Cross-Validation</figcaption></figure><p>The figure above shows how a Recursive Feature Elimination works when selecting 3 from a total of 16 features. The accuracy of the curve increases rapidly when the 3 important features are recognized and then gradually reduces accuracy and balances out while evaluating the irrelevant features.</p><h4>L1 and L2 Regularization</h4><p>Regularization techniques such as L1 (Lasso) and L2 (Ridge) regularization can be used to induce sparsity and select relevant features. These methods add a penalty term to the model’s loss function, which encourages the model to shrink or eliminate the coefficients of irrelevant features. The features with non-zero coefficients after regularization are considered relevant.</p><blockquote>L1 and L2 Regularization can seem a bit technical at first, and it is! I will explain this technique properly in one of the next articles. So stay tuned…</blockquote><h4>Principal Component Analysis (PCA)</h4><p>PCA is a dimensionality reduction technique that transforms the original features into a lower-dimensional space while preserving as much information as possible. In other words, it is a method that compresses a lot of data into components that capture the essence of the data.</p><p>It creates new features called principal components, which are linear combinations of the original features. The principal components capture the maximum variance in the data and can be used as new features or as a basis for feature selection.</p><p>The techniques above are not exhaustive, there are other ways to select and create features that I didn’t mention such as <strong>Label Encoding, Binary Encoding, </strong>and some automated techniques that include algorithms like<strong> Genetic Algorithms, Forward Selection, Backward Elimination and Stepwise Regression.</strong></p><p>Incorporating domain knowledge can lead to the creation of relevant and informative features. It involves understanding the problem domain, the relationships between features, and the specific characteristics of the data. Domain experts can contribute by suggesting relevant transformations, aggregations, or interactions that capture the domain-specific insights.</p><p>The goal of Feature Engineering and Feature Selection is to improve the performance, efficiency, interpretability, and generalization ability of machine learning models.</p><p>It is important to note that the choice of feature selection and engineering techniques depends on the specific problem, dataset, and model. A combination of multiple techniques or an iterative process of experimentation may be necessary to identify the most relevant features and improve model performance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94244f5d3a79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Concepts: How to Quantitatively Assess the Performance of a Machine Learning Model]]></title>
            <link>https://medium.com/@shakiraudu/assessing-the-performance-of-a-machine-learning-model-433dd3fa0db?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/433dd3fa0db</guid>
            <category><![CDATA[statistical-modeling]]></category>
            <category><![CDATA[confusion-matrix]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-mining]]></category>
            <category><![CDATA[evaluation-metric]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Tue, 13 Jun 2023 15:13:52 GMT</pubDate>
            <atom:updated>2023-10-18T11:10:49.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0zrNlnJloRulssZWThisQ.jpeg" /></figure><p>Knowing how well a model is performing is necessary in order to be able to evaluate it. Evaluation metrics are used to numerically determine how good a model fits on a dataset and also how well it generalises on out-of-sample data.</p><p>Before a model is deployed, it is necessary to assess its performance using a variety of metrics. These metrics are not only used to assess its accuracy but also it’s predictive ability (is it adaptive to unseen data?), capability (for example would the model work with a larger dataset) and overall quality.</p><p>Let us get started with the primary structure that these metrics rely on; <em>The Confusion Matrix</em>.</p><h4>Confusion Matrix</h4><p>A Confusion Matrix is a square matrix with the dimensions equal to the number of classes or features you are classifying. The diagram below is a 2x2 Confusion Matrix and its essential components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RP2LjJCwQPrB0Bj7swKmvQ.jpeg" /><figcaption>The Confusion Matrix</figcaption></figure><ol><li>True Positives (TP): These are the cases where the model predicted the positive class correctly.</li><li>True Negatives (TN): These are the cases where the model predicted the negative class correctly.</li><li>False Positives (FP): These are the cases where the model predicted the positive class incorrectly (also known as a Type I error).</li><li>False Negatives (FN): These are the cases where the model predicted the negative class incorrectly (also known as a Type II error).</li></ol><p>These components of a confusion matrix allow us to compute several evaluation metrics that provide insights into the model’s performance. Some commonly used metrics derived from the confusion matrix include accuracy, recall (also known as sensitivity or true positive rate), precision, and F1 score.</p><h4>Accuracy</h4><p>Accuracy is a straightforward metric that measures the overall correctness of the model’s predictions. It is calculated as the ratio of the sum of true positives and true negatives to the total number of instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SmrzH6FSUHzlCk3IDdRfPA.png" /></figure><p>Accuracy is useful when the dataset is balanced, meaning the number of instances in each class is similar. However, it can be misleading when the dataset is imbalanced, as it doesn’t account for the different costs associated with misclassifying different classes.</p><p>For example, assuming you are a Data Scientist and you are working on a project to classify cancerous cells for a medical research company. The training dataset contains samples of 20 malignant cells and 5 benign cells. After training a model you get an accuracy of 75% which is not too bad for the first model trained. However, if a classifier had not been learning and were to predict <strong>wrongly</strong> that all samples in this dataset were malignant, you would get an accuracy of 80%.</p><p>From this we can identify that measuring the accuracy of an imbalanced model can be misleading and the accuracy of a model is more reliable with datasets that have fairly equal samples.</p><p>Majority of the datasets being used today don’t have equal number of features so we need other ways to properly assess a model’s performance in most cases. This brings us to <em>precision </em>and<em> recall</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7rZHynVQIQBCOy52hFyMgg.jpeg" /><figcaption>Image highlighting the values used to calculate Precision and Recall</figcaption></figure><h4>Precision</h4><p>Precision, on the other hand, measures the proportion of positive predictions made by the model that were correct. It is calculated as the ratio of true positives to the sum of true positives and false positives. Precision is useful when the goal is to minimize false positives, as it focuses on the model’s accuracy in predicting positive instances</p><h4>Recall</h4><p>Recall (or sensitivity) measures the proportion of actual positive instances that were correctly identified by the model. It is calculated as the ratio of true positives to the sum of true positives and false negatives. Recall is useful when the goal is to minimize false negatives, as it focuses on the ability of the model to correctly identify positive instances.</p><p>Between Precision and Recall though, there is a tradeoff. It is hard to optimize for both simultaneously as optimizing for the False Positives (thereby improving Precision) comes at the expense of the False Negatives (thereby deteriorating Recall), and vice versa.</p><p>The metric that should be used depends on the nature of the problem you’re solving.</p><p>Lets go back to our cancerous cell classifier example to understand this properly. It is certainly more desirable to avoid diagnosing patients with malignant (positive) cancerous cells going as benign (benign) in order to start treating them and hopefully cure the cancer or at least limit the cancer from spreading.</p><p>So, If we had a high Recall and low Precision (Scenario A), this would result in fewer malignant cells flagged as benign (False Negative). But this would also mean more benign cells not detected (False Positive).</p><p>On the contrary, if we had a high Precision and low Recall (Scenario B), this would result in fewer undetected benign cells (False Positive), at the expense of more malignant cells flagged as benign (False Negative).</p><p>But what if you need a classifier to do well in both? This brings us to the last metric: F1 Score</p><h4>F1 score</h4><p>The F1 score is a single metric that combines precision and recall into a single value. It is the harmonic mean of precision and recall and provides a balanced measure of the model’s performance. The F1 score is calculated as 2 times the product of precision and recall divided by their sum. It ranges from 0 to 1, where a higher value indicates better performance in terms of both precision and recall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*8G5Bs_Fkf6k-Bi7DaVzMxA.png" /></figure><p>Finally, it is important to note that some classification problems could have more than 2 classes (e.g. classifying consumer data into name, address and gender). Precision and Recall are calculated in the same way as we did with binary classification. The only difference now is each class will have its own set of Precision and Recall values.</p><p><em>I write about different Machine Learning concepts and try to make them very easy to understand. These concepts are introductory and will lead towards more advanced concepts like deep learning, CNNs and Time Series Analysis.</em></p><p><em>Thanks for reading, all comments and suggestions are welcome.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=433dd3fa0db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Concepts: Exploring Classification Algorithms]]></title>
            <link>https://medium.com/@shakiraudu/exploring-classification-algorithms-549a8c407d43?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/549a8c407d43</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Mon, 05 Jun 2023 19:55:28 GMT</pubDate>
            <atom:updated>2023-06-15T06:05:27.100Z</atom:updated>
            <content:encoded><![CDATA[<h4>Logistic regression, decision trees, and random forests.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dD9-cn6-ukj6KxMxY1qdpw.jpeg" /></figure><p>Classification in Machine Learning is a type of supervised learning technique used to determine categorical variables. In clearer terms, you can think of classification as a form of <em>pattern recognition</em>. The output of a classification model can be binary (2 classes only i.e 1 or 0) or can have multiple classes and labels.</p><p>As you can imagine classification has a wide range of applications; It is used to predict churn rates which helps in improving marketing campaigns, it is also used to predict conversion rates of customers (buy or not), in healthcare it is used to predict whether a cancer is benign or malignant and most popularly it is being used to predict whether an email is spam or not spam.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIN78-y__Sxj6RxpiN2X2w.jpeg" /><figcaption>Classification of Animals and Fruits</figcaption></figure><p>Classification in ML leverages a wide range of algorithms to classify datasets into categories such as logistic regression, decision trees, K-nearest neighbours, random forests and support vector machines etc. Lets have a look at some of these techniques.</p><p>It is also important to note that for classification we can start by using our linear regression model to predict the value of the output given the input value and then finding a way to categorise it.</p><h4>Logistic Regression</h4><p>This is probably the most widely used classification algorithm. Logistic Regression is used to forecast the likelihood of a target outcome that is <em>binary i.e. </em>when the output is 1 or 0, yes or no, true or false, you can use it.</p><p>If the estimated probability is greater than 0.5, the model predicts that output belongs to the positive class(labelled “1”, “True”, “yes”) but when it is lower , the model predicts that it belongs to the negative class (labelled “0”, “false”, “no”).</p><p>A logistic regression model computes the weighted sum of input features plus a bias term just like in linear regression, but outputs the logistic of this result instead.</p><p>One might wonder, How is this logistic function gotten?</p><p>This logistic function is a <em>sigmoid function</em> (i.e. S-shaped) that outputs a number between 0 and 1 using the range of standardised output values you might have gotten from a linear regression. It is shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2uIkSE2Rhh_dJPnp35exCQ.jpeg" /></figure><ul><li>In the case of a single feature, <strong>z</strong> is scalar.</li><li>In the case of multiple features, <strong>z</strong> will be a vector containing n values.</li></ul><p>Logistic regression is much easier to implement than other algorithms and works well with datasets that are linearly separable but it has some shortfalls as well. It assumes this linearity and in reality it is not always the case. Secondly, it doesn’t give accurate predictions when the sample size of the dataset is too small as it often leads to overfitting.</p><h4>Decision Trees</h4><p>This classification algorithm divides datapoints into similar groups at a time starting with the “root node”, it branches to the “decision node” and then to the “leaf node” until they are more closely related to one another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35nINNvDJ39yJhtlty2eTg.jpeg" /><figcaption>Figure showing a Decision Tree</figcaption></figure><p>Now’s a good time to know the common terminologies related to Decision Trees;</p><ul><li><strong>Root node</strong>: It could represent the complete dataset or a small portion of it.</li><li><strong>Decision node</strong>: A sub-node that is further divided into sub-nodes.</li><li><strong>Leaf node</strong>: A sub-node that can no longer be split.</li><li><strong>Pruning</strong>: The process of removing parts of the Decision Tree that do not have the power to classify.</li><li><strong>Sub-tree</strong>: A subsection of the entire Decision Tree.</li><li><strong>Splitting</strong>: The process of dividing a node into two or more sub-nodes.</li></ul><p>Decision trees have existed long before machine learning. It is a powerful model capable of finding complex nonlinear relationships in data and it can do both classification and regression tasks i.e. it can produce both continuous and categorical values.</p><p>One of the many attributes of Decision Trees is that they require very little data preparation because they are very sensitive to small variations in the training data. To avoid overfitting the training data, the Decision Tree’s freedom needs to be restricted during training. This is known as <strong><em>regularization</em></strong>. Alternatively, if it is underfitting the training data, it is a good idea to try scaling the input features.</p><h4>Random Forests</h4><p>Random forests work by training many Decision Trees on random sets of features and averaging out their predictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBPWgMO1JzSaT6ubPj5rkw.png" /><figcaption>A Random Forest classifier</figcaption></figure><p>It turns out that if you aggregate the predictions of a group of predictors (<strong><em>ensemble</em></strong>) such as classifiers or regressors, you will often get better predictions than with the best individual predictor. This is called <strong><em>Ensemble Learning</em></strong>.</p><p>Random Forests uses an Ensemble method called <strong><em>bagging</em></strong>. Essentially, bagging involves training several predictors on different random samples of the training set.</p><p>It is also beneficial to use this algorithm because it is flexible i.e. it can handle both classification and regression tasks, it reduces the risk of overfitting and it is easy to evaluate the variables importance to the model.</p><p>On the other hand, it is time consuming, it requires more resources to store the usually larger dataset that the model requires and it is more complex compared to other algorithms.</p><p>In most Machine Learning projects, it is very good practice to use Ensemble methods after building a few good predictors, to combine them into an even better predictor.</p><p><em>I write about different Machine Learning topics and how they apply in our everyday lives. These topics cover introductory concepts to more advanced concepts like deep learning so stay tuned.</em></p><p>Whether you are a beginner looking to learn about machine learning or an experienced data scientist seeking to stay up-to-date on the latest developments, I hope you will find something of interest here. Your comments and opinions are welcome as we ultimately learn from each other.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=549a8c407d43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Concepts: Understanding Linear Regression and its use in predicting continuous variables.]]></title>
            <link>https://medium.com/@shakiraudu/understanding-linear-regression-and-its-use-in-predicting-continuous-variables-476d04962c52?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/476d04962c52</guid>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[linear-regression]]></category>
            <category><![CDATA[statistical-analysis]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 20:59:34 GMT</pubDate>
            <atom:updated>2023-06-15T16:03:47.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7hsqd_IXA2isyX4JCuS1g.jpeg" /></figure><p>Linear Regression is a statistical modelling technique used to discover the relationship between a dependent variable and an independent variable. It is simple yet powerful and is one of the most used algorithms in Machine Learning. In finance it is used for forecasting stock prices and interest rates, in healthcare it is used for predicting patient outcomes based on various factors more recently for analysing the impact of market campaigns on sales.</p><p>Before you consider using a linear model there are few things to clarify, as linear models have these predetermined assumptions:</p><ol><li><strong>LINEARITY:</strong> A linear relationship between the dependent and independent variables.</li><li><strong>INDEPENDENCE:</strong> Observations or data points are independent of each other.</li><li><strong>NO MULTICOLLINEARITY:</strong> The independent variables are not highly correlated with each other.</li><li><strong>NORMALITY:</strong> The residuals (<em>the difference between the observed and predicted values</em>) of the model are assumed to follow a normal distribution</li></ol><p>The goal of a linear regression is to fit a straight line that represents the relationship between the variables.</p><p>A linear regression is further classified into two categories: The simple Linear regression and multiple linear regression: A <strong><em>simple linear regression</em></strong> involves predicting a dependent variable using one independent variable while a <strong><em>multiple linear regression</em></strong> is used for predicting one dependent variable based on two or more independent variables.</p><p>At this point, you could think of a model as a mathematical equation used to predict a value given one or more other values. A linear model is represented by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cV2eGfTR4SzRxejJ4Qe37g.jpeg" /></figure><p>Popular Machine Learning frameworks like Scikit-Learn and tensorflow are used behind the scenes to simulate the nitty-gritty of various models and Linear regression is no exception. Although it is very important to know what model to use and when to use it.</p><p>To assess the performance of a linear regression model i.e to numerically determine how good a model fits a dataset, various evaluation metrics are used, such as</p><ul><li>Mean Squared Error (MSE): Also called the <em>cost function</em>, measures the squared difference between the predicted values and the actual values.</li><li>R-Squared: It measures the proportion of the in the dependent variable explained by the model. It is also known as the <em>coefficient of determination.</em></li><li>F Score: Determines the overall significance of the model.</li></ul><p>While linear regression is a powerful tool, certain limitations such as linearity assumption, outliers significantly influencing the regression line, and overfitting when there are too many variables used can lead to poor generalization.</p><p>Linear Regression is a fundamental technique in predictive modelling. By understanding its concepts, assumptions and applications, we can use it to make informed decisions and gain insights from data.</p><p>NOTE: Always remember to carefully evaluate the model’s performance and also its limitation in other to ensure reliable and accurate results.</p><p><em>Thank you for taking the time to explore Linear Regression with me. If you have any questions, corrections or would like to continue the discussion, I welcome your comments…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=476d04962c52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML Concepts: Exploring Supervised, Unsupervised, Semi-supervised and Reinforcement Learning]]></title>
            <link>https://medium.com/@shakiraudu/machine-learning-types-a8695061e5b?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8695061e5b</guid>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[supervised-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Tue, 30 May 2023 21:08:25 GMT</pubDate>
            <atom:updated>2023-06-15T08:48:20.341Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tqttmvrvVGc792xLGmLymg.jpeg" /></figure><p>Machine Learning is now the <em>technology of the future!</em> This is because of the wide range of applications that it is been used in. Most companies use ML techniques to optimize their products and services but every business faces its unique challenges. Bearing this in mind, the techniques used to solve these challenges have been categorized in other to simplify them. ML systems are mainly classified according to the amount and the type of supervision they get.</p><p>Let’s have a look at them one by one:</p><h4>Supervised Learning</h4><p>It goes as the name implies, Supervised Learning is based on supervision. It simply means the training dataset used to feed the algorithm is “labelled” i.e we train a machine learning algorithm using some input data and corresponding output, and then ask the model to predict the output of test data.</p><p>Supervised learning can be further classified into 2 problems:</p><ul><li><em>Linear Regression</em>; This is used when there is a linear relationship between the input and the output of a dataset</li><li><em>Classification</em>; Sometimes, the output variable is categorical i.e Yes/No, Spam/Not-Spam, benign/malignant etc.</li></ul><h4>Unsupervised Learning</h4><p>Unsupervised Learning on the other hand uses “unlabelled” data to train machines. In this case, the machine is meant to learn from a dataset without any output features or human intervention to discover patterns or data groupings. It is mainly used for <em>clustering and association</em>.</p><p>For example, in <em>anomaly detection</em>, the system is shown mostly normal instances during training and learns to recognize them so when it is shown new instances it can tell whether it looks like a normal one or it is an anomaly. A real life application of this is in credit card fraud detection.</p><h4>Semi-supervised Learning</h4><p>This is a mixture of both supervised and unsupervised learning. With the amount of data growing with leaps and bounds, most of this data isn’t labelled and hence, you would be presented with problems that have a few labelled data and many unlabelled data. The main aim of semi-supervised learning is to effectively use all the available data, rather than only labelled data like in supervised learning.</p><p>Some speech recognition and photo hosting services such as Siri and Photos on iPhone are a good example of this. After classifying a few labelled samples, It automatically recognizes the voices and photos of people and matches subsequent unrecognized ones (clustering).</p><h4>Reinforcement Learning</h4><p>Reinforcement learning has a fairly unique way of training machines, it follows a trial and error method to arrive at a solution. A machine is given a reward if it predicts correctly and a penalty when it doesn’t. The main advantage of reinforcement learning is the fact that data is created during the training so large datasets are not required in advance.</p><p>This technique got popular in game development but not limited to this application (Healthcare, Robotics, Retail, Marketing, and many more). Ever wondered how games are trained to be really good? Here, the agent learns by itself in the simulated game environment by performing the necessary sequence of actions to achieve the desired behavior.</p><p>Some of the important concepts in the field of reinforcement learning:</p><ul><li><strong>Agent</strong>: the model that is to be trained, making decisions piece by piece for which it is either punished or rewarded.</li><li><strong>Environment</strong>: The scenarios or playing field that the agent explores which decides on the consequences of the actions.</li><li><strong>Reward</strong>: The result of an action, which occurs after each step. The reward does not necessarily have to be positive, but can also mean a “punishment” for the model.</li><li><strong>Policy</strong>: This is the strategy that the agent develops over time to decide on the next action. In the beginning, it is purely random decision and towards the end of the training it has developed into a real strategy.</li><li><strong>State</strong>: Current situation the agent is in, for example, the position on the playing field.</li></ul><p>Data is crucial in machine learning for building strong and accurate models. Supervised Learning uses human-labeled data for this purpose, which is best available in large quantities. The cost of doing this is typically high, and getting or creating the datasets is quite challenging. On the other hand, unsupervised learning also needs a lot of data but does not require labels. As a result, getting information is substantially less expensive and simpler.</p><p>As we’ve just seen, supervised and unsupervised learning are completely different from reinforcement learning. However, the general rule that more data leads to higher training results also holds true here, but the difference is that this data is not necessarily supplied externally, but is generated by the model itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8695061e5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Machine Learning]]></title>
            <link>https://medium.com/@shakiraudu/introduction-to-machine-learning-231494ba792e?source=rss-a33acdb4e302------2</link>
            <guid isPermaLink="false">https://medium.com/p/231494ba792e</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Shakir Audu]]></dc:creator>
            <pubDate>Mon, 29 May 2023 21:56:53 GMT</pubDate>
            <atom:updated>2023-05-30T09:11:39.810Z</atom:updated>
            <content:encoded><![CDATA[<h4>An overview of its applications and its importance in today’s world</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E0YFekA3CIy2gNDz" /><figcaption>Photo by <a href="https://unsplash.com/@heyerlein?utm_source=medium&amp;utm_medium=referral">h heyerlein</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Machine Learning has been defined as ‘A field of study that gives computers the ability to learn without explicitly being programmed’ — Arthur Samuel, 1959</blockquote><p>Machine Learning can also be described as a subset of Artificial Intelligence and Computer Science that uses data and algorithms to imitate the way humans learn and improve its accuracy. Businesses drive decision making by using algorithms that are trained to make classifications or predictions through the use of statistical methods.</p><p>One of the first applications of Machine Learning was detecting spam in emails, but over the years it has evolved and is used in a variety of ways such as image classification using computer vision, client segmentation for recommender systems, anomaly detection (detecting credit card fraud) and sentiment analysis in text etc.</p><p>There are different ways to classify Machine Learning problems:</p><ul><li>According to the amount of supervision they get during training (Supervised learning, Unsupervised learning, Semisupervised learning and Reinforcement learning)</li><li>Whether or not they can learn incrementally from a stream of incoming data (Online vs Batch learning)</li><li>How the systems can generalize i.e can the system make good predictions on examples it has never seen before (Instance-Based vs Model-Based learning)</li></ul><p>These criteria are not exclusive, they can be combined in any way. For example, a Netflix recommender system may learn on the fly using data on past movies watched by you and other Netflix users to feed neural networks and get it to output the next likely movie you’d watch; this makes it an online, instance-based, unsupervised learning system.</p><p><em>Don’t worry if all these concepts seem strange at first, you can learn more about them in the next couple of posts.</em></p><p>The rapid increase in data gathered has been a key factor in the popularity and growth of Machine Learning over the years. The choice of the ML model to use depends on many factors such as the size of the training data, how many features the dataset has and whether it is a classification or regression problem.</p><p>In Machine Learning, the main task is to select a learning algorithm, train it on some data and use it to classify/predict future instances of data. To do this, there needs to be a split between data used for training and the one used to test, measure and verify the accuracy of the model.</p><p>The main challenges faced when building ML models are “bad data” i.e poor quality data, insufficient quantity of data and data that is non-representative of the new cases and “bad algorithms” i.e overfitting and underfitting the training data.</p><p>Machine learning algorithms are typically created using frameworks that make it easier and faster to build models. Scikit-learn, TensorFlow and PyTorch are some of the most common frameworks.</p><p>Lastly, I can’t overstate the importance of domain knowledge when facing ML problems as it plays a big role in the result. Knowing what features to feed the model helps in increasing its accuracy. For example, if you are asked to build a model classifying whether a cell in the body is cancerous, you would need an Oncologist to identify cancerous patterns especially when gathering data.</p><p><em>In the next few days, I will be writing about different Machine Learning topics and how they apply in our everyday lives. These topics will cover introductory concepts to more advanced concepts like deep learning. So if you are an ML enthusiast, buckle up and stay tuned…</em></p><p>Whether you are a beginner looking to learn about machine learning or an experienced data scientist seeking to stay up-to-date on the latest developments, I hope you will find something of interest here. Your comments and opinions are welcome as we ultimately learn from each other.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=231494ba792e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>