<?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 l_ay1w0la on Medium]]></title>
        <description><![CDATA[Stories by l_ay1w0la on Medium]]></description>
        <link>https://medium.com/@abdulrahimibrahimolayiwola?source=rss-b43d282ba417------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sgGBxbaWJJIg_Ea675PZ_Q.jpeg</url>
            <title>Stories by l_ay1w0la on Medium</title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola?source=rss-b43d282ba417------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:07:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdulrahimibrahimolayiwola/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[Handling Missing Values In Your Data]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/handling-missing-values-in-your-data-d6b31f1a80d2?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6b31f1a80d2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 16:53:54 GMT</pubDate>
            <atom:updated>2024-01-16T16:53:54.618Z</atom:updated>
            <content:encoded><![CDATA[<p>Dirty datasets, every data professionals headache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*CJh_RWQBT-_lOPAM" /></figure><p>More often than not when starting out with machine learning you practice with fairly clean datasets like the ones on kaggle, but as you begin to work on more problems you realise clean data is not very common.</p><p>In this article we will look at different methods of handling missing data and how to implement them in python. A quick disclaimer, there isn’t a perfect way to handle missing data to get back exactly what was lost, the goal is to get the best results possible.</p><blockquote>Simply put you would be experimenting alot.</blockquote><h4>Types Of Missing Data</h4><p>Before we can even discuss how to fill in these missing values we need to what kind of missing values we are dealing with.</p><p>There are generally 3 categories of missing values:</p><p>○ Missing Completely at Random (MCAR).</p><p>○ Missing at Random (MAR).</p><p>○ Missing Not at Random (MNAR).</p><ol><li><strong>Missing Completely at Random (MCAR): </strong>with MCAR the fact that the data is missing is completely unrelated to any observed or unobserved values, there is no clear difference between records with missing and complete data.<strong> </strong>Imagine you are hosting a party, and people randomly choose whether or not to wear a party hat. If someone forgets their hat, it’s entirely random and not influenced by any factors like age, gender, or mood.</li></ol><blockquote>This rarely occurs in real life except in controlled environments, affirming if data is truly missing completely at random can be challenging in practice.</blockquote><p>2.<strong> Missing at Random (MAR):</strong> If the probability of data being missing is related to an yobserved variables this is MAR. Imagine you are at a coffee shop, and people decide whether or not to order a particular type of coffee based on the temperature outside. If the decision to order that specific coffee is related only to the observed variable (temperature) and not influenced by any other factors, then it’s missing at random.</p><p>3. <strong>Missing Not at Random (MNAR)</strong>: In this case the fact that the data is missing is related to unobserved variables (aka the missing variable itself or other missing variables). Imagine you are conducting a survey about sleep quality, and participants decide whether to disclose their sleep issues based on the severity of their sleep problems. If those with more severe sleep problems are less likely to report their issues, the missing data is not random and is related to the unobserved variable (severity of sleep problems).</p><h4>Handling missing data</h4><p>There are two general ways to deal with missing data</p><p>Deleting missing data</p><p>Imputation</p><h4>Deleting missing values</h4><p>First as a kind of warning deletion is generally not advised especially when you have a large percentage of missing values and more often than not leads to bias in your dataset.</p><p>Generally as long as your perecentage of missing values is less than 5% deletion is still adviseable.</p><blockquote>Depending on the nature of your data 5% may still be much. for example say you have a classification task but there’s a certain level of class imbalance and that 5% makes up a majority of the smaller class, deletion isn’t a good idea then.</blockquote><h4>List-wise deletion (row-wise)</h4><p>The most commonly used deletion method is list-wise deletion. With this method you remove a record or observation if it has any missing values.</p><p>This can be implemented using the .dropna method in pandas.</p><pre>df.dropna(axis=0, inplace=True)</pre><h4>Column-wise deletion</h4><p>Another method would be column wise deletion. It’d be easier to explain this with an example, say you have some data and a particular column has about 80% of its values missing, list-wise deletion wouldn’t make sense here and even imputation may not be as effective. In the situation you can simply drop that specific column.</p><p>This can be done using the .drop method in pandas.</p><pre># Assuming &#39;column_name&#39; is the name of the column you want to drop<br>df.drop(&#39;column_name&#39;, axis=1, inplace=True)<br><br># And if you need to drop a list of columns<br>df.drop([&#39;col1&#39;,&#39;col2&#39;,&#39;col3&#39;], axis=1,inplace=True)</pre><h4>Imputation</h4><p>There are different methods of imputation mean/median imputation for numerical variables or mode imputation for categoricals, we can also take this a step further by building regression or knn models to estimate the missing values.</p><h4>Mean/Median Imputation</h4><p>This method is fairly simple you just replace the missing values in a specific column with the mean or median of non missing values.</p><p>With this method it is important to note it’s most ideal when we have a normal distribution. This is not always possible.</p><blockquote>Infact i almost always notice a certain level of skew.</blockquote><p>In cases were the distribution is not normal median imputation is far more reliable than the mean since it’s less sensitive to outliers.</p><p>These can be done using the .mean and .median functions in python alongside .fillna in pandas.</p><pre># Using mean imputation on a specific column<br>mean_to_impute = df[&#39;col&#39;].mean()<br>df = df[&#39;col&#39;].fillna(mean_to_impute)<br><br># Using medain imputation on a specific column<br>median_to_impute = df[&#39;col&#39;].median()<br>df = df[&#39;col&#39;].fillna(median_to_impute)<br><br># Using mean or median imputation on an entire dataset<br>to_impute = df.mean() #or.median()<br>df = df.fillna(to_impute)<br><br>#The above code fills all the nulls in each column with the mean in that column<br></pre><h4>Mode Imputation</h4><p>This is also a simple method but unlike with mean and median imputation which work with only numerical values this works with only categorical ones.</p><p>It replaces missing values with the most common value in thier specific column.</p><p>Implementing this in python is pretty much the same as median and mean, you just use the .mode function instead.</p><h4>KNN imputation</h4><p>K-Nearest Neighbors (KNN) imputation technique fills in missing values in a dataset by considering the values of neighboring data points. The idea is to estimate the missing values based on the values of other data points that are most similar to it.</p><p>To use this method we would have to define a distance metric, identify the ideal k nearest neighbors (k represents the number of neighbors to be considered), then calculate the weighted average or perform majority voting to figure out what value to impute.</p><p>Thankfully the sklearns KNNImputer abstracts all this. To implement this in python.</p><pre>from sklearn.impute import KNNImputer<br># Instantiate KNNImputer with 2 neighbors (it could be any number you choose)<br>imputer = KNNImputer(n_neighbors=2)<br><br># Fit and transform the data<br>imputed_data = imputer.fit_transform(df)</pre><h4>Regression Imputation</h4><p>Regression imputation fills in missing values in a dataset by predicting them based on the relationships observed in the rest of the data. It involves using regression models to model the relationships between variables and then using these models to predict the missing values.</p><p>To do this you first have to identify the variables the column with missing values is dependent on then split your data into two parts one with no nulls and the rest with the nulls.</p><p>Build a regression model with the clean split then use that model to predict the missing values.</p><h4>Conclusion</h4><p>In this article we’ve covered some of the more common methods of dealing with missing values, with each one having it’s pros and cons the best way to figure out which to use is to experiment.</p><blockquote>What is machine learning if not experimentation.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6b31f1a80d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Titanic Survival Prediction: Decision Trees and Cross-Validation (Grid Search).]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/titanic-survival-prediction-decision-trees-and-cross-validation-grid-search-2c39877e1d4a?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c39877e1d4a</guid>
            <category><![CDATA[kaggle-competition]]></category>
            <category><![CDATA[crossvalidation]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[grid-search]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 22:33:02 GMT</pubDate>
            <atom:updated>2023-10-31T22:38:41.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*sZMswzoRLHfk08px" /></figure><p>Hey there, if you’re a beginner in the field of machine learning, you’ve probably heard of the Titanic survival prediction competition on Kaggle.</p><blockquote>You know, the one they say is the ideal “beginner task” <em>☠️.</em></blockquote><p>If you’re anything like me, you may have encountered some initial challenges</p><blockquote>Maybe aiming for the top of the leaderboard in one go was wishful thinking.</blockquote><p>But don’t worry! This article aims to guide you on how to complete this task from data cleaning to hyperparameter tuning and submitting your results on Kaggle.</p><h4>What is the competition about, anyway?</h4><p><strong>Dataset</strong>: Participants are provided with a dataset containing information about passengers who were aboard the Titanic during its first and last voyage in 1912. This dataset includes details such as passengers’ names, ages, genders, ticket class, cabin information, and whether they survived or not (what we hope to predict).</p><p><strong>Objective</strong>: The primary goal of the competition is to build a machine learning model that can predict whether a passenger on the Titanic survived or not based on the provided data.</p><p><strong>Evaluation</strong>: The competition typically uses accuracy as the evaluation metric. The models are assessed based on how well they predict whether a passenger survived or not.</p><p>Now that I’ve given a brief overview of the task, let’s have a look at our toolkit.</p><p>For this article, we will be using Python libraries: Pandas, NumPy, and Scikit-learn, and implementing a Decision Tree classifier model using grid search for cross-validation and hyperparameter tuning.</p><h4>Understanding the data</h4><p><strong>The columns.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*J8pTw6ffrhmHQBL7G_nR_g.png" /></figure><h4>Data preparation</h4><h4>Importing libraries and data</h4><p>importing libraries……..</p><pre>import pandas as pd<br>import numpy as np<br>import seaborn as sns<br>from sklearn.model_selection import train_test_split<br>from sklearn import metrics<br>from sklearn.tree import DecisionTreeClassifier<br>import matplotlib.pyplot as plt<br>import seaborn as sns</pre><p>importing data………</p><p><em>I wrote my code in a kaggle noteboook if you were using jupyter notebook, you’d need to download the data locally and impute the location of the file on your system i.e(r”C:\Users\USER\Downloads\titanic.csv”)</em></p><pre>titanic = pd.read_csv(r&quot;/kaggle/input/titanic/train.csv&quot;)<br>test = pd.read_csv(&quot;/kaggle/input/titanic/test.csv&quot;)</pre><p><em>I had a reason for naming train.csv titanic rather than train which i’ll get to.</em></p><h4>First look at the data</h4><pre>print(&quot;Titanic&quot;)<br>display(titanic.head())<br>print(&quot;Test&quot;)<br>display(test.head())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*Wu0yJzlZ5C8XH5n1Gow14A.png" /></figure><p>We see that the test and train data are pretty similar except the test data doesn’t have a survived column.</p><p>For this competition we will be training using only our training data.</p><blockquote>That seems obvious lol.</blockquote><p>But what i mean is we will split the training data into training and validation then after selecting our best model we train it over the whole test set then predict.</p><h4>EDA</h4><p>I like to first do some EDA to understand what my data looks like before i get into cleaning as it helps make decisions easier.</p><p>Let’s see the survival ratios for both genders</p><pre>total_males = titanic[titanic[&quot;Sex&quot;] == &quot;male&quot;].shape[0]<br>male_survivors = titanic[(titanic[&quot;Survived&quot;] == 1) &amp; (titanic[&quot;Sex&quot;] == &quot;male&quot;)]<br>ratio_male_survivors = len(male_survivors) / total_males<br>print(&quot;Ratio of male survivors over total males:&quot;, ratio_male_survivors)</pre><p>Output -&gt; Ratio of male survivors over total males: 0.18890814558058924</p><pre>total_females = titanic[titanic[&quot;Sex&quot;] == &quot;female&quot;].shape[0]<br>female_survivors = titanic[(titanic[&quot;Survived&quot;] == 1) &amp; (titanic[&quot;Sex&quot;] == &quot;female&quot;)]<br>ratio_female_survivors = len(female_survivors) / total_females<br>print(&quot;Ratio of female survivors over total females:&quot;, ratio_female_survivors)</pre><p>Output -&gt; Ratio of female survivors over total females: 0.7420382165605095</p><p>Plotting histograms to understand data distribution</p><pre># Specify the columns you want to plot<br>cols = [&quot;Survived&quot;, &quot;Pclass&quot;, &quot;Age&quot;, &quot;Parch&quot;, &quot;SibSp&quot;]<br><br>fig, axes = plt.subplots(1, 4, figsize=(16, 4))<br><br>for i, column in enumerate(cols):<br>    ax = axes[i]<br>    titanic[column].plot(kind=&#39;hist&#39;, bins=20, ax=ax)<br>    ax.set_title(f&#39;Histogram of {column}&#39;)<br>    ax.set_xlabel(column)<br>    ax.set_ylabel(&#39;Frequency&#39;)<br><br>plt.tight_layout()  <br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*7ykKYE0Ji_5k35VbPLyQiQ.png" /></figure><p>We see the age column has a fairly normal distribution.</p><blockquote>It’s bell shaped, mostly</blockquote><p>We have more deaths than survivals</p><p>More 3rd class than 1st and more 1st than 2nd class passangers.</p><p>Most passangers didn’t travel with their parents or siblings.</p><p>The fare column is skewed towards the left, most passangers paid less than 100 pounds for their tickets.</p><h4>Data Cleaning</h4><p>First we check for null values in the datasets</p><pre>print(titanic.isna().sum(),&quot;--------------------------------&quot;,test.isna().sum(),sep=&quot;\n&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*o9QHs7dG0MsgSVHyh3awGw.png" /></figure><p>We see we have some null values in the data, the cabin column is mostly filled with nulls in the training set so i will be ignoring it in my model.</p><p>We use mean imputation to handle nulls in the training and test data</p><pre>titanic[&quot;Age&quot;].fillna(titanic[&quot;Age&quot;].mean(), inplace=True)<br>test[&quot;Age&quot;].fillna(test[&quot;Age&quot;].mean(),inplace=True)</pre><blockquote>You could also consider building a model to predict possible ages, but looking at the plots we see the age column has a fairly normal distribution, so i chose the mean to save time.</blockquote><p>Some columns on fare are missing in the test data set.</p><p>I filled them using the average fare price for each passenger class.</p><pre>mean_fare_by_pclass = test.groupby(&quot;Pclass&quot;)[&quot;Fare&quot;].transform(&quot;mean&quot;)<br><br># Use the calculated means to fill missing values in the Fare column<br>test[&quot;Fare&quot;].fillna(mean_fare_by_pclass, inplace=True)</pre><h4>Data Transformation</h4><h4>Label Encoding</h4><p>We need to convert the “Sex” column in the dataset into a numerical format that can be effectively utilized by machine learning models for modeling and analysis. This conversion is referred to as “label encoding.”</p><pre>titanic[&quot;Sex&quot;] = titanic[&quot;Sex&quot;].replace(&quot;male&quot;, 0).replace(&quot;female&quot;, 1)</pre><p>This task is relatively straightforward, so I use the Pandas .replace function. For more complex scenarios, you can consider importing Scikit-Learn&#39;s OneHotEncoder function or using Pandas&#39; pd.get_dummies.</p><h4>What features go into the model?</h4><p>Now that our data is clean, and we understand it the next thing is feature selection. The names, passenger id’s, and ticket don’t seem important to our predictve model.</p><blockquote>Although maybe extracting the title from the names could tell us something more about who was onboard the Titanic.</blockquote><p>Leaving these three and the cabin column out we will be training our model with these</p><pre>feat = [&#39;Pclass&#39;,&#39;Sex&#39;,&#39;Fare&#39;,&#39;Embarked&#39;,&#39;SibSp&#39;,&#39;Parch&#39;,&#39;Age&#39;] <br>x = pd.get_dummies(titanic[feat])<br>y = titanic[&quot;Survived&quot;]<br>test = pd.get_dummies(test[feat])</pre><p>This particular task has few features to begin with so i won’t be using more advanced feature selection techniques.</p><h4>Feature scaling</h4><p>Feature scaling is important to ensure that all features have a consistent scale, which aids in the performance, convergence, and stability of machine learning models.</p><blockquote>I will use the “StandardScaler” for this, although “MinMax scaling” is also possible, but it’s sensitive to outliers.</blockquote><pre>from sklearn.preprocessing import StandardScaler<br>scale = StandardScaler()<br>x = scale.fit_transform(x)<br>test = scale.fit_transform(test)</pre><p>Data Split</p><p>Now that we finally have our data fully prepped, we need to split the titanic data into training and test(technically validation, since it’s not our final test set).</p><pre>from sklearn.model_selection import train_test_split<br>x_train,x_test,y_train,y_test = train_test_split(x,y,test_size=0.2,random_state=5,stratify= titanic[[&quot;Pclass&quot;,&quot;Sex&quot;]])</pre><p>Finally the fun part our project.</p><h4>The Decision Tree</h4><p>Incase you aren’t quite clear on what cross validation is, or don’t know about it.</p><blockquote>Don’t worry I did’nt understand the first time either.</blockquote><p>Cross-validation (CV) is a technique to assess a model’s performance. It involves splitting data into training and testing sets. Grid search is a method used in CV to systematically explore various combinations of model settings to find the best one.</p><blockquote>It’s like giving a student multiple quizzes, each with a different set of questions (representing different training and testing data splits) and measuring their performance on each quiz. Then, you use the quiz where the student had the best overall performance to assess their knowledge.</blockquote><h4>Implementing the model.</h4><pre>from sklearn.tree import DecisionTreeClassifier<br>from sklearn.model_selection import GridSearchCV<br>from sklearn import metrics<br><br># Create the Decision Tree classifier<br>clf = DecisionTreeClassifier(random_state=5)<br><br># Define a grid of hyperparameters to search<br>param_grid = {<br>    &#39;criterion&#39;: [&#39;gini&#39;, &#39;entropy&#39;],<br>    &#39;max_depth&#39;: [3,5,8,None],<br>    &#39;min_samples_split&#39;: [2,4,5],<br>    &#39;min_samples_leaf&#39;: [1, 2, 4],<br>}<br><br># Create the GridSearchCV object<br>grid_search = GridSearchCV(clf, param_grid, cv=5)<br><br># Fit the grid search to the training data<br>grid_search.fit(x_train, y_train)<br><br># Get the best model from the grid search<br>best_model = grid_search.best_estimator_<br><br># Make predictions on the test set using the best model<br>pre = best_model.predict(x_test)<br><br># Print the classification report<br>print(metrics.classification_report(y_test, pre))</pre><p>From the classification report we notice an accuracy of 78%.</p><p>Now to run this model over the whole data then submit our final predictions</p><pre>best_estimator = grid_search.best_estimator_<br>print(best_estimator)</pre><p>Outputs this → DecisionTreeClassifier(criterion=’entropy’, max_depth=3, random_state=5)</p><p>This output is our decision tree after all ideal hyperparameters for optimal model efficiency have been selected(hyperparameter tuning).</p><h4>Final Predictions</h4><p>I have written a function to train our best estimator using the entire dataset. It will then make predictions for the test data and create a CSV file containing passenger IDs and their corresponding results.</p><pre>def makepred(test_data,pid):<br>    best_estimator.fit(x,y)<br>    preds = best_estimator.predict(test_data)<br>    z = pd.read_csv(pid)<br>    if len(preds) == len(z):<br>        new_df = pd.DataFrame({&#39;PassengerId&#39;: z[&#39;PassengerId&#39;]})<br>        new_df[&#39;Survived&#39;] = preds<br>        new_df.to_csv(&#39;/kaggle/working/submission.csv&#39;, index=False)<br>        return&quot;All is well&quot;<br>    else:<br>        return&quot;error predictions and id&#39;s not same shape&quot;</pre><p>Implementing it……………..</p><pre>print(makepred(test,r&quot;/kaggle/input/titanic/test.csv&quot;))</pre><p>With this model, we achieved an accuracy of 77.27% on the test data after submission, which indicates that the model is not overfitting. However, when I removed the “Age” feature from the model’s features, the accuracy increased to 78.29%, increasing accuracy by 1%.</p><p>You may be wondering “why add the age column in this walkthrough”.</p><p>It’s to show that with machine learning models, the quality of results is directly proportional to the quality of data.</p><blockquote>Garbage in Garbage out.</blockquote><p>Best of luck on your machine learning adventures!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c39877e1d4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conquering your fears : The fear of public speaking]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/conquering-your-fears-3182497b657a?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/3182497b657a</guid>
            <category><![CDATA[fear-of-failure]]></category>
            <category><![CDATA[presentations]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 19:24:24 GMT</pubDate>
            <atom:updated>2023-10-19T00:57:31.215Z</atom:updated>
            <content:encoded><![CDATA[<p>I was hesitating on whether or not to write this, but what do I stand to lose?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*0aiZCx71tE43P3qU.jpg" /></figure><p>This article wouldn’t be complete without a backstory on how this fear started.</p><h4>How It All Began:</h4><p>I’ve always been the shy type. It takes me weeks to simply smile and months to finally say hi. However, this fear of public speaking became cemented in my mind about six years ago.</p><p>Coming into the event, I thought it was just a few people, nothing too serious.</p><blockquote>Boy, was I wrong.</blockquote><p>I was to present in a filled-up auditorium. Looking at the crowd from the stage, my mind had gone blank, and I could hear my own heartbeat. Thankfully, it was a group presentation, so the repercussions of my fear were not too severe, but just the thought of having to feel that way has kept me from going on a stage ever since.</p><p>Well, that changed on October 14th, 2023. My team had made it to the top 5 of DatafestAfrica’s hackathon, and the final stage involved a presentation of our project on stage.</p><p>When I received the email, I initially felt excited, but then came a sense of dread as I realized I’d be on stage in front of over 1000 people.</p><h4>The Experience:</h4><p>Fast forward to the 13th of October, the first day of the event. I remember entering the hall, looking up at the stage and thinking,</p><blockquote>Abi make i just flake this presentation. I didn’t and it’s a decision i do not regret.</blockquote><p>The presentation was to happen at 11 am in the morning. I had overslept, so I got to the event by 10 am.</p><blockquote>In hindsight maybe staying up till 2am was a bad idea.</blockquote><p>Arriving there and being told my team would be going up on stage first felt like adding salt to a wound.</p><blockquote>I was petrified.</blockquote><p>I guess it wouldn’t be right to talk about this experience without mentioning my teammates, from Tolu who seemed more panicky than me, trying to convince us we’d be fine, to Hope who looked equally terrified but gave a smile.</p><blockquote>I couldn’t have done it without their nudging me on, to be honest.</blockquote><p>11 am comes, we get called on stage. I stepped up and realized I was wearing slides to the event.</p><blockquote>Another reason not to stay awake past midnight.</blockquote><p>Well, it was too late to correct that. I tried to start, but that familiar anxiety returned. I couldn’t make eye contact, my heart raced, and I felt as though I had gone deaf. My smile disappeared, and even the smallest change in my tone was noticeable.</p><blockquote>The only thought I had in that moment was, “Ibrahim, please don’t mess up.”</blockquote><p>Let’s get to the main reason why you’d read this,</p><h4>The How?</h4><p>How did I quell this fear of mine?</p><blockquote>The truth is i didn’t, the fear and anxiety will probably come back my next time on stage, the only difference is next time i’d know i can push through.</blockquote><p>How did I manage this fear?</p><p>Well this i have an answer to, i prepared myself,</p><p>I branded my lines into memory, i still remember atleast half right now, that is not to say memorization is the key.</p><p>I had done this to give myself confidence that i wouldn’t make a mistake, personally i believe if you can convince yourself you can do it, it gets a whole lot easier to do so.</p><p>The other thing that helped, although cliché was to take a deep breath, clear my mind and start speaking.</p><blockquote>By clearing my mind, i mean fears not what i intend to say of course.</blockquote><p>I want to give a shoutout to the hosts. Their encouraging smiles and nods gave me the extra push I needed to start.</p><p>Once I got those first words out, the rest came more naturally. I kept talking and thinking, ‘Oh, I haven’t made a mistake yet’, or ‘Oh, my voice isn’t quaking’. I remember finishing, and all I wanted to do was run down the stage.</p><blockquote>Thinking back, it wasn’t the best I could do, but a lot better than how I thought I would do, and that’s a win in my book.</blockquote><p>A lesson I’ve learned and will implement in my future stage appearances is to engage with the audience. Now that I know I can do it, I’ll focus on doing it better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3182497b657a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding The Logic Behind The Naive Bayes’ Classifier.]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/understanding-the-logic-behind-the-naive-bayes-classifier-3de63478d83e?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/3de63478d83e</guid>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[bayes-theorem]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 03 Oct 2023 17:17:33 GMT</pubDate>
            <atom:updated>2023-10-03T19:58:30.426Z</atom:updated>
            <content:encoded><![CDATA[<p>The Naive Bayes Classifier is a probabilistic classification method based on Bayes’ Theorem.</p><p>The naive Bayes’ classifier is called naive because it assumes the independence of each input variable. This assumption may not be realistic for real data.</p><p>If there were little to no relationship between input variables this would have no effect on predictive ability. However, in cases where there is a strong relationship between variables the classifier would be blind to it and would lead to issues.</p><p>For a naive Bayes’ classifier all varibles are considered equally important.</p><blockquote>It’s a classification method that relies on probability.</blockquote><p>To understand how the classifier works we first need to address Bayes’ theorem.</p><h4>Bayes’ Theorem.</h4><p>The Bayes Theorem is a mathematical formula that determines the likelihood of an event happening given another event that has already occured. The mathematical expression for Bayes’ theorem can be writen as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/0*zD-_8M8xU9lmda3r" /></figure><ul><li><em>P</em>(<em>A</em>∣<em>B</em>) represents the probability of event A occurring given that event B has occurred.</li><li><em>P</em>(<em>B</em>∣<em>A</em>) is the probability of event B occurring given that event A has occurred.</li><li><em>P</em>(<em>A</em>) and <em>P</em>(<em>B</em>) are the probabilities of events A and B occurring independently.</li></ul><blockquote>What we are simply trying to do is calculate the chance that an event A will occur if an event B has already occured.</blockquote><h4>How The Naive Bayes’ Classifier Works.</h4><p>For instance, consider a model designed to classify an animal as either a Cat, Dog, or Ostrich. The feature matrix contains information about the sound the animal makes, the number of legs it has, and whether it can fly.</p><blockquote>Yes i know none fly.</blockquote><p>Suppose we have a feature vector where the number of legs is 4. The probaility of it being an ostritch is 0, while it’s 0.5 for both a cat and a dog. If the sound it makes is a bark, even though the probability of it being a cat isn’t zero, the probability of it being a dog is much higher. Therefore, the Bayes’ classifier labels that particular animal as a dog.</p><blockquote>The classifier selects the category with the highest probability as the predicted label.</blockquote><p>What the classifier does is attempt to maximize Pr(Y = j|X = x₀), where:</p><ul><li>Y is the actual label.</li><li>j is the predicted label.</li><li>x₀ is the observed predictor (variable).</li><li>x₀ is the observed predictor (variable).</li></ul><blockquote>Yes cat’s can bark, i was shocked too<em>! 😅</em>.</blockquote><p>While it would be nice to rely on the Bayes’ classifier in all scenarios, often, when dealing with real-world data, we do not know the conditional probability of A given B.</p><blockquote>In simpler terms, we often don’t have precise information about the likelihood of a label being correct when an input variable possesses a specific value.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3de63478d83e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Numpy Arrays All You Need To Know -Part 2]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/numpy-arrays-all-you-need-to-know-part-2-88e5c4add4a8?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/88e5c4add4a8</guid>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[numpy]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 22:37:47 GMT</pubDate>
            <atom:updated>2023-09-18T22:37:47.501Z</atom:updated>
            <content:encoded><![CDATA[<p>indexing, slicing, filtering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*tnKbYwDqp4Q9dTBA.png" /></figure><h3>What do we mean by indexing</h3><p>Indexing is a way to access individual elements within a collection of items. An index is like a unique address or a number that tells you where to find something in a collection</p><blockquote>Think of it like houses on a street. If you wanted to send mail you’d put your street name and number. The street number acts as the index</blockquote><h3>Indexing Numpy arrays.</h3><p>NumPy arrays are “<strong>zero-based</strong>”, meaning the first element of an array is assigned index 0 not 1.</p><p>We can also use negative indexing.</p><blockquote>-1 represents the last element, -2 represents the second to the last and so on</blockquote><h4>Accessing individual elements of an array.</h4><p>To get the first element of a 1-D array</p><pre>import numpy as np<br><br># Creating a NumPy array<br>arr = np.array([1, 2, 3, 4, 5])<br><br># Accessing individual elements<br>element_at_index_0 = arr[0]<br>print(element_at_index_0)<br><br># This outputs: 1</pre><p>To get the element on the third row last column in a 2-D array</p><pre>import numpy as np<br><br># Creating a NumPy array<br>arr = np.array([[1, 2, 3, 4, 5],[2,3,4,5,6],[1,2,7,4,5]])<br><br><br># Accessing individual elements<br>element = arr[2,-1]<br>print(element)<br># outputs 5</pre><h3>Slicing NumPy arrays</h3><h4>What is slicing?</h4><p>In python slicing means taking all the elements from on index to another. This is done using [start : stop].</p><blockquote>When slicing python takes all elements from the start index to the element just befor the stop index</blockquote><p>We can also define how many steps we want to move when slicing. This is done using [start: stop : step].</p><blockquote>If you dont define a start, python takes index 0 as the start i.e.([:5]), If you dont pass end it slicing till the end of the array and the default value for step is 1.</blockquote><p>slicing from the second to last element with step set as 2 in a 1-D array</p><pre>import numpy as np<br><br># Creating a NumPy array<br>arr = np.array([1, 2, 3, 4, 5,6,7,8])<br><br># slicing<br>print(arr[1::2])<br>#outputs [2,4,6,8]</pre><p>Slicing a 2-D array</p><p>Getting the 2nd and 3rd element from the second row</p><pre># Creating a NumPy array<br>arr = np.array([[1, 2, 3, 4,5],[5, 6, 7, 8, 9]])<br><br># Accessing a slice of an array<br>element = arr[1,1:3]<br>print(element)</pre><h3>Filtering NumPy Arrays</h3><p>Unlike like lists where you have to iterrate over it’s elements then filter on each individual one. NumPy arrays offer a more efficient approach. With arrays, you can apply filtering operations to the entire array as a whole.</p><p>We want only array elements greater than 10.</p><pre>import numpy as np<br><br>arr = np.array([5,6,7,7,8,15,12,6,41, 42, 43, 44])<br><br># This creates a filter for your array.<br>array_filter = arr &gt; 10<br>print(array_filter) <br><br># Printing this outputs a list of boolean values, if the element meets the<br># condition it returns True else it returns False.<br><br>print(arr[array_filter])<br># Printing this returns an array containing only values which match the condition.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88e5c4add4a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Numpy Arrays All You Need To Know -Part 1]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/numpy-arrays-all-you-need-to-know-part-1-dd357b78fe6b?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd357b78fe6b</guid>
            <category><![CDATA[numpy-array]]></category>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 05 Sep 2023 15:13:36 GMT</pubDate>
            <atom:updated>2023-09-05T15:13:36.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*So5VJHshUfIOfFY8.png" /></figure><h3>What is numpy?</h3><p>Numpy stands for numerical python, it’s a python library for numerical and scientific computing. It gives support for multi-dimensional arrays and matrices which are what we will be discussing in this article.</p><h3>What are arrays ?</h3><p>An array is a data structure used to store a collection of elements, each element is identified by an index which represents its position in the array.</p><p>Now you may be thinking whats the difference between an array and list 🤷🏽, they seem to be the same but the difference lies in their limitations and capabilities.</p><h3>The difference between arrays and lists</h3><ul><li><strong>Data types</strong> : Lists in Python can store items of different data types while numpy arrays can <strong>only store items of the same data type</strong>. If you have an array of integers and add a string <strong>type conversion occurs making all items in said array a string</strong>.</li><li><strong>Mutability</strong> : Both lists and arrays are mutable but the key difference lies in what changes you can make to them after creation. With lists you can modify elements, add and remove elements, but with arrays while you can modify elements and even change the shape of the array, you cannot change the size of the array i.e. <strong>the number of elements in the array cannot change</strong>.</li><li><strong>Speed : </strong>This is one of the things that makes arrays the better choice for calculations. Lists are more flexible but may be slower for certain operations, especially when dealing with a large amount of numerical data. Arrays are <strong>highly optimized for numerical operations</strong>. They are implemented primarily in C and allow for efficient element-wise operations, making them the preferred choice for numerical computing tasks.</li></ul><p>now that we have highlighted the key differences next we need to look at what arrays can do and how to use them.</p><h3>Creating a NumPy array</h3><p>To create a numpy array first we have to import the library.</p><pre>import numpy as np<br>firstArray = np.array([1,2,3,4,5,6])<br>print(type(firstArray))<br><br># we can aslo use a tuple<br> secondArray = np.array((1,2,3,4,5,6))<br></pre><p>the np.array() function converts the list or tuple into an array.</p><h3>Dimensionality of arrays</h3><p>A dimension in array refers to a level of depth, the more levels you have the higher the dimension. arrays start from dimension 0 upward. You can think of them as nested lists.</p><blockquote>It may be hard to understand this way, personally I like to think of dimensions as floors of a building.</blockquote><p>We can check how many dimensions an array has using “<strong>.ndim</strong>” after the array name.</p><pre>ourArray = np.array([1,2,3,4,5,6])<br>print(ourArray.ndim)<br># This will return 1. Meaning it is a one dimensional array.</pre><h4>0-D arrays</h4><p>These are single values or elements in an array. A 0-dimensional array would have just one item</p><pre>import numpy as np<br>zeroD = np.array(20)<br>print(zeroD.ndim)<br># This will return zero</pre><h4>1-D arrays</h4><p>This is an array that is made-up of only zero dimensional arrays.</p><blockquote>They look like lists</blockquote><pre>import numpy as np<br>firstArray = np.array([1,2,3,4,5,6])</pre><h4>2-D arrays</h4><p>These are arrays that have 1-dimensional arrays as elements.</p><blockquote>You can refer to them as a list of lists</blockquote><pre>import numpy as np<br>firstArray = np.array([[1,2,3,4],[1,2,3,4,5,6]])</pre><blockquote>And it works the same upwards, 3-D arrays contain 2-D arrays, 4-D contain 3-D.</blockquote><p>You can also create higher dimensional arrays by passing in “<strong>ndim</strong>” as an argument in the “<strong>.array()</strong>” function.</p><pre>import numpy as np<br>firstArray = np.array([1, 2, 3, 4,5,6,7], ndmin=3)<br><br>print(firstArray)<br>print(&#39;How many dimensions :&#39;, firstArray.ndim)<br><br># The result is<br># [[[1 2 3 4 5 6 7]]]<br># many dimensions : 3</pre><h3>Shape</h3><p>The shape of an array is an attribute that tells us it’s size and dimensionality. We can get the shape of an array using the “.shape” method, this returns a tuple.</p><pre>import numpy as np<br>firstArray = np.array([1, 2, 3, 4,5,6,7], ndmin=3)<br><br>print(firstArray.shape)<br># (1, 1, 7). The shope shows us the arrays is 3-dimensional.</pre><p>The length of the resulting tuple represents the number of dimensions in an array</p><blockquote>A one dimensional array has a shape tuple like this : (3,). While a 3 dimensional one would be like this : (3,4,5).</blockquote><p>The multiplication of all values in the tuple will give the total number of elements in an array.</p><p>We can also use square brackets “<strong>[]</strong>” in addition to the shape method to select the number of rows and columns.</p><pre>import numpy as np<br>firstArray = np.array([1, 2, 3, 4,5,6,7], ndmin=3)<br><br>print(firstArray.shape[1],firstArray.shape[2])<br># 1 7<br># This code prints the number of 2-d arrays, 1-d arrays and single(0-d arrays)<br># values in the 3-d array.</pre><blockquote>The indexes refer to the level of the array youre interested in. The higher the index the deeper you go.</blockquote><p>Reshaping and array</p><p>We can add dimensions, remove them and even change the number of elements in each dimension using the “<strong>.reshape()</strong>” method.</p><pre># we are converting this 1-dimensional array into a 3-dimensional one<br>import numpy as np<br>firstArray = np.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])<br><br># we want to make it a 3-dimensional array with two 2-dimensional arrays each containing three 1-dimensional arrays with three elements<br># containing six 1-dimensional arrays.<br>print(firstArray.reshape(2,3,3))</pre><p>When reshaping the values of the tuples represent the number of element in each index so in the above code the first 2 in the tuple means two 2-dimensional arrays.</p><blockquote>A good rule of thumb to go by is make sure the product of all elements of the tuple remains unchanged after reshaping.</blockquote><p>I was originally going to write one article but it was getting to long so I split it into two. In my next article I will be addressing<strong> “indexing, slicing and subsetting numpy arrays”</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd357b78fe6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[University diaries : I survived first year .]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/university-diaries-i-survived-first-year-f6bb00911211?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6bb00911211</guid>
            <category><![CDATA[uni]]></category>
            <category><![CDATA[memories]]></category>
            <category><![CDATA[journaling]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 05 Sep 2023 00:13:25 GMT</pubDate>
            <atom:updated>2023-09-06T18:12:27.107Z</atom:updated>
            <content:encoded><![CDATA[<h3>University diaries : I survived first year 😭.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/0*nLqYw4Rv37-KAQqD.jpg" /></figure><p>I’m about to start my second year of university, and thinking back to my experience as a fresher, all I can say is <strong>OMO.</strong> From overcrowded classes that felt like ovens, to ASUU strikes, and exams. I almost forgot the hostels. They were undoubtedly the worst part of my uni experience. I’ll say more about them later.</p><blockquote>That’s not to say it was all bad, Overall it was an interesting experience.</blockquote><h3>The first day</h3><p>I wish I could write about how my first day on campus was some sort of enlightening or elevating experience, but all I did was spend the whole day searching for my classes and coursemates.</p><blockquote>Well, I found neither 💀.</blockquote><p>Thankfully I wasn’t the only one from my old school that made it in. Halfway through the day we simply gave up and walked around the campus grounds.</p><blockquote>Walking around aimlessly with friends and talking on campus was one of the not-so-bad things about uni.</blockquote><p>Not finding my classes didn’t cause me to fall behind though as nobody else had found them.</p><p>Who would have guessed while I was “searching” for my classes ASUU was planning a strike.</p><h3>The strike</h3><p>I still remember it like it was last year.</p><blockquote>Because it was last year.</blockquote><p>I was preparing for my matriculation only to see my WhatsApp notifications blowing up.</p><blockquote>“Abi we get test ni” was my first thought.</blockquote><p>Only to come online to see ASUU had announced they would be going on strike for a month starting the day after my matric.</p><p>When the first announcement was made the only thing on my mind was a month-long holiday let&#39;s go. I should have realized when the article stated “warning” strike, I was in for it. The first month was as wonderful as I thought it’d be.</p><blockquote>I was even getting a little round</blockquote><p>Then a three month extension of the strike was announced.</p><blockquote>At this point I knew wahala ti wa.</blockquote><p>I steeled my mind and decided to complete the syllabus during this period with the aim of getting ahead of my classes.</p><blockquote>Dreams of a young boy.</blockquote><p>Well it’s no surprise I didn’t finish it, I did work on improving my technical skills though. Anyway, Long story short after 8 months of ASUU please and Buhari why we were finally coming back to school.</p><blockquote>Dreams of graduating at 21 dashed. 💀</blockquote><h3>Coming back after a strike</h3><p>To say what I experienced on returning to classes was knowledge erosion would be an understatement, a knowledge implosion would be more accurate. I remember struggling with basic differential equations.</p><blockquote>Never Again.</blockquote><p>On resumption, the first thing we were told was exams were starting in December and tests in November.</p><blockquote>I remember thinking “One month till tests keh I don’t even know what’s going on in class “.</blockquote><p>Finally another one of the not-so-bad things about my experience. The pressure from exams and classes was suffocating but at the very least I knew I had a community of engineering students to rant with and learn together.</p><blockquote>Thinking back on it most of my best friends now are people I connected with based on the mutual sege we saw.</blockquote><h3>Night classes &amp; Hostel</h3><blockquote>These two might look odd together but you’ll see why I placed them side by side soon.</blockquote><p>Getting the letter confirming I had gotten accommodation felt so good, I would finally leave home, no more “Ibrahim come here”. Unbeknownst to me I would start to miss those “annoying” calls.</p><p>The first time in the hostel I walked into my room, a “six-man” room on paper, in actuality there were more than ten students. This wasn’t really an issue for me. I might be shy but I love talking so it was nice.</p><p>The hostels might have been delipidated, toilets unfit for human use, windows broken and water may have not worked but I did get to meet people from different backgrounds, and I learned a lot from the experience.</p><p>Now for why I put night classes together with hostels. While I liked my roommates, a full room with only one working fan was simply not conducive for reading</p><blockquote>Without engineering stressing me to the point where I didn’t care about the sate of the room I wouldn’t have found it conducive for sleep either.</blockquote><p>Once faculty classrooms were opened for night classes, I decided to attend to at least complete the uni experience, I’ll go just this time soon turned into almost every night for three weeks the moment I realized I slept and read better in the classrooms.</p><p>Thinking back I should have given my body more rest</p><p>The effects of back to back overnight reading is anybody’s guess, my body broke down a week to exams, and by the time we started our first paper I could barely take in any new information.</p><blockquote>Results were finally being released . 💀</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*05Ui7EOMVu_NsY0D.jpg" /></figure><blockquote>I might have not had evidence but I had an excuse.</blockquote><p>Now we get to why I named this article “I survived first year”.</p><h3>The illness</h3><p>After exams, I thought “Oh it’s the usual exam sickness from stress”. I couldn’t have been more wrong.</p><p>I had treated malaria and my results were negative but I was losing weight, running temperature, and experiencing severe fatigue.</p><blockquote>Who needs the gym when you can fall sick. 💀</blockquote><p>Fast forward a week to the second-semester resumption, my symptoms had gotten worse, and new ones began to crop up while my results remained negative.</p><p>Finally, I went to LUTH. The tests I did, I wouldn’t wish them on an enemy. Back-to-back blood tests.</p><blockquote>I’m terrified of needles.</blockquote><p>The blood tests were on the nicer side of the procedures I went through, I had to undergo a colonoscopy and endoscopy, At the time I didn&#39;t know what they meant but that just made them scarier. I know I shouldn’t have but I used Google and searched for images, Long story short wahala don dey. I remember entering the room and seeing it filled with medical students.</p><blockquote>All those people saw my bum ah. 😔</blockquote><p>The nurse brought out this fat tube,and immediately I thought “How will this thing reach my intestine”. Thankfully she said it was just to clean the area and what would go in would be very small.</p><blockquote>She lied!! It was not small.</blockquote><p>If I keep talking about the sickness I will never finish this article. I went through a few more tests.</p><blockquote>I might write about those later.</blockquote><p>Due to my illness, I pretty much missed the first two and a half months of classes, if not for elections it would have been a lot more.</p><h3>Resuming the second semester</h3><blockquote>At least in the first semester, I had something in my head that imploded, this time there was simply nothing.</blockquote><p>I arrived at my first class with nothing in my head and reduced motor skills looking back now all I can say is Alhamdulilah. I had resumed three weeks to my tests. It was both a blessing and a curse.</p><blockquote>Idan no dey fear sha. 😎</blockquote><p>Read eat sleep that was my daily routine till the test came. My performance wasn’t necessarily bad but it wasn’t good enough for me. I was relieved tests were finally over I could rest right?</p><blockquote>Of course, I couldn’t.</blockquote><p>Exams were 2 weeks away, A part of me was considering attempting the whole fuck sleep again and the other was still terrified by my hospital experience.</p><blockquote>PTSD won.</blockquote><p>Older people always emphasized good friends and it was at this moment I understood why.</p><p>I had friends teaching me and helping me get up to speed on my courses, We formed study groups and thankfully they paid off.</p><blockquote>My gpa go sha send text message, small evidence dey. 😌</blockquote><p>The Moral of the story, please rest.</p><p>Thank you for reading my little story till the end. If you enjoyed reading this, mafo I’ll write more soon. 😁</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6bb00911211" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding what CTEs in SQL are]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/understanding-what-ctes-in-sql-are-eaf59213437a?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/eaf59213437a</guid>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Wed, 09 Aug 2023 23:54:21 GMT</pubDate>
            <atom:updated>2023-08-12T16:42:05.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MmT7ixCoaNB1qiSDJgYm7g.jpeg" /></figure><h4>What are CTEs (Common Table Expressions)</h4><p>A common table expression, or CTE, is a temporary named result set created from a simple SELECT statement that can be subsequent queries.</p><p>But what does that mean, if I were to explain it as simply as i can a CTE is a virtual table of results you can query off what this means is the CTE isn’t actually stored anywhere, it exists on the computer memory and is deleted once the query is run.</p><h4>When to use a CTE ?</h4><p>This is a question i struggled with at first too, do i use a CTE here or just use subqueries.</p><p>CTE’s also work better when you have multiple subqueries within a subquery as they are easier to read and change if needed.</p><p>It’s best to use a CTE when you need to continuously use certain tables again and again. Instead of rewriting subqueries over and over again this can be a lot easier.</p><p>CREATING A CTE</p><pre>WITH cte_name(column_name,column_name) AS <br>(SELECT column_name<br> FROM table_name ),<br>     cte_name (column_name) AS<br>  (SELECT column_name<br> FROM table_name )</pre><p>Example of when to use a CTE</p><p>The table below contains my spending on different food for the past 3 days. We want to find out how much I spend on each food item and which cost more than the average amount spent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/158/1*2TKgdsIIi9U2sJpkm0U-bw.png" /></figure><p>We need to figure out the total amount spent on each item and the average amount spent in total.</p><pre>WITH Total_cost (product_name,Total_cost_per_item) AS <br>           (SELECT product_name,SUM(cost) AS Total_cost_per_item<br>            FROM Spending<br>            GROUP BY product_name),<br>     Avg_cost (Avg_cost_per_item) AS<br>           (SELECT AVG(cost) AS Avg_cost_per_item<br>            FROM Spending)</pre><p>The above creates two results the first Total_cost containing each item and its total cost. The second Avg_cost contains the average cost of all items.</p><p>We can now find our desired result by using a SELECT statement <strong>right below the CTE. </strong>This is important because otherwise the SELECT statement wont be able to use results form our CTE.</p><pre>WITH Total_cost (product_name,Total_cost_per_item) AS <br>(SELECT product_name,SUM(cost) AS Total_cost_per_item<br> FROM Spending<br> GROUP BY product_name),<br>     Avg_cost (Avg_cost_per_item) AS<br>  (SELECT AVG(cost) AS Avg_cost_per_item<br> FROM Spending)<br> SELECT product_name, Total_cost_per_item<br> FROM Total_cost AS T<br> inner JOIN Avg_cost AS A<br> ON T.Total_cost_per_item &gt; A.Avg_cost_per_item</pre><p>The result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*zKgpu1gPOxUcBrUdL0iayg.png" /></figure><p>I might need to reduce how much rice I eat 😅</p><p>I hope this article was able to help you learn more about Common Table Expression.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eaf59213437a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UNDERSTANDING SQL JOINS]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/understanding-sql-joins-8d31f109b725?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d31f109b725</guid>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Tue, 08 Aug 2023 17:52:51 GMT</pubDate>
            <atom:updated>2023-08-08T17:52:51.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MmT7ixCoaNB1qiSDJgYm7g.jpeg" /></figure><h4>What are JOINS ?</h4><p>The JOIN statement is used to combine rows from two or more tables, based on a related column between them. The best way to explain how joins work is to see the tables as sets in a Venn diagram. In this article I will be addressing the following types of joins:</p><ul><li>INNER JOIN</li><li>RIGHT OUTER JOIN</li><li>LEFT OUTER JOIN</li><li>FULL OUTER JOIN</li></ul><p>First let’s take a look at the tables we will be using to describe the various types of joins and their effect.</p><p>Table 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*cVfy157vdwLOZnm3iYwD5g.png" /><figcaption>This table is called demographics</figcaption></figure><p>Table 2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*pCdjfM7feUJ6BVup77zjww.png" /><figcaption>This table is called pay</figcaption></figure><h4>INNER JOIN</h4><p>An INNER JOIN would return a table made up of rows of both tables as long as there is a match between the columns. It works like an intersection of sets. (you can aslso write an inner join as simply JOIN as it’s the default value)</p><pre>SELECT demographics.EmployeeID,FirstName,JobTitle,Salary<br>FROM demographics<br>INNER JOIN pay<br>ON demographics.EmployeeID = pay.EmployeeID</pre><p>The result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*NPhv7gWtCEGWnFxZ7gIgsA.png" /></figure><p>If you notice the result only has 9 employee’s recorded but the demographics table has 12. This is because inner join will only consider values that have a match in both tables i.e.( if a value doesn&#39;t exist in any of the tables an INNER JOIN will ignore it).</p><h4>LEFT OUTER JOIN</h4><ul><li>The LEFT OUTER JOIN returns all records from the left table (first table), and the matched records from the right table (second table). (you can simply write as LEFT JOIN).</li></ul><pre>SELECT demographics.EmployeeID,FirstName,JobTitle,Salary<br>FROM demographics<br>LEFT OUTER JOIN pay<br>ON demographics.EmployeeID = pay.EmployeeID</pre><p>The result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*KBouyXVuk1cJu3PtECQXBw.png" /></figure><p>All rows from demographics is added even if they have no matching record in table 2 and missing values are filled with NULL.</p><h4>RIGHT OUTER JOIN</h4><p>The RIGHT OUTER JOIN returns all records from the right table(Second table), and the matched records from the left table(first table).</p><pre>SELECT demographics.EmployeeID,FirstName,JobTitle,Salary<br>FROM demographics<br>RIGHT OUTER JOIN pay<br>ON demographics.EmployeeID = pay.EmployeeID</pre><p>The result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*RuVkiYoX7-h3W1k5xG2IHw.png" /></figure><h4>FULL OUTER JOIN</h4><p>FULL OUTER JOIN which Returns all records when there is a match in either left or right table.</p><pre>SELECT demographics.EmployeeID,FirstName,JobTitle,Salary<br>FROM demographics<br>FULL OUTER JOIN pay<br>ON demographics.EmployeeID = pay.EmployeeID</pre><p>The result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*53Ci_nYbPTVxz-V56An7qw.png" /></figure><p>Full outer join returns all records as long as the id exists in both tables and fills missing values with NULL.</p><p>That’s it for this article i hope i have been able to explain how JOINS work</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d31f109b725" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RIBBON SUCCESS ANALYSIS]]></title>
            <link>https://medium.com/@abdulrahimibrahimolayiwola/ribbon-success-analysis-cec5610bb849?source=rss-b43d282ba417------2</link>
            <guid isPermaLink="false">https://medium.com/p/cec5610bb849</guid>
            <category><![CDATA[business-analysis]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[datanalysis]]></category>
            <dc:creator><![CDATA[l_ay1w0la]]></dc:creator>
            <pubDate>Sat, 22 Jul 2023 12:28:35 GMT</pubDate>
            <atom:updated>2023-07-22T13:01:06.771Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pk4EbHPwbiw9sRqpFOZ_RQ.png" /></figure><h3>PROBLEM STATEMENT</h3><p>As a Data Analyst, your task is to analyze the provided data set to determine the success of the product launch for SocialBlaze’s new app, Ribbon. SocialBlaze also have another app called InstantSnaps — Users accounts on InstantSnaps will be linked to Ribbon.<br>Your analysis will focus on key metrics and insights to present to the CEO and Founder.</p><h3>Introduction</h3><p>This data set for this analysis was provided by SocialBlaze. The data contains key data on ribbon’s operations from july 6th to august 5th a range of 32 days, This data will be used to access the applications possible success and how to leverage on the possible success or avoid failure.In this report i will be taking into consideration some key performance indicators (KPI) like the retention rate, engagement metrics , growth rate and the crash rate.</p><h3>User Acquisition Metrics.</h3><h4>User Sign ups</h4><p>Over 3.4 billion people have installed the ribbon app since launch, but about **3,385,000(three million three hundred eighty-five thousand.)** of these installations failed to complete the signup process. This could be caused by an overly complicated or confusing signup process causing users to get frustrated and abandon the app before completing the registration process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*L2XzxsJ4dTZCsPkWyfr9EA.png" /></figure><h4>Retention rate</h4><p>Retention rate is a crucial and valuable metric for assessing the success of a social media app. It indicates how well the app retains its active users over time, and these users play a significant role in driving engagement. By focusing on retention, app developers can ensure a loyal and engaged user base, which is vital for the app’s long-term success and growth.</p><p>Fortunately Ribbon has a good retention rate, the social media app industry benchmark for a one month retention social media apps is between 25% to 40% retention rate and Ribbon has a 77% retention rate, which is above the benchmark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*V4mOtfimCfSVnhQG2p6GoQ.png" /></figure><h4>Growth rate</h4><p>Another important thing to consider is Ribbon’s growth rate. Considering that for early-stage or newly launched social media apps, a DAU growth rate of 10% to 20% per month (10 to 20 times its initial count) can be considered acceptable. Ribbon demonstrated an astonishing daily growth rate, increasing its number of daily users by an astounding 1874 times the original count. within a month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*NOCb6ppZJQOidVISa62GGQ.png" /></figure><h3>Engagement metrics</h3><h4>session duration</h4><p>Another key factors is how long these users are staying online, longer session durations show that the product is able to provide value for the users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*KlhXocjSga5KJOEMC-BGrQ.png" /></figure><p>But how long the users are staying online on it’s own doesn’t tell us much we also need to look at if they are actively engaging on the app to get a clearer picture on ribbon’s possible success.</p><h4>Post visibility</h4><p>Post visibility helps analyze algorithim performance, optimise posting strategy, and maximize content reach. Higher visibility leads to increased user engagement and provides insights into user interests. During this one month period a toal of 62,288,000 (sixty-two million two hundred eighty-eight thousand) posts were made on ribbon but only 25,380,620 (twenty-five million three hundred eighty thousand six hundred twenty) were actually seen by users. meaning only 38.87% of posts on ribbon were actually seen by users. This falls within the acceptable range of 30% to 50% for social media apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*zzCwgfxp1lsmqrNdVuKk6g.png" /></figure><p>Although it falls within the accepted benchmark more than half the posts made aren’t actually seen by users. This could lead to lower user engagement and revenue generation. A poorly optimized algorithm could cause this as it may be suppressing content and only favours specific types of post. It could also be as a result of the app failing to provide personalized and relevant content for each user.</p><h4>Overall engagement rate</h4><p>The overall engagement rate is a comprehensive metric that considers all types of user interactions (likes and reposts in this case) in relation to the total audience. Ribbon has an overall engagement rate of 0.89 (or 89%), meaning 89% of users are engaging with content on the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*YgBcmxSDNaMQJjhzMZGDSg.png" /></figure><p>The chart below shows a steady growth in user engagement over the month. A steady growth of engagement over a month in a social media app indicates consistent and incremental improvements in user interaction and activity. This positive trend suggests that users are actively engaging with the content and finding value in the app’s features. The app’s content strategy is likely effective in delivering engaging and relevant content consistently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*9d_jxWJ2i0S7shBypn1_sQ.png" /></figure><h3>App stability</h3><p>We can measure how stable the app is using crash rate per user. The app has a crash rate per user of 0.06, which mean on average evry user experienced 0.06 (or 6% ) crashes while using the app which is more than the industry standard of 1%. This indicates that a significant number of users are experiencing frequent crashes while using the app. This leads to a poor user experience, decreased user engagement, negative reviews, and potential loss of revenue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*zbEr4vHBtI8mT20IvFqZoA.png" /></figure><h3>Conclusions</h3><p>After conducting a comprehensive analysis of the app’s performance and market dynamics, I are pleased to report that my findings strongly indicate a promising outlook for Ribbon. The app’s engagement metrics, including daily active users (DAU) and retention rates, have demonstrated positive trends with Ribbon having demonstrated a 89% overall engament rate **(89% of active users are engaging on the app)**, which reflects a growing user base and sustained user interest over time.</p><p>The app’s growth rate throughout the month has been impressive, with a substantial increase in daily users observed from the beginning to the end of the month, resulting in a remarkable growth in the number of users, **about 1874 times (187400% increase) the original count**.</p><p>Furthermore, the app’s competitive analysis reveals that its unique value proposition and innovative features provide a competitive edge in the social media app market. With an effective user acquisition and retention strategy which reflects in its retention rate of 77% **(77% of total installations remain active on the app)**, I believe Ribbon is well-positioned to achieve continued success and sustainable growth in the dynamic social media landscape.</p><p>I am optimistic about the future of Ribbon and its ability to captivate and engage users, ultimately contributing to a successful venture in the social media industry.</p><h3>Recommendations for Improvement</h3><p>* The signup process has to be optimized to make it quick, easy, and user-friendly this will help user retention. The team at ribbon should also collect user feedback on any confusing or complex parts of the signup process to aid optimization.<br> <br>* The marketing team should strive to ensure users understand the app’s value proposition from the start as this will help in user acquisition and retention.<br> <br>* The ribbon app content suggestion algorithm needs to be optimized so users receive personalized and relevant content. This can help solve the issue of posts not being seen by users and increase user engagement. A feedback loop that allows users to provide explicit feedback on content suggestions should be integrated into the app. This feedback can be to further refine the algorithm and enhance personalization.</p><p>* During the analysis I noticed that the app has a crash rate which is higher than the industry benchmark, To address this issue the team is advised to prioritize app stability and performance. Implementing regular code reviews, and testing, along with the integration of crash analytics and monitoring tools are essential for continuous improvement and enhancing user experience.</p><p>* Since users instantsnaps and ribbon accounts are going to be connected the Socialblaze team should enable users to carry over followers between apps as this will allow for a seamless transition between apps, and give content creators the opportunity to start interacting and engaging with their audience immediately, resulting in better content performance and higher engagement metrics.</p><h4>Answer’s to the CEO’S questions</h4><p>* Ribbon’s success can be leverage to enhance other products and services through the following ways :<br> <br> * Cross promotion : Ribbon’s user base can be used to promote other products and services on the company through targeted advertisements on the app.<br> * Influencer Marketing: Influencers and content creators on Ribbon can be used to promote other products and services.Influencers with a large and engaged following can significantly impact the success of a product launch or service offering.<br> <br> * User acquisition and engagement can be improved through :</p><p>* Targeted marketing: The marketing team can take advantage of influencer marketing and other social media platforms to advertise thier product to further drive user acquisition.<br> * Referral programs : The ribbon team can also implement a referral program that motivates existing users to invite their friends and contacts to join the app and offer rewards or benefits to both the referrer and the new user to encourage participation.<br> * Push Notifications: Notifications can also be used to re-engage users by informing them about relevant updates feaatures and personalized content. The team should avoid sending irrelevant notifications as this can push customers away from the app.<br> * Real time updates: Content should be updated and refreshed in real times as this can help keep users entertained and avoid boredom.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cec5610bb849" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>