<?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 Olaide Kashimawo on Medium]]></title>
        <description><![CDATA[Stories by Olaide Kashimawo on Medium]]></description>
        <link>https://medium.com/@datadiscoveries?source=rss-179213a18f95------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ITWPhV1OuWSJBxJkfUM5DA@2x.jpeg</url>
            <title>Stories by Olaide Kashimawo on Medium</title>
            <link>https://medium.com/@datadiscoveries?source=rss-179213a18f95------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:48:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@datadiscoveries/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[The Right Way to Split your Dataset]]></title>
            <link>https://datadiscoveries.medium.com/the-right-way-to-split-your-dataset-f930aca49ae2?source=rss-179213a18f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/f930aca49ae2</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <dc:creator><![CDATA[Olaide Kashimawo]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 17:13:10 GMT</pubDate>
            <atom:updated>2025-11-15T17:13:10.680Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Right Way to Split Your Dataset</h3><p>When I started with machine learning, splitting the data was simple: just split it 80% to training and 20% to testing. Turns out, there’s more to it!</p><p>Here’s what actually matters:</p><p><strong>The Standard Split: Train/Validation/Test</strong></p><ul><li>Training set (60–70%): Where your model learns</li><li>- Validation set (15–20%): For tuning hyperparameters and model selection</li><li>- Test set (15–20%): The final, untouched evaluation</li></ul><p>Why all three?</p><p>If you tune your model based on test performance, you’re essentially “leaking” information. Your test set should be a completely unseen dataset that gives you an honest estimate of real-world performance.</p><p>Key Principles:</p><p>1️⃣ Split BEFORE any preprocessing</p><p>Calculate statistics (mean, std, etc.) only on training data, then apply to validation/test. Otherwise, you’re leaking future information!</p><p>2️⃣ Stratified splitting for classification</p><p>Use a stratified split to maintain class proportions across all sets, especially critical for imbalanced datasets.</p><p>3️⃣ Time-based splitting for time series</p><p>Never randomly shuffle time series data! Use chronological splits: train on the past, validate on the recent past, test on the future.</p><p>4️⃣ Random state for reproducibility</p><p>Always set a random seed so your splits are reproducible.</p><p>Quick Code Example:</p><pre>from sklearn.model_selection import train_test_split<br># First split: separate test set<br>X_temp, X_test, y_temp, y_test = train_test_split(<br>. X, y, test_size=0.2, random_state=42, stratify=y<br>)<br># Second split: create train and validation<br>X_train, X_val, y_train, y_val = train_test_split(<br>. X_temp, y_temp, test_size=0.25, random_state=42, stratify=y_temp<br>)<br># Result: 60% train, 20% validation, 20% test</pre><p>**Common Mistake to Avoid:**</p><p>Don’t touch your test set until the very end. If you keep evaluating it and adjusting your model, it stops being a true test set!</p><p>What’s your approach to dataset splitting? Have you encountered any pitfalls?</p><p>#MachineLearning #DataScience #AI #Python #MLEngineering #DataSplit #BeginnerFriendly</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f930aca49ae2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linear Regression]]></title>
            <link>https://datadiscoveries.medium.com/linear-regression-4bc9e3d28f64?source=rss-179213a18f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bc9e3d28f64</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Olaide Kashimawo]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 17:09:58 GMT</pubDate>
            <atom:updated>2025-11-15T17:09:58.592Z</atom:updated>
            <content:encoded><![CDATA[<p>Linear regression is a statistical method for exploring the linear relationship between one or more independent variables and a dependent variable.<br>It is used to fit a linear equation to observed data to model the relationship between a dependent variable and one or more independent variables.</p><p>The <strong>LinearRegression</strong> class in the <strong>sklearn.linear model </strong>module in Python can be used to perform linear regression.<br>This class provides a linear regression implementation based on the Ordinary Least Squares (OLS) method.</p><p>You must have the <strong>sklearn</strong> library installed in your Python environment to use the <strong>LinearRegression</strong> class.<br>The Python package manager, pip, can be used to install this library.</p><pre>pip install scikit-learn</pre><p>Once you’ve installed <strong>sklearn</strong>, you can use the <strong>LinearRegression</strong> class to fit a linear model to your data.</p><pre>from sklearn.linear_model import LinearRegression<br><br># Assume that we have a dataset with one independent variable (x) and one dependent variable (y)<br>x = [[i] for i in range(10)]<br>y = [i * 2 + 1 for i in range(10)]<br><br># Create a LinearRegression model and fit it to the data<br>model = LinearRegression()<br>model.fit(x, y)<br><br># The model is now trained and can be used to make predictions<br>predictions = model.predict(x)</pre><p>The fit method of the <strong>LinearRegression </strong>class estimates the coefficients of the linear model using the OLS method. Once the model is trained, you can use the predict method to make predictions for new data.</p><p>In addition, the <strong>LinearRegression</strong> class provides several useful attributes that allow you to understand the characteristics of the fitted model in addition to fitting a linear model to data.<br>The <strong>coef_</strong> attribute, for example, returns the linear model’s coefficients, while the <strong>intercept_</strong> attribute returns the model’s intercept.</p><pre># Print the coefficients of the linear model<br>print(model.coef_)<br><br># Print the intercept of the linear model<br>print(model.intercept_)</pre><p>Linear regression is a powerful tool for understanding variable relationships and making predictions, and the <strong>LinearRegression</strong> class in <strong>sklearn</strong> provides an easy-to-use Python implementation of this method.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bc9e3d28f64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A simple understanding of confusion matrix]]></title>
            <link>https://datadiscoveries.medium.com/a-simple-understanding-of-confusion-matrix-fbf2fda8483d?source=rss-179213a18f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbf2fda8483d</guid>
            <dc:creator><![CDATA[Olaide Kashimawo]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 16:30:19 GMT</pubDate>
            <atom:updated>2023-02-08T16:30:19.275Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*cyu01XU4fnbthwPF.png" /></figure><p>Greetings!</p><p>In this blog, I explained how the confusion matrix is used to solve classification problems. Learn basic ideas about machine learning.</p><p>Have a good time reading.</p><p>A confusion matrix is a table used to measure how well a classifier works by comparing the results it predicted with the ones it actually got. It is a powerful instrument for testing a model’s accuracy, pinpointing where the model goes wrong, and deducing the source of the model’s errors;</p><p>A confusion matrix is a two-dimensional table with rows representing the actual results and columns representing the predicted results. The matrix is filled with the count of instances for each combination of actual and predicted results. There are four key elements in a confusion matrix: true positives (TP), false positives (FP), false negatives (FN), and true negatives (TN). TP is the number of times the model predicted the positive class correctly, and FN is the number of times the model predicted the negative class incorrectly. FP represents the number of instances where the model incorrectly predicted the positive class, while TN represents the number of instances where the model correctly predicted the negative class.</p><p>Several useful measures for measuring performance can be derived from a confusion matrix. Accuracy, precision, recall, and the F1 score are all relevant indicators of performance. In order to evaluate how well a model performs, we can look at its accuracy, precision, recall, and F1 score. Accuracy measures the model’s overall accuracy, precision measures its ability to correctly predict the positive class, recall measures its ability to find all positive instances, and the F1 score is the harmonic mean of precision and recall.</p><p>To better understand the concept of confusion matrices, let’s take an example of a binary classification problem. In this problem, the model is trained to predict if an individual has a certain disease (positive class) or not (negative class). The confusion matrix for this problem would look something like this:</p><pre>          Actual<br>Predicted  Positive  Negative<br>  Positive      TP      FP<br>  Negative      FN      TN</pre><p>Supposing that the model contains a total of 100 instances, 80 of those examples would go into the positive class, while 20 of those instances would fall into the negative class. The model accurately predicted 70 of the positive instances out of a total of 80, while incorrectly categorizing 10 of the positive instances. 18 of the negative cases were accurately predicted by the model, whereas two of the examples were incorrectly classified by the model. The confusion matrix for this hypothetical situation would look like this:</p><pre>          Actual<br>Predicted  Positive  Negative<br>  Positive      70      10<br>  Negative      2       18</pre><p>Now that we have this confusion matrix, we can figure out how to calculate the performance measures we talked about before. For instance, the accuracy of the model is calculated as (70 + 18)/100, which equals 0.88; the model’s precision is calculated as 70/(70 + 10) = 0.87; the model’s recall is calculated as 70/(70 + 2) = 0.97; and the F1 score of the model is calculated as 2 * 0.87 * 0.97 / (0.87 + 0.97) = 0.92.</p><p>In conclusion, a confusion matrix is a useful tool for figuring out how well a machine-learning model works. It helps to understand a model&#39;s strengths and weaknesses and gives important clues about how the model can be improved. It is an important part of the process of evaluating a model, and it needs to be used regularly in order to figure out how well a model works.</p><p>Thanks for choosing my blog. I hope you have learned something new through this. Feel free to make suggestions if any improvements are needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbf2fda8483d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Forecasting at Scale]]></title>
            <link>https://datadiscoveries.medium.com/forecasting-at-scale-ada6d8e01b1a?source=rss-179213a18f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/ada6d8e01b1a</guid>
            <category><![CDATA[supply-chain]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Olaide Kashimawo]]></dc:creator>
            <pubDate>Mon, 21 Nov 2022 15:13:02 GMT</pubDate>
            <atom:updated>2022-11-21T15:13:02.690Z</atom:updated>
            <content:encoded><![CDATA[<p>Businesses use forecasting to plan their capacity, set goals, and identify anomalies in their data. It is difficult to provide accurate and high-quality forecasts, despite their importance. Analysts skilled in time series modeling are hard to come by when dealing with a large number of time series. A basic concept of forecasting at scale is the requirement for experts from a variety of backgrounds to work together.</p><p>Let’s have a look at some of the system’s components.</p><p><strong>Features of Business Time Series</strong></p><p>The first component of our forecasting system is a new model developed over many iterations of Facebook data forecasting. We’ve used this model to predict many data types. We use a simple, modular regression model with often effective default parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*1lMzMGPQQdJTT1ESUL5pwA.png" /><figcaption>Fig 2. business time series</figcaption></figure><p>This model enables analysts to select the components pertinent to the forecasting problem they are attempting to solve and easily make adjustments as required.</p><p><strong>The Prophet Forecasting Model</strong></p><p>The second component is a system that can measure and track the accuracy of forecasts and flag forecasts that need to be checked manually to assist analysts in making incremental improvements. This is a crucial component that enables analysts to determine whether or not the model requires alterations, or whether or not an entirely different model might be more appropriate in the given circumstances.</p><p>Our methodology is influenced by Facebook’s time series (piecewise trends, multiple seasonality, floating holidays) and the challenges of forecasting at scale. Automatic forecasting has a lengthy history with numerous time series-specific methodologies (Tashman &amp; Leach 1991, De Gooijer &amp; Hyman 2006).</p><p>A saturating growth model and a piecewise linear model are two of the trend models that we have created. Together, they cover a wide range of Facebook applications. Unlike baselines, the Prophet forecast can predict both weekly and seasonality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyYffco5GERmabh2d10vIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_t7cL_TvqWmFrvoahr1sQ.png" /></figure><p><strong>Automating Evaluation of Forecasts</strong></p><p>This third section outlines a strategy for automated forecast performance review by comparing multiple methodologies and flagging forecasts requiring manual intervention. In combination, simple, adaptable models and scalable performance monitoring make it possible for a large number of analysts to make predictions regarding a large number and a variety of time series.</p><p>We evaluate our forecasting procedure using the following;</p><p>I. Use of Baseline Forecasts</p><p>II. Modeling Forecast Accuracy</p><p>III. Simulated Historical Forecasts</p><p>IV. Identifying Large Forecast Errors</p><p><strong>Conclusion:</strong></p><p>We assess and evaluate forecasting procedures and automatically flag forecasts for manual evaluation and correction. This tool helps analysts to apply their skills efficiently and it also enables practical corporate time series forecasting.</p><p><strong><em>This is what we refer to as forecasting at scale!</em></strong></p><h3>References</h3><p>C. Chatfield<em> et al.</em><a href="https://www.sciencedirect.com/science/article/pii/0305054886900080">“Autocast” (Software Review</a>)International Journal of Forecasting(1988)</p><p>R.T. Clemen</p><p><a href="https://www.sciencedirect.com/science/article/pii/016920708990054X">Combined forecasts: A review and annotated bibliography</a> International Journal of Forecasting(1989)</p><p>F.X. Diebold</p><p><a href="https://www.sciencedirect.com/science/article/pii/0169207089900071">Forecast combination and encompassing: Reconciling two divergent literatures</a> International Journal of Forecasting(1989)</p><p>P. Newbold<em> et al.</em></p><p><a href="https://www.sciencedirect.com/science/article/pii/0169207089900149">On exponential smoothing and the assumption of deterministic trend plus white noise data-generating models</a> International Journal of Forecasting(1989)</p><p>R.S. Rycroft <a href="https://www.sciencedirect.com/science/article/pii/0169207089900125">Microcomputer software of interest to forecasters in a comparative review</a> International Journal of Forecasting(1989)</p><p>R. Sharda<em> et al.</em></p><p><a href="https://www.sciencedirect.com/science/article/pii/0169207088901203">Forecasting software for microcomputers</a>Computers and Operations Research(1986)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ada6d8e01b1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Convert Strings to Integers in Pandas DataFrame]]></title>
            <link>https://datadiscoveries.medium.com/how-to-convert-strings-to-integers-in-pandas-dataframe-b35b6a88c6cd?source=rss-179213a18f95------2</link>
            <guid isPermaLink="false">https://medium.com/p/b35b6a88c6cd</guid>
            <dc:creator><![CDATA[Olaide Kashimawo]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 02:12:01 GMT</pubDate>
            <atom:updated>2022-08-04T02:12:01.998Z</atom:updated>
            <content:encoded><![CDATA[<p>#string #integer # beginners # convert</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tg-fpxjzTPVW2CSU5Tq34g.png" /></figure><p>The purpose of this blog is to converting string into integer in pandas dataframe when conducting data analysis. One can risk unexpected results and errors if Pandas assume the appropriate data types even though Pandas might also allow you to continue with analysis.</p><p>Let’s get down to the nitty gritty of this as quickly as possible.</p><p>Datasets have both numerical and categorical elements in their structures. The term “string data types” refers to categorical properties, both of which are easily comprehended by human beings. However, computers are unable to analyze categorical data in the same way that humans can. Therefore, in order to proceed with the processing, the categorical data need to be turned into numerical data.</p><p>There are a number of different approaches to converting category data into numerical data. In the next paragraphs of this post, we will go through the two method that are utilized the most frequently.</p><p><strong>Method Used</strong></p><p><strong>What is Dummy Variable Encoding?</strong><br>Dummy encoding uses N-1 features to represent N labels/categories.</p><p>This categorical data encoding method transforms the categorical variable into a set of binary variables (also known as dummy variables)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TatNkybq2rClRLDf_DTktw.png" /></figure><p>Let’s speak about the get_dummies function in the Pandas environment now that you have an understanding of what dummy variables are.</p><p>As you can assume, pd.get_dummies creates dummy variables<br><strong><em>pandas.get_dummies()</em></strong> is used for data manipulation. It converts categorical data into dummy or indicator variables.</p><p>The pd.get_dummies method can generate dummy variables from a Pandas Series or a column or columns within a Pandas dataframe.</p><p><strong>Syntax</strong><br><em>pandas.get_dummies(data_object, prefix=None, prefix_sep=’_’, dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=None)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4C2Jpz-w9z6azpv50qnkw.png" /></figure><p>Example: USE GET_DUMMIES ON A DATAFRAME COLUMN</p><pre>pd.get_dummies(sales_data, columns = [&#39;r&#39;])</pre><p>OUT:</p><pre>    name     sales           r_East     r_North       r_South<br>0   William  50000            1             0             0            <br>1      Emma  52000            0             1             0            <br>2     Sofia  90000            1             0             0            <br>3    Markus  34000            0             0             1            <br>4    Edward  42000            0             0             0            <br>5    Thomas  72000            0             0             0            <br>6     Ethan  49000            0             0             1            <br>7    Olivia  55000            0             0             0            <br>8      Arun  67000            0             0             0            <br>9     Anika  65000            1             0             0            <br>10    Paulo  67000            0             0             0            </pre><p>In this new dataframe, the previous region variable is no longer present.</p><p>It was replaced by four new variables: region East, region North, region South</p><p>Pandas get_dummies has therefore generated a new 0/1 variable for each level of the original categorical variable.</p><p><strong>What is Label Encoding?</strong></p><p><strong>LabelEncoder() </strong>from<strong> sklearn </strong>library converts categorical data to numerical data.</p><p>For instance, if a dataset contains the variable ‘Gender’ with the labels ‘Male’ and ‘Female,’ the label encoder would convert these labels into a number format, yielding [0,1].</p><p>We will use function <strong>fit_transform() </strong>in the process.</p><p><strong>Syntax<br></strong><em>it_transform(y)<br>Parameters :<br>y : array-like of shape (n_samples). Target Values.<br>Returns : array-like of shape (n_samples) .Encoded labels.</em></p><p><strong>Example:</strong></p><p>It is evident from the preceding dataset that the variable ‘Gender’ has labels ‘M’ and ‘F’. Additionally, let’s import the LabelEncoder class and apply it to the dataset’s ‘Gender’ variable.</p><p><strong>from</strong> sklearn <strong>import</strong> preprocessing</p><p>label <strong>=</strong> preprocessing.LabelEncoder()</p><p>block[&#39;Gender&#39;]<strong>=</strong> label.fit_transform(block[&#39;Gender&#39;])</p><p>print(block[&#39;Gender&#39;].unique())</p><p>Output:</p><p>print(block)</p><p><strong>Output:</strong></p><p>Gender NAME</p><p>0 1 John</p><p>1 0 Camili</p><p>2 0 Rheana</p><p>3 1 Joseph</p><p>4 0 Amanti</p><p>5 0 Alexa</p><p>6 0 Siri</p><p><strong>Label Encoding has a limit</strong>.</p><p>To make the data machine-readable, the data is labeled, which assigns a random number (beginning at 0) to each class of information.As a result of this, the training of data sets may generate prioritization concerns.If a label has a high value, it may be more important than a label with a low value.</p><h3><strong>Conclusion</strong></h3><p>This brings an end to the discussion over this given topic.</p><p>In the event that you have any questions, please feel free to leave a comment below.Implementing the idea of a Label Encoder on a variety of datasets and variables can help you acquire a more in-depth comprehension of the subject matter.</p><p>Please share your thoughts and experiences with us in the comment area!</p><h3>Related Resources:</h3><ul><li><a href="https://www.geeksforgeeks.org/ml-label-encoding-of-datasets-in-python/?ref=lbp">ML | Label Encoding of datasets in Python - GeeksforGeeks</a></li><li><a href="https://www.geeksforgeeks.org/how-to-create-dummy-variables-in-python-with-pandas/">How to Create Dummy Variables in Python with Pandas? - GeeksforGeeks</a></li><li><a href="https://www.geeksforgeeks.org/how-to-create-dummy-variables-in-python-with-pandas/">How to Create Dummy Variables in Python with Pandas? - GeeksforGeeks</a></li><li><a href="https://www.sharpsightlabs.com/blog/pandas-get-dummies/#example-2">How to Use Pandas Get Dummies in Python - Sharp Sight</a></li><li><a href="https://realpython.com/courses/convert-python-string-int/">Convert a Python String to int - Real Python</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b35b6a88c6cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>