<?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 Otun Abolarinwa on Medium]]></title>
        <description><![CDATA[Stories by Otun Abolarinwa on Medium]]></description>
        <link>https://medium.com/@abolarinwaotun?source=rss-5fcb0f7c7c22------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mM9lbUt_kNauZU-w</url>
            <title>Stories by Otun Abolarinwa on Medium</title>
            <link>https://medium.com/@abolarinwaotun?source=rss-5fcb0f7c7c22------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:18:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abolarinwaotun/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[Finding the Right Balance In Machine Learning Models]]></title>
            <link>https://medium.com/@abolarinwaotun/finding-the-right-balance-in-machine-learning-models-0462e1cf5d05?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/0462e1cf5d05</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deeplearing]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 13:51:23 GMT</pubDate>
            <atom:updated>2025-10-08T13:51:23.676Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9uhrX-m3_uV2oZat_sJ9A.png" /></figure><p>They say perfection isn’t always the goal; sometimes, even “good enough” can turn out to be the best for the job, and yes, my model just proved that to me.</p><p>So, I recently worked on a hybrid fraudulent email detection system, where I trained several baseline machine learning models like Naive Bayes, Logistic Regression, Random Forest, SVM, and XGBoost. Then I pushed things further by building deep learning models like CNN and LSTM because, well, deep learning sounds… deeper, right?</p><p>Now here’s where it gets interesting:<br>Among all the models, SVM and Random Forest gave the highest accuracy, hitting almost 99.8%. They were killing it. But then I paused and thought, “Is accuracy really the only thing that makes a model the best?” The truth is, not necessarily. In fact, experience has shown that when a model performs too<em> </em>beautifully during training, it’s worth taking a closer look; there might be a little data leakage or overfitting hiding somewhere.</p><p>Sometimes, the best model on paper doesn’t fit best in practice. The LSTM, although it didn’t score the absolute top accuracy, turned out to be the most practical for my problem. Why? Because it’s built to understand sequences and context, and that’s exactly what emails are made of: words, phrases, and meaning that depend on order. It doesn’t just count words like traditional models do; it actually reads between the lines. Plus, it’s more adaptable, less dependent on manual feature engineering, and scales better when new or unseen emails show up.</p><p>I recommend training and testing more than one model, unless you already understand your problem deeply enough to know which approach fits best. So yeah, sometimes the top scorer might not always be the best fit for the real world. Context matters. Task matters. And in the end, the model that understands your data will always serve you better than the one that just memorizes it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0462e1cf5d05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Humans and AI Have in Common When Recognizing Objects: A Case Study on Zebras]]></title>
            <link>https://medium.com/@abolarinwaotun/what-humans-and-ai-have-in-common-when-recognizing-objects-a-case-study-on-zebras-14b573c45ca2?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/14b573c45ca2</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[cnn-model]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 15:05:21 GMT</pubDate>
            <atom:updated>2025-06-16T15:05:21.198Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*DPfkeevo6oaFohk1_cu2mQ.jpeg" /></figure><p>Imagine walking through a jungle. You spot a striped animal in the distance, instantly, your brain says “Zebra.” But how did you know? Was it the pattern, the shape, or maybe the movement? Interestingly, this is the same kind of question we ask when teaching AI to recognize images. Let’s explore what humans and AI share when it comes to recognizing objects starting with the zebra.</p><p>When you see that familiar black-and-white pattern, your brain doesn’t just passively observe ,it gets to work. Behind the scenes, different groups of neurons start firing. One set spots the stripes. Another sees the long face. Another notices the pointed ears. Each group picks out a different part. Then, other neurons step in to combine all this information. They think: “If I’m seeing stripes, ears, a tail, and hooves… this must be a zebra.” Your brain recognizes the object by piecing together smaller parts from simple shapes to a full picture.</p><p>Convolutional Neural Networks (CNNs) do something very similar. When a CNN looks at a zebra image, the first layers detect basic features like edges, lines, or curves. These layers are like the neurons that spot the stripes or the outline of an ear.</p><p>Deeper into the network, layers begin combining these features into larger shapes, such as the zebra’s head or body. Finally, the deepest layers recognize the full object and say, “Hey, this is a zebra.”</p><p>Just like us, CNNs move from tiny parts to whole understanding. And just like humans improve with experience, CNNs also learn by training on lots of images. That’s why CNNs are used in facial recognition, medical scans, self-driving cars, and more. They’re modeled after how we humans see just faster and more scalable.</p><p>So next time you see a zebra, think about how both your brain and artificial intelligence can agree on what it is even if neither was born in the wild.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14b573c45ca2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Sense of Mean with Tensor Manipulation]]></title>
            <link>https://medium.com/@abolarinwaotun/making-sense-of-mean-with-tensor-manipulation-d8f707124d64?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8f707124d64</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 14:52:17 GMT</pubDate>
            <atom:updated>2025-01-08T14:55:16.084Z</atom:updated>
            <content:encoded><![CDATA[<p>Often, even the most experienced professionals can stumble on the basics. For example, a professor might confuse “angle” with “angel” . Similarly, in deep learning, tensor manipulation can sometimes trip us up. Let’s break down a common task in this area: calculating the mean of a tensor along a specific dimension.</p><p>When working with a tensor, the “.mean()” method is useful for aggregating all its elements. However, if you want to calculate the mean along a specific axis (e.g., column-wise or row-wise), you’ll need to specify the dim argument. Remember, Python uses 0-based indexing: dim=0 refers to the first dimension (rows), and dim=1 refers to the second dimension (columns).</p><p>For example: Suppose we have a tensor “main_tensor” with a shape of [3, 4] (3 rows and 4 columns):</p><p>To calculate the mean for each column, squash the rows (main_tensor_col_mean = main_tensor.mean(dim=0))</p><p>To calculate the mean for each row, reduce along the columns (main_tensor_row_mean = main_tensor.mean(dim=1)</p><p>Here is a pictorial illustration of the example given:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*zHbQDC76L2A1FJM-vBDhOg.png" /></figure><p>In the first case, the mean is calculated for all elements in the tensor. In the second the mean is calculated specifically for all the elements in each column. Similarly, for the third case it’s calculated for all elements in each row.</p><p>Although this is just a simple application, the same method applies to more complex and technical problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8f707124d64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Much Do Epochs Really Matter in Model Training?]]></title>
            <link>https://medium.com/@abolarinwaotun/how-much-do-epochs-really-matter-in-model-training-50993b6806b0?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/50993b6806b0</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deeplearningai]]></category>
            <category><![CDATA[pytho]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 21:41:30 GMT</pubDate>
            <atom:updated>2024-12-10T21:41:30.024Z</atom:updated>
            <content:encoded><![CDATA[<p>Often, people believe that simply increasing the number of epochs when training a model is the magic trick to making it perform better. Well, while epochs do play a significant role in model building, there’s way more to consider than just cranking up the epoch count. Think of it as trying to win a race by just running more laps — it’s helpful, but it’s not the whole game.</p><p>This became glaringly obvious to me while working on a supervised machine learning project titled <em>“Understanding and Predicting the Behavioral Pattern of Actuators in a Smart Greenhouse.”</em> I learned that although epochs contribute to optimizing model performance, simply increasing them is not a cure-all. Sure, more epochs can help a poorly trained model perform better because it gets more opportunities to learn from the data. But beware — too many epochs can over-prepare your model, leading it straight into the dark, dreaded world of overfitting.</p><p>So, what’s the role of epochs in model building?</p><p>An epoch refers to a complete pass through the entire training dataset during the model’s training process. For example, if you have 5,000 training observations and a batch size of 200, the model will run in batches, 25 times, to process all the observations. In this case, those 25 rounds make up one epoch. Now, if you set your epochs to 5, you’re asking the model to go through the entire training set (25 batches) five times, totaling 125 batches in all.</p><p>In a nutshell, epochs allow your model to iteratively learn from the data, refining its parameters with each pass to improve predictions. But hold your horses — epochs are just one piece of the puzzle. There are bigger players that contribute significantly to model performance.</p><p><strong>First, data quality:</strong><br> You can’t train a model on junk data and expect it to produce gold-standard results. Ensure your dataset is balanced, clean, and prepped for training before even thinking about epochs.</p><p><strong>Next, parameter settings:</strong><br> These have a huge impact on the learning process. You need to find the right learning rate, use an appropriate number of neurons and layers (not too few or too many), and even consider disabling some neurons randomly to prevent overfitting. The optimizer you choose also plays a key role — yes, it can feel like a headache figuring out which one works best, but that’s where hyperparameter tuning comes in to save the day.</p><p><strong>What about gradient clipping?</strong><br> This is a lifesaver for capping runaway gradients during backpropagation. It’s like putting a speed limit on a reckless driver — necessary and effective.</p><p><strong>Don’t forget data augmentation and normalization:</strong><br> Scaling, data augmentation, and batch normalization are essential steps that improve how your model generalizes to unseen data.</p><p><strong>Finally, evaluation matters too:</strong><br> Choosing the right loss function and evaluation metrics can make or break your model’s performance.</p><p>When all these factors are in check, increasing the number of epochs can make sense. But without addressing them, increasing epochs is like testing the same vaccine on the same group of people over and over again. Sure, you might see some improvement, but that’s probably because the respondents are just getting used to the vaccine.</p><p>So, think beyond epochs, and give your model the holistic care it needs to thrive!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50993b6806b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unsqueeze Method in PyTorch: A Useful Tool for Deep Learning]]></title>
            <link>https://medium.com/@abolarinwaotun/unsqueeze-method-in-pytorch-a-useful-tool-for-deep-learning-aaa4e5e588f9?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaa4e5e588f9</guid>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Sun, 17 Nov 2024 09:35:15 GMT</pubDate>
            <atom:updated>2024-11-17T09:35:15.534Z</atom:updated>
            <content:encoded><![CDATA[<p>Many neural network layers require specific input shapes, and this is where the unsqueeze() method comes in. The unsqueeze() method is a valuable tool in PyTorch for manipulating tensor dimensions, enabling operations like matrix multiplication and reshaping. It is particularly useful for adding a batch dimension to a tensor. To use it, you’ll need to import the PyTorch library.</p><p>There are two main ways to apply the unsqueeze method.<br>1. Applying directly on the tensor using .unsqueeze() method: <br>2. Using the torch.unsqueeze() function.</p><p>Application 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*SwcTiWJfAYHfB7QCaKvPWw.png" /></figure><p>Insight: In this example, we started with a tensor that has 1 dimension. When we apply unsqueeze(0), we instruct PyTorch to add a new dimension at index 0 (the start of the shape). This operation results in a 2-dimensional tensor with a shape of (1, 3). In the same vein, when we apply unsqueeze(1), we add a new dimension at index 1 (the second position), creating a new inner dimension. This transforms the tensor into another 2D tensor with a shape of (3, 1), where 3 represents the number of rows, and 1 is the number of elements in each row.</p><p>Application 2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*alu2faUoQMnVBKHEPNxx_A.png" /></figure><p>Insight: In this case, applying the unsqueeze method to u adds a new dimension at index 0, resulting in a 3D tensor. The first dimension contains the 2D tensor, the second dimension contains the 2 rows (each being a 1D tensor), and the third dimension contains the 3 values in each row.</p><p>Lastly, another way the unsqueeze method is useful is when processing deep learning models that expect batches of data as input. This is evident in image classification where neural networks typically expect inputs of the shape (B, C, H, W) where:<br>B is the batch size,<br>C is the number of channels,<br>H is the height of the image,<br>W is the width of the image.</p><p>The unsqueeze method made it possible to add a batch to that sample.</p><p>Example: <br>Imagine a colored (RGB) image with a tensor image shape of (3,128,128).To treat this single image as a batch size of one, we can add a batch dimension by using unsqueeze(0). as a result, the tensor shape becomes (1,3,128,128).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaa4e5e588f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BEYOND THE CODE OF DEEP LEARNING: Why Matrices, Linear Algebra, Differentiation, and Calculus…]]></title>
            <link>https://medium.com/@abolarinwaotun/beyond-the-code-of-deep-learning-why-matrices-linear-algebra-differentiation-and-calculus-4d20bd8e3edb?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d20bd8e3edb</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[modelling]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Wed, 13 Nov 2024 08:33:00 GMT</pubDate>
            <atom:updated>2024-11-13T08:33:00.713Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>BEYOND THE CODE OF DEEP LEARNING: Why Matrices, Linear Algebra, Differentiation, and Calculus Matter in Neural Networks</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLl1qUwiKNN19WgW8qwghQ.jpeg" /></figure><p>While programming has become easier, you can take an idea, code it, run it, and quickly get the result you want. For example, you can train a model to predict an outcome.</p><p>You know the steps by the book: you clean your data, scale when necessary, split it, fit your model, make predictions, evaluate it, and voilà! You get your result. If the model performs well on the testing set, you say, &quot;Okay, I’m done.&quot; If it doesn’t, you consider hyperparameter tuning until you get the desired result. How interesting and stress-free this would be. But can we really explain what’s happening behind these codes? Many people say programming is now easy — that Python (for example) will handle the math, so just master the code. Yet many professionals still want to understand the logic behind their code, as this is what distinguishes a skilled programmer.</p><p>When training a neural network in deep learning, for instance, a solid understanding of linear algebra, metrics, differentiation, calculus, and related areas is essential to grasping the intuition behind how neural networks work. For example, weights and inputs in neural networks are often represented as matrices and vectors, which are multiplied to calculate outputs at each layer. During backpropagation, we use linear algebra to calculate and store gradients, and in this process, differentiation is used to compute derivatives of the loss function with respect to each weight and bias in the network. Differentiation is also crucial in computing gradients, even when non-linear functions like ReLU, sigmoid, etc., are applied to layer outputs. The use of calculus is foundational for optimization techniques.</p><p>You may agree with me that these mathematical areas together provide the foundation for building, training, and fine-tuning neural networks. They make it possible to interpret the network&#39;s learning behavior, understand underlying data transformations, and optimize performance.</p><p>Let’s also remember that the world is constantly evolving, with approaches to problem-solving being upgraded regularly. Scientists and programmers are continuously developing new methods to make problem-solving easier. However, one thing is certain: though concepts and approaches may change, they are always built on existing logic. As my career mentor says, &quot;It makes sense to master the code, but it’s even better to understand the intuition behind it. The way we code may change, but the underlying concepts likely won’t.&quot;</p><p>I’m a work in progress too; I’m not great at mathematics either, and I’m still learning. I welcome tutorials and recommendations. If you have materials or links to resources that explain the mathematical intuition behind machine learning and deep learning, feel free to drop them in the comments or in my DMs.</p><p>Let’s continue to embrace a growth mindset!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d20bd8e3edb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Major Metrics Used in Clustering Analysis: Understanding the Key Differences between Inertia…]]></title>
            <link>https://medium.com/@abolarinwaotun/major-metrics-used-in-clustering-analysis-understanding-the-key-differences-between-inertia-75f739fd2b36?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/75f739fd2b36</guid>
            <category><![CDATA[data-wrangling]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 22:20:33 GMT</pubDate>
            <atom:updated>2024-10-29T22:20:33.596Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Major Metrics Used in Clustering Analysis: Understanding the Key Differences between Inertia, Distortion Score, and Silhouette Score</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Lp8Qy1UW4Uv3cFf1SxYqA.jpeg" /></figure><p>Inertia, Silhouette Score, and Distortion Score are metrics used in clustering analysis. Each of these metrics offers unique insights that help to evaluate the quality of clustering models; however, they measure different aspects.</p><p>Here are their key differences:</p><p>1<strong>. Inertia (Sum of Mean Squared Error)</strong></p><ul><li>Inertia is used to evaluate the performance of the K-Means algorithm by checking the quality of clustering. It measures the sum of squared distances between each data point and the centroid of the cluster to which it belongs, assessing how tightly packed the points are within each cluster.</li><li>A lower inertia value indicates a denser cluster, which simplifies the process of determining the number of clusters.</li><li>Inertia can be effectively minimized by the K-Means algorithm through its iterative process of assignment and update steps.</li></ul><p><strong><em>Formula:</em></strong> Σ (x - μ)^2, where:<br>- \( x \) is a data point,<br>- \( μ \) is the centroid.</p><p><strong>2. Distortion Score (Sum of Squared Distances)</strong></p><ul><li>While the Distortion Score is similar to inertia in that they both evaluate intra-cluster variance, distortion focuses on the average spread within clusters. It measures the sum of squared distances between data points and the centroid of the cluster to which they belong.</li><li>The Distortion Score is often normalized by the number of data points. Lower distortion indicates better clustering quality.</li></ul><p><strong><em>Formula</em></strong>: Σ (x - μ)^2 / n, where:<br>- \( x \) is a data point,<br>- \( μ \) is the centroid,<br>- \( n \) is the number of data points.</p><p><strong>3. Silhouette Score</strong></p><ul><li>While Inertia and Distortion focus on intra-cluster distances, the Silhouette Score, though computationally intensive, evaluates overall clustering quality by considering both intra-cluster distance (cohesion) and inter-cluster distance (separation). In essence, the Silhouette Score measures how close data points within a cluster are to each other in comparison to their distance from points in other clusters.</li><li>The Silhouette Score ranges from -1 (worst) to 1 (best). Higher scores indicate smaller intra-cluster distances (resulting in tighter clusters) and larger inter-cluster distances (resulting in well-separated clusters).</li></ul><p><strong><em>Formula:</em></strong> (b - a) / max(a, b), where:<br>- \( a \) is the intra-cluster distance,<br>- \( b \) is the inter-cluster distance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75f739fd2b36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[train_test_split in Machine Learning: A Beginner’s Guide]]></title>
            <link>https://medium.com/@abolarinwaotun/train-test-split-in-machine-learning-a-beginners-guide-a9f799cdef96?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9f799cdef96</guid>
            <category><![CDATA[sklearn]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 03:23:11 GMT</pubDate>
            <atom:updated>2024-10-15T03:23:11.997Z</atom:updated>
            <content:encoded><![CDATA[<p>The train_test_split() function is a part of the popular Python library, Scikit-learn (sklearn), widely used in machine learning. This method splits a dataset into training and testing sets, preparing it for model building.The training set is utilized to train the model, whereas the test set evaluates the final model’s performance.</p><p>The syntax for train_test_split() is:</p><p>sklearn.model_selection.train_test_split(*arrays, test_size=None, train_size=None, random_state=None, shuffle=True, stratify=None)</p><p>Note: It returns a list containing the training and testing sets.</p><p>The train_test_split() parameters explained as follows:</p><p>1. *arrays: A sequence of indexables with same length/shape [0]: The train_test_split() method’s ability to accept multiple arrays provides a convenient way to split complex datasets while maintaining relationships between different arrays. These arrays refer to the input datasets that need to be split into training and testing sets, which can be lists, NumPy arrays, SciPy sparse matrices, Pandas DataFrames, etc.</p><p>2. test_size(float or int, default = None): This parameter specifies the fraction of samples allocated to the test set. By default, test_size is None, which implies a default setting of 0.25. This means 25% of samples will be allocated to the test set, while the remaining 75% will be allocated to the training set. You can also set a custom value as a float or integer. However, when using an integer, ensure it does not exceed the total number of samples.</p><p>3. train_size(float or int, default = None): This parameter specifies the fraction of samples allocated to the training set. By default, train_size is None, which implies train_size = 1 — test_size. This means the training size will automatically be the remainder after removing the test size fraction. For example, allocating 0.35 (35%) to the test set will result in a default training size of 0.65 (65%).</p><p>4. random_state: RandomState instance or None (default=None). This parameter ensures the reproducibility of the split. When set, the same split will be generated every time the code is run, provided the dataset and random_state value remain the same.</p><p>5.shuffle (bool, default = None): This parameter randomizes the order of samples before splitting. By default, shuffle is True, ensuring the training and testing sets have similar sample distributions. When shuffle is False, the original order of samples in the dataset is preserved.</p><p>6. stratify (array_like, default = None): This technique maintains even class distribution in training and testing sets to prevent class imbalance issues. Using stratify is recommended when working with imbalanced datasets or classification problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*wtKCwD75XeV8cpWa1RTKdQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f799cdef96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Code Goes Wrong: Embracing Debugging Mindset]]></title>
            <link>https://medium.com/@abolarinwaotun/when-code-goes-wrong-embracing-debugging-mindset-00fbf8db485a?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/00fbf8db485a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Sat, 12 Oct 2024 10:00:19 GMT</pubDate>
            <atom:updated>2024-10-12T10:00:19.202Z</atom:updated>
            <content:encoded><![CDATA[<p>When Code Goes Wrong: Embracing Debugging Mindset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffsQwuvVKSt9Y4DABLM7Kg.jpeg" /></figure><p>Programming languages like Python are unforgiving; a single syntax error can halt your program and display an error message. Receiving these messages can be frustrating, but remember that debugging is a crucial skill in data science. Debugging is intellectually rewarding and similar to detective work.</p><p>Mr. Muyiwa, one of my tutors, would often say, &quot;Don&#39;t shiver when you see errors; get used to finding your way through them.&quot; When error codes seem longer than your script (yes, sometimes it&#39;s like reading a novel!), don&#39;t panic or give up. Rather, take a deep breath and analyze the message. Look for keywords like &quot;SyntaxError,&quot; &quot;TypeError,&quot; or &quot;NameError.&quot; It&#39;s often more helpful than we might think.</p><p>Although we live in a tech-driven world where everything has been made easy, and AI can debug errors quickly, familiarizing ourselves with error messages will enhance our debugging skills and make us better programmers who truly know their onions.</p><p>Here are common Python error types:</p><p>1. Syntax Error: When your code is grammatically incorrect, Python won&#39;t let you run it.</p><p>2. Runtime Error (Exceptions): Errors that appear only when you run the program (like surprises at a party!</p><p>3. Semantic Error: Instead of performing the intended task, it outputs what the programmer eventually wrote (like asking for a doughnut and getting yogurt).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00fbf8db485a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Data Science
In today's fast-paced world, data is constantly generated through…]]></title>
            <link>https://medium.com/@abolarinwaotun/introduction-to-data-science-in-todays-fast-paced-world-data-is-constantly-generated-through-fcdb7c90f010?source=rss-5fcb0f7c7c22------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcdb7c90f010</guid>
            <dc:creator><![CDATA[Otun Abolarinwa]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 11:49:48 GMT</pubDate>
            <atom:updated>2024-09-10T11:49:48.686Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction to Data Science</strong><br>In today&#39;s fast-paced world, data is constantly generated through every activity, transaction, and interaction. From farmers in agricultural sectors to traders and industries, data plays a vital role in informing decisions and driving growth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZopGtkr7E28bOwApwHf0A.jpeg" /></figure><p><strong>What is Data?</strong><br>Data refers to a collection of observed information or facts, whether processed or unprocessed. This raw material is the foundation for Data Science.</p><p><strong>Data Science and Databases</strong><br>When data becomes structured, organized, and efficient for movement and processing, it evolves into a Database. Data Science relies heavily on databases to analyze, organize, and produce high-quality data.</p><p><strong>The Power of Data Science</strong><br>By providing clean and accurate data, Data Science enables organizations to make strategic decisions and build predictive models using past data. Proper data storage also facilitates future data retrieval and analysis.</p><p><strong>The Importance of Databases in Data Science</strong><br>The role of databases in Data Science cannot be overstated. Efficient data management is crucial for data scientists to work effectively.</p><p><strong>Stay Tuned!</strong><br>In our next article, we’ll delve into Database Management Systems (DBMS) and explore various software solutions.</p><p><strong>Hey Techie, Join the Journey!</strong><br>Dive into the world of Data Science with me, and discover the exciting possibility that awaits.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcdb7c90f010" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>