<?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 Omoyeni Ogundipe on Medium]]></title>
        <description><![CDATA[Stories by Omoyeni Ogundipe on Medium]]></description>
        <link>https://medium.com/@omoyeni-ogundipe?source=rss-f97fcacf81fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HBz-DACMtSKcaMQOFq0TWg.jpeg</url>
            <title>Stories by Omoyeni Ogundipe on Medium</title>
            <link>https://medium.com/@omoyeni-ogundipe?source=rss-f97fcacf81fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 00:00:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omoyeni-ogundipe/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[Enhancing Financial Security: Credit Card Fraud Detection Using Deep Learning]]></title>
            <link>https://omoyeni-ogundipe.medium.com/enhancing-financial-security-credit-card-fraud-detection-using-deep-learning-9cc8495ffc31?source=rss-f97fcacf81fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cc8495ffc31</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[fraud-detection]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Omoyeni Ogundipe]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 04:57:33 GMT</pubDate>
            <atom:updated>2023-08-10T04:57:33.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*gj3gj4WguLPG_wRb2cp3Pw.jpeg" /></figure><h3><strong>Introduction</strong></h3><p>The world of finance, marked by swift transactions and intricate networks, is often a target for malicious activities. Credit card fraud, a pervasive concern, jeopardizes both financial institutions and customers. However, the dynamic evolution of technology has ushered in innovative solutions. This article is a conceptual overview that delves into the application of deep learning techniques, specifically Convolutional Neural Networks (CNNs), to fortify credit card fraud detection.</p><h4><strong>The Challenge of Credit Card Fraud</strong></h4><p>Credit card fraud is an ever-present threat that hampers economic stability and undermines trust in financial systems. Conventional methods of fraud detection, while effective, struggle to keep pace with the intricate strategies employed by fraudsters. A paradigm shift is underway, driven by the potential of deep learning to decipher complex patterns within voluminous transaction data.</p><h4>Understanding Deep Learning</h4><p>Deep learning, a subset of machine learning, draws inspiration from the human brain’s neural networks. It excels in uncovering intricate relationships within data. Convolutional Neural Networks (CNNs), originally designed for image recognition, exhibit remarkable adaptability to sequential data, making them a prime candidate for time-series analysis.</p><h4>Dataset and Preprocessing</h4><p>Central to this endeavor is the credit card transaction dataset, encompassing multifaceted features such as transaction amounts, timestamps, and transaction types. The data undergoes meticulous preprocessing, which includes normalization to ensure uniformity and handling of missing values. Subsequently, the dataset is divided into training and testing subsets.</p><h4>Unveiling the CNN Architecture</h4><p>The architecture of the CNN is meticulously tailored to capture the temporal intricacies embedded within credit card transaction sequences. Convolutional layers extract local patterns, while max-pooling layers down-sample the data, retaining vital information. Fully connected layers culminate in a binary classification that discerns legitimate from fraudulent transactions.</p><h4>Model Training and Validation</h4><p>The heart of the endeavor lies in training the model. Through binary cross-entropy loss and the Adam optimizer, the model is calibrated to recognize the intricate patterns that differentiate fraudulent from legitimate transactions. The inclusion of early stopping prevents overfitting, ensuring the model’s generalization ability.</p><h4>Evaluating Success</h4><p>The model’s efficacy is gauged through an array of metrics, including accuracy, precision, recall, F1-score, and the Receiver Operating Characteristic (ROC) curve. A comprehensive evaluation offers insights into its true potential and ability to navigate the complex landscape of credit card fraud detection.</p><h4>Powerful Results and Implications</h4><p>The culmination of this endeavor reveals a model that achieves accuracy levels [insert accuracy value]. Precision, recall, and F1-score illuminate its ability to identify both fraudulent and legitimate transactions with remarkable accuracy. This signifies a transformative step forward in fortifying financial systems against insidious fraud.</p><h4>Driving Financial Resilience</h4><p>The application of Convolutional Neural Networks in credit card fraud detection signifies more than just a technological advancement. It symbolizes the synergy of innovation and security, safeguarding financial institutions and customer interests alike. As deep learning continues to evolve, so does its power to fortify economic ecosystems.</p><h3>Conclusion</h3><p>In a world where financial transactions ripple across borders, safeguarding the integrity of these transactions is paramount. The integration of deep learning, particularly CNNs, into credit card fraud detection demonstrates the potential to thwart sophisticated fraudulent activities. This remarkable fusion of technology and finance propels us toward a future where trust prevails and security reigns supreme.</p><p>Moving forward, we will apply CNN on Credit Card data to detect fraud in a real world scenario.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cc8495ffc31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embracing a Kaleidoscope of Passions: My Journey Through Data Science, Finance, Blockchain…]]></title>
            <link>https://omoyeni-ogundipe.medium.com/embracing-a-kaleidoscope-of-passions-my-journey-through-data-science-finance-blockchain-e7222453e4f2?source=rss-f97fcacf81fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7222453e4f2</guid>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[interior-design]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Omoyeni Ogundipe]]></dc:creator>
            <pubDate>Mon, 05 Jun 2023 11:43:38 GMT</pubDate>
            <atom:updated>2023-06-05T11:43:38.897Z</atom:updated>
            <content:encoded><![CDATA[<h3>Embracing a Kaleidoscope of Passions: My Journey Through Data Science, Finance, Blockchain, Trading, and Interior Decoration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Z4OCgNzF0cWC-hJjlHlvvQ.png" /></figure><p>Passion knows no bounds and curiosity fuels our desire to explore diverse realms. In my journey, I have discovered a kaleidoscope of passions that have shaped my life and career. From the enthralling world of data science and analytics to the intricacies of finance and investment, from the transformative potential of blockchain and web3 technologies to the dynamic landscape of trading and the stock market, and even to the artful realm of interior decoration, I have found joy and inspiration in each of these domains. Join me as I share my love for these diverse areas and the enriching experiences that have molded my path.</p><h4><strong>Finance and Investment</strong></h4><p>The world of finance has an allure that is both intellectually stimulating and financially rewarding. The intricacies of financial markets, investment strategies, and risk management have always captivated me and drove me to gain a Bachelors degree in Accounting and a Masters degree which concentrated in Mathematical Finance. I believe that everyone should have the opportunity to build wealth, and I am excited about the ways that finance can be used to do this.</p><p>By exploring the interplay between economic forces and market dynamics, I seek to understand how financial decisions shape our world. Navigating the complexities of investments and the quest for financial growth keeps my curiosity aflame.</p><h4>Data Science and Analytics</h4><p>The vast ocean of data has always been a source of solace and fascination for me. Upon completing my Bachelors degree, I was fortunate to embark on an incredible journey as a Data Analyst for a geospatial company in my home country. This pivotal role opened my eyes to the captivating world of data science and analytics.</p><p>Working with data became an enlightening experience, where I witnessed the emergence of patterns, the discovery of valuable insights, and the power of evidence-based decision-making. It was in this realm that I discovered my passion. From extracting valuable information to constructing predictive models, I was captivated by the art of unraveling the hidden narratives concealed within raw data.</p><p>What truly propelled my enthusiasm for data science was the ability to transform complex jargon and technicalities into meaningful narratives that contributed to informed decision-making. The joy that accompanies this process, bridging the gap between data and real-world understanding, is unparalleled. It is through this passion that I strive to make a tangible impact in the world of data science and beyond.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YvVX8bWSSvOMzKXMB91Jfw.jpeg" /></figure><h4>Trading and the Stock Market</h4><p>The dynamic realm of the stock market exerts an irresistible pull, drawing me into its world of volatility and boundless potential. Engaging in the art of trading, deciphering market trends, and analyzing financial indicators becomes a captivating dance, where calculated risks lead to rewarding outcomes.</p><p>The ever-changing landscape of the market ensures that there is never a dull moment. It demands continuous learning and a deep understanding of its intricate workings. Seeking knowledge and insights becomes a perpetual quest, as I strive to unlock profitable opportunities hidden within the fluctuations.</p><p>The thrill of making well-informed trading decisions is an unparalleled experience that ignites a surge of adrenaline. The ability to navigate through the market’s complexities, leveraging analytical skills and strategic thinking, brings about a sense of accomplishment and satisfaction.</p><p>In the midst of the market’s highs and lows, I am driven by an unyielding curiosity and an insatiable desire to decode its patterns and uncover hidden opportunities. It is a continuous journey of growth, where each trade is a lesson and every success or setback is a stepping stone towards honing my skills.</p><h4>Blockchain and Web3 Technologies</h4><p>The rise of blockchain and web3 technologies has sparked a revolutionary wave, brimming with the promises of decentralization, transparency, and boundless innovation. Witnessing the transformative power of these technologies across multiple sectors, including finance, supply chain, healthcare, and governance, leaves me in awe of the immense possibilities they present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4w5TSvBl3Qt71T1Le2l6A.jpeg" /></figure><p>Delving into the intricate workings of smart contracts, decentralized applications, and token economies, I am filled with an insatiable curiosity to contribute to this disruptive movement. In this new paradigm, trust is reimagined, and traditional barriers are shattered, paving the way for novel solutions and unexplored horizons.</p><p>The potential of blockchain and web3 technologies to reshape the world as we know it is exhilarating. I am captivated by the prospect of developing decentralized applications that challenge the status quo, redefining the way we exchange value, share information, and collaborate. The ability to contribute to the creation of innovative solutions that address real-world problems excites me beyond measure.</p><p>Blockchain and web3 technologies offer an open playground for experimentation and exploration and has awakened a sense of wonder and passion within me. It is a journey of exploration, innovation, and limitless potential where creativity knows no bounds. The dynamic nature of this space, with its constant evolution and rapid advancements, inspires me to continually learn, adapt, and push the boundaries of what is possible.</p><h4>Interior Decoration</h4><p>Amidst the world of numbers and investments, I find solace in the art of interior decoration. The interplay of colors, textures, and aesthetics has the remarkable ability to infuse tranquility and beauty into any environment.</p><p>I find myself drawn to the transformative power of harmonious living spaces. The process of taking a simple house and turning it into a warm and inviting home is incredibly fulfilling. Witnessing the transformation of a space and witnessing the happiness it brings to its inhabitants is a gratifying experience that fuels my passion.</p><p>I have an unwavering belief that everyone deserves to have a sanctuary they can truly call their own, a space that reflects their personality and offers respite from the outside world. Guided by this belief, I am deeply passionate about helping individuals create homes that evoke a sense of comfort and belonging.</p><p>Exploring diverse design styles, experimenting with spatial arrangements, and curating unique elements are not just tasks; they are expressions of my personal dedication to crafting harmonious environments. The ability to curate aesthetics that blend seamlessly with functionality is a constant pursuit that drives me to continuously seek inspiration and refine my skills.</p><p>In the end, the art of interior decoration is more than just arranging furniture and selecting color palettes. It is an opportunity to positively impact lives by creating spaces that elevate the human experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bh22RhHY_62ubP7lbZ94NQ.jpeg" /></figure><h4>Conclusion</h4><p>My passions for data science, finance, and interior decoration are all interconnected. It may seem like a diverse combination, but they all share a common thread of creativity and problem-solving.</p><p>Data science provides the analytical tools and techniques to extract valuable insights from complex financial data, enabling informed investment decisions and trading strategies. It can also be used to create models that predict trends in the interior design industry. Additionally, the emergence of blockchain technology has revolutionized finance and investment, offering new opportunities for transparency and efficiency. Meanwhile, interior decoration allows me to express my creativity and attention to detail, creating harmonious spaces that reflect both aesthetic appeal and financial value.</p><p>By embracing these diverse passions, I am able to explore unique intersections and find innovative ways to integrate data-driven analysis, financial acumen, blockchain technologies, and artistic flair to create meaningful and rewarding experiences in both the financial and design realms.</p><p>I believe that my passions are all part of a larger journey to make a positive impact on the world. I want to use my skills in data science, finance, and interior decoration to help people live better lives. I want to create tools that help people make better decisions, invest their money wisely, and create beautiful and functional spaces.</p><h4>End Note</h4><p>If you find yourself deeply interested in various things, like me, it’s natural to feel that your focus may be scattered. However, I assure you that there is a common ground among your passions waiting to be discovered. As the saying goes, “Passion is the genesis of genius.” Let this article serve as an inspiration for you to embrace your diverse interests and pursue them with determination. There’s an immense joy that comes from doing what you love. So, seize the opportunity and make it a reality. Your journey towards fulfillment begins now!</p><p>With Love ❤️</p><p><a href="http://omoyeniogundipe.com/">Omoyeni</a> <a href="http://www.linkedin.com/in/omoyeni-ogundipe">Ogundipe</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7222453e4f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Performance Evaluation of Time Series Prediction Models: A Comparative Analysis of RNN-LSTM and…]]></title>
            <link>https://omoyeni-ogundipe.medium.com/performance-evaluation-of-time-series-prediction-models-169f447924db?source=rss-f97fcacf81fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/169f447924db</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Omoyeni Ogundipe]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 19:23:19 GMT</pubDate>
            <atom:updated>2023-06-05T07:29:54.668Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Performance Evaluation of Time Series Prediction Models: A Comparative Analysis of RNN-LSTM and SARIMA models for Predicting the Price of Diesel</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-s6fZf3e6LChbb3ttFfWw.jpeg" /></figure><p>Time series analysis is one of the most widely used predictive tools, as its application suites problems across various industries. Many methods of analyzing time series exist, however, in recent years deep learning techniques such as Recurrent Neural Network’s Long — Short Memory has become more prominent as compared to older techniques such as ARIMA, ARMA, and SARIMA, due to the fact that conventional RNNs have both “long-term memory” and “short-term memory” which means they are able to retain long-term data behavior in continuous short-term loops. And that they generally less time to be executed.</p><p>In this project, we have compared the use of RNN — LSTM and SARIMA techniques to process and forecast the time series data of Average diesel prices from 2011 to 2022 and their outputs. The RNN-LSTM model performed better as the root mean squared error at 24.901 was lesser than that of the Seasonal ARIMA used as our case study showed prominent seasonality with a root mean squared error of 27.893. While this may not be applicable to other cases, the RNN-LSTM method trumps the ARIMA method, especially in datasets where there is a high level of non-stationarity as in our case study. Let’s take a deep dive, shall we?</p><h3><strong>Introduction</strong></h3><p>Hydrocarbon product sales as diesel, gasoline, and Liquified Natural Gas, could rack up huge volumes in the market within a short period of time, expressing different behaviors through time, thus conforming to the law of large numbers, which declares that all patterns or behaviors can be quantified. As Diesel prices play a crucial role in various industries, transportation, and overall economic stability, an understanding of these patterns and accurate predictions of diesel prices can assist businesses in making informed decisions, optimizing operational costs, and developing effective pricing strategies.</p><p>In this article, we will conduct a comparative analysis of two popular time series prediction models, RNNs-LSTM (Recurrent Neural Networks with Long Short-Term Memory) and SARIMA (Seasonal Autoregressive Integrated Moving Average), to evaluate their performance in predicting diesel prices.</p><p>Understanding the Models:</p><ol><li>RNNs-LSTM: Recurrent Neural Networks with Long Short-Term Memory (LSTM) have proven to be effective in capturing temporal dependencies and patterns in sequential data. These models excel in handling time series data due to their ability to remember information from previous time steps and incorporate it into future predictions.</li><li>SARIMA: Seasonal Autoregressive Integrated Moving Average (SARIMA) is a widely used statistical model for time series analysis. SARIMA models consider the autoregressive, moving average, and seasonal components of the data to capture trends, seasonality, and random variations.</li></ol><p>We will look at the merits and demerits of these methods and the implementation of the two methods on the selected dataset.</p><h3>Methodology</h3><p>To evaluate the performance of RNNs-LSTM and SARIMA models in predicting diesel prices, we used -</p><p><strong>Tools</strong> : statsmodel, SKlearn, Keras, Math, PMDARIMA, NumPy, Pandas libraries.</p><p><strong>Data</strong>: We used the average diesel pump prices in Nigeria for 11 years, from 2011 to 2022.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*875e8mOdPN6GOiZ7cJ0D8A.png" /><figcaption>Average diesel pump price vs time</figcaption></figure><h3><strong>Using RNN-LSTM</strong></h3><p>The study focused on forecasting the price of diesel at the pump. The dataset was split into training and test sets, with proportions of 87.5% and 12.5%, respectively. The time series data was then decomposed using the statsmodels.tsa seasonal decompose function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5EYzTaP3nvKtbSJRhh2YMg.png" /><figcaption>Seasonal decomposition of case study</figcaption></figure><p>To improve the resolution during analysis, the dataset was scaled to a range between 0 and 1 using sklearn’s MinMaxScaler. This scaling is particularly useful when time series data varies greatly in magnitude.</p><p><strong>Dataset Stationarity: </strong>To improve the resolution during analysis, the dataset was scaled to a range between 0 and 1 using sklearn’s MinMaxScaler. This scaling is particularly useful when time series data varies greatly in magnitude.</p><h4><strong>Modeling</strong></h4><p>The RNN-LSTM model used a recurring batch approach, where a subset of data is selected as a pilot batch, and the most recent output from analysis and prediction is appended to the batch while removing the initial value. This recurring process allows RNNs to effectively analyze time series data. In this experiment, batches of 18 data points were selected. The model architecture consisted of a sequential model with an LSTM layer containing 100 neurons.</p><pre>               Input                           Output<br>Pilot batch = [2,3,5,3,5]                      [4]<br><br>New batch   = [3,5,3,5,4]                      [6]</pre><p>The model parameters were set according to the defined network and model structures. We employed the Sequential class from Keras models, as well as the Dense and LSTM classes from Keras layers. The model type was set as sequential, and an LSTM layer with 100 neurons was added. The input shape is defined by the pre-determined batch range and the number of features, which is 1 for this univariate time series. The model summary is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*aSnRZ5_1sbKNhlySyh6aGQ.png" /><figcaption>Model summary</figcaption></figure><h4>Model fitting</h4><p>The model is fitted using the time series generator, which has the input and output ranges. The number of epochs is set to 50, and the loss is plotted against the epoch as shown</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*QBIjSDYy7dvg_coU5zdbzQ.png" /><figcaption>Epoch vs Loss</figcaption></figure><p>The loss consistently decreases with each epoch until it reaches a point where further decline is not observed. This indicates a proper fit, as a continuously declining or an upward peak would suggest overfitting.</p><h4>Predictions</h4><p>To make predictions, we created an instance of the original input using the last 18 observations. This instance is used to predict an output value, which is then appended to the initial input instance. The first observation in the initial instance array is removed, creating a new input range. This process is repeated for the test data set, generating a predicted series alongside the original time series. The predicted series is then transformed back to its original magnitude from the scaled-down series.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*F9A-Q455kuI8NzEZGtYtgQ.png" /><figcaption>Predicted diesel pump vs Original Diesel pump price using RNN-LSTM</figcaption></figure><h4><strong>Model validation</strong></h4><p>The root mean square error (RMSE) is a measure of the square root of the residuals’ variance. It is calculated by finding the squared difference between each predicted diesel pump price and the actual pump price, then taking the square root of the mean of these differences using the mean_squared_error metric from Sklearn. In this case, the RMSE value obtained is 24.901, indicating a small difference between the predicted pump price and the observed values.</p><h3><strong>Using ARIMA</strong></h3><p>For this method, we installed the Python package pmdARIMA, which brings R’s auto.arima functionality to Python. The auto-ARIMA approach selects a single fitted ARIMA model by determining the most suitable parameters. Based on the widely-used R function, this method.</p><p>To establish the order of differencing (d), Auto-ARIMA performs differencing tests such as Augmented Dickey-Fuller, Kwatkowski-Phillips-Schmidt-Shin, or Phillips-Perron. It then fits models within defined start p, max p, start q, and max q ranges. If the time series exhibits prominent seasonality, the seasonal option is chosen, and auto-ARIMA additionally tries to find the best P and Q hyperparameters after using Canova-Hansen to determine the best order for seasonal differencing, “D,” which is SARIMA.</p><h4><strong>Non-Stationarity reduction</strong></h4><p>In this case, an Augmented Dickey-Fuller test is conducted to determine the stationarity of the time series.</p><pre>1. ADF:  -1.6005496446605534<br>2. P-Value:  0.5438386111518801<br>3. Num of Lags:  13<br>4. Num of Observations Used for ADF Regression: 130<br>5. Critical Values:<br>    1%:  -3.4816817173418295<br>    5%:  -2.8840418343195267<br>    10%:  -2.578770059171598</pre><p>The test results indicate that the P-value is far above the 0.05 statistical threshold, suggesting that we fail to accept the hypothesis of stationarity. To address this, we manually reduce the spread of the mean, variance, and covariance by taking the square roots of the array before applying the pmdARIMA auto_arima function. The summary below shows the best ARIMA parameter fit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfZwu-xXujqjTgIAzkt6bA.png" /><figcaption>PMDARIMA auto_arima fit summary</figcaption></figure><p>The data is then split into train and test sets, and the SARIMAX function from the tsa.statespace.sarimax module is applied to the train set using the best model order determined by pmdARIMA (3,1,2). The model summary is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yFNEQIwmYvkfzwNmSx_vHQ.png" /><figcaption>SARIMAX model summary</figcaption></figure><p>The model is then applied to the test range, and the predicted output is transformed back to the original dataset magnitude. The predicted series is plotted alongside the original time series using SARIMA, as shown in the plot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*HTZIEhol713yGsNl_iCCNQ.png" /><figcaption>Predicted diesel pump and Original Diesel pump price using SARIMA</figcaption></figure><h4><strong>Model validation</strong></h4><p>Similar to the RNN-LSTM model, the RMSE is used to measure the variance between the actual diesel pump price and the predicted price from the SARIMA model. The RMSE value obtained is 27.893, indicating a small difference between the observed and predicted values.</p><h3>Conclusion</h3><p>In conclusion, we compared the performance of two different time series techniques, Recurrent Neural Networks with Long Short-Term Memory (RNN-LSTM) and Seasonal Autoregressive Integrated Moving Average (SARIMA), for analyzing and predicting diesel pump prices from 2011 to 2022. The RNN-LSTM model performed better, with a lower root mean square error (RMSE) of 24.901 compared to the SARIMA model’s RMSE of 27.893. This finding suggests that the RNN-LSTM method is more effective, particularly in datasets with a high level of non-stationarity like in our case study.</p><h3>References</h3><p>1. <em>Stock price prediction using the RNN model. </em><strong>Yongqiong Zhu.</strong> 2020, International Conference on Applied Physics and Computing (ICAPC 2020), p. Conference Series 1650 032103.</p><p>2. <em>Time Series Analysis for Psychological Research . </em><strong>Wayne F. Velicer, Joseph L. Fava.</strong> s.l. : Cancer Prevention Research Center University of Rhode Island, 2003. 10.1002/0471264385.wei0223. .</p><p>3. <em>Long Short-term Memory. </em><strong>Sepp Hochreiter, Jürgen Schmidhuber.</strong> 8, s.l. : Neural Computation, 1997, Vol. 9. 1735–1780..</p><p>4. <em>Time series analysis: Forecasting and control. </em><strong>Box, G. E. P., Jenkins, G. M., &amp; Reinsel, G. C.</strong> Englewood Cliffs : NJ: Prentice-Hall, Inc, 1994, Vol. 3rd.</p><p>View the project on <a href="https://github.com/OmoyeniO/Diesel_price_prediction">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=169f447924db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Build a Powerful Portfolio Website With Zero Coding Skills !]]></title>
            <link>https://omoyeni-ogundipe.medium.com/how-to-build-a-powerful-portfolio-website-with-zero-coding-skills-a551faffcd5d?source=rss-f97fcacf81fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/a551faffcd5d</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[portfolio-website]]></category>
            <category><![CDATA[no-code-development]]></category>
            <dc:creator><![CDATA[Omoyeni Ogundipe]]></dc:creator>
            <pubDate>Thu, 17 Nov 2022 21:33:21 GMT</pubDate>
            <atom:updated>2022-11-17T21:43:42.310Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To Build a Powerful Portfolio Website With Zero Coding Skills !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F52r2H6ICjS5nPdCua803g.png" /></figure><p>Are you a tech beginner, or a non-software engineer wondering where to start from to get an online presence of your own ? Or pondering on where to showcase your work to recruiters, colleagues, investors and friends alike?</p><p>Well, this was me a few months back until I cracked the hack and built my own fully functioning efficient portfolio website that you can see <a href="https://omoyeniogundipe.com/">here</a>.</p><p>Before I jump right into it, a quick background of who I am.</p><p>My name is Omoyeni and I am an Accountant turned Data Scientist. I ventured into this career switch in August 2021 with zero technical skills. See, I had no programming skills whatsoever!</p><p>As I started my journey to being a Data Scientist, going through my Masters degree program, taking up extra online courses, doing projects, sharpening my programming skills and looking for a job at the same time; it was so obvious to me that I needed a platform where I could easily showcase my projects to recruiters and the world.</p><p>I wanted a platform where I could customize as I saw fit and that would be eye catching, very efficient and interesting for viewers but I did not know where to start from.</p><p>Then i figured it out. Open Source !</p><p>Yup, that’s right ! Open Source is the Holy Grail of learning in tech and being self sufficient (in this context). Open-source is a computer program that is released under a license which gives users the ability to use, study, change, and distribute for any purpose. Open-source codes are usually developed collaboratively and in a public manner.</p><p>During one of my frequent exploits on GitHub, I stumbled on <a href="https://github.com/smaranjitghose/awesome-portfolio-websites">this</a> open source portfolio project that seemed very interesting. I read the documentation and implemented it. <strong>C’est fini</strong> ! <a href="https://omoyeniogundipe.com/">omoyeniogundipe.com</a> built just like that.</p><p>Sounds easy right ? Exactly!</p><p><strong>All you need is :</strong></p><ul><li>A computer</li><li><a href="https://github.com/">GitHub</a> to clone the repository (essentially copy the entire open source code so you can make changes)</li><li><a href="https://code.visualstudio.com/">Vscode</a> (to make the changes)</li><li>HTML, JavaScript, CSS installed on your computer</li><li><a href="https://www.heroku.com/">Heroku</a> or <a href="https://www.netlify.com/">Netlify</a> (for deployment to the web )</li><li>Your personal documents, projects and links</li><li>Your domain (optional)</li><li>A brain</li><li>And keen eyes for details</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lXG8QjJKz9FgVIgz" /><figcaption>Open Source Portfolio Website</figcaption></figure><p>I”m assuming you are already familiar with <a href="https://github.com/">Github</a> and <a href="https://git-scm.com/">Git</a>. If not, learn how to create a Github account and use Git commands from this medium article <a href="https://medium.com/towards-data-science/getting-started-with-git-and-github-6fcd0f2d4ac6">here</a>.</p><p><strong>Getting Started</strong></p><ul><li>Visit the <a href="https://github.com/smaranjitghose/awesome-portfolio-websites.git">repository</a></li><li>Read the <a href="https://smaranjitghose.github.io/awesome-portfolio-websites/">documentation</a> to learn more</li><li>Fork the repository OR</li><li>Clone the repository</li><li>Personalize by changing the name, picture, social media links , interests , education, work experiences, research, projects etc</li><li>Change the contact form by connecting your <a href="https://formcarry.com/">FormCarry</a> account</li><li>Push your code to your repository</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*Yz0Uu221wewY-rJS" /><figcaption>Home Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*JSL20MJQwkg6S7Fa" /><figcaption>Experience Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*Ywj6DplYyHTGGNbq" /><figcaption>Education page</figcaption></figure><p>Finally, after building your portfolio, you are ready for deployment to <a href="https://www.heroku.com/">Heroku</a> or <a href="https://www.netlify.com/">Netlify</a>. I personally find Netlify super easy and opted for that option.</p><p><strong>Steps to deploy on Netlify</strong></p><ul><li>If you are not already a Netlify user, <a href="https://app.netlify.com/signup">sign up for free</a> first.</li><li>Once you’re logged in, you’ll be taken to <a href="https://app.netlify.com/">https://app.netlify.com</a>. Then click the <strong>New site from Git </strong>button shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YS_5922loBMpdSkl.png" /></figure><ul><li>Next, authorize Netlify to access your Git</li><li>Select your portfolio repository</li><li>Configure your settings</li><li>Then click the deploy site button</li></ul><p>See a more detailed step by step guide on how to deploy on Netlify <a href="https://www.netlify.com/blog/2016/09/29/a-step-by-step-guide-deploying-on-netlify/">here</a></p><p>You can go further to buy a custom domain from Netlify which will be super easy to integrate if you are using Netlify to deploy as well, or you can buy a custom domain from other sources like <a href="https://www.godaddy.com/">Godaddy</a>.</p><p>For me, I like the easier way of doing things so you can guess what I used. You can see the finished product of my Portfolio website <a href="https://omoyeniogundipe.com/">here</a>.</p><p>Now you are ready. I hope this article points you in the right direction towards building your own portfolio website.</p><p>Go ahead and build !</p><p><strong>Sources</strong></p><ul><li>My <a href="https://omoyeniogundipe.com/">Portfolio</a></li><li>Open source portfolio repository : <a href="https://github.com/smaranjitghose/awesome-portfolio-websites.git">repository</a></li><li><a href="https://www.netlify.com/">Netlify</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a551faffcd5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Churn Prediction Using PySpark on Big Data]]></title>
            <link>https://omoyeni-ogundipe.medium.com/churn-prediction-using-pyspark-on-big-data-fce0e0f0f1d4?source=rss-f97fcacf81fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/fce0e0f0f1d4</guid>
            <category><![CDATA[churn-prediction]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[apache-spark]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[big-data-analytics]]></category>
            <dc:creator><![CDATA[Omoyeni Ogundipe]]></dc:creator>
            <pubDate>Sun, 13 Nov 2022 18:54:31 GMT</pubDate>
            <atom:updated>2022-11-13T19:48:47.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBCLoHIf9Ias0ysF6TfhzQ.png" /></figure><p>In the world of data science, one of the most challenging and common problems that data scientists and analysts regularly encounter in any customer-facing business is predicting churn rates. Additionally, the ability to efficiently manipulate large datasets with Spark is one of the highest-demand skills in the field of data.</p><h3><strong>Introduction</strong></h3><p>Sparkify is a music streaming service invented by Udacity. Just like Spotify, Sparkify users can listen to music for free but with ads in between songs or subscribe to the platform at a flat rate. Users can also decide to upgrade, downgrade, or cancel their subscriptions .</p><p>The goal is to predict the users who are going to leave (churn) in order to keep up with the financial goals of the company by offering them discounts or similar incentives before they cancel their subscription and leave the platform.</p><p>To do this, we manipulated big data with PySpark and engineered relevant features for predicting churn. We went further to use PySpark’s MLlib library to build machine learning models.</p><p><strong>The key steps taken to complete this project:</strong></p><ul><li>Exploratory Data Analysis (EDA)</li><li>Feature engineering</li><li>Model building</li><li>Evaluation</li><li>Results</li><li>Conclusion</li></ul><h3><strong>Exploratory Data Analysis</strong></h3><p>The data that was used for this project was provided by Udacity which contains a subset (128MB) of the full dataset available (12GB). The data shows how users of the platform use the services and consists of 286,500 rows and 18 columns with the following information:</p><pre>root<br> |-- artist: string (nullable = true)<br> |-- auth: string (nullable = true)<br> |-- firstName: string (nullable = true)<br> |-- gender: string (nullable = true)<br> |-- itemInSession: long (nullable = true)<br> |-- lastName: string (nullable = true)<br> |-- length: double (nullable = true)<br> |-- level: string (nullable = true)<br> |-- location: string (nullable = true)<br> |-- method: string (nullable = true)<br> |-- page: string (nullable = true)<br> |-- registration: long (nullable = true)<br> |-- sessionId: long (nullable = true)<br> |-- song: string (nullable = true)<br> |-- status: long (nullable = true)<br> |-- ts: long (nullable = true)<br> |-- userAgent: string (nullable = true)<br> |-- userId: string (nullable = true)</pre><pre>The number of rows is 286500<br>The number of columns is 18<br>-RECORD 0---------------<br> summary       | count  <br> artist        | 228108 <br> auth          | 286500 <br> firstName     | 278154 <br> gender        | 278154 <br> itemInSession | 286500 <br> lastName      | 278154 <br> length        | 228108 <br> level         | 286500 <br> location      | 278154 <br> method        | 286500 <br> page          | 286500 <br> registration  | 278154 <br> sessionId     | 286500 <br> song          | 228108 <br> status        | 286500 <br> ts            | 286500 <br> userAgent     | 278154 <br> userId        | 286500 <br>only showing top 1 row</pre><p>Looking deeper into the level section, we see that there are two distinct levels for each user. The free and paid level which indicates if a user is on the free subscription or otherwise paid.</p><pre>+-----+<br>|level|<br>+-----+<br>| free|<br>| paid|<br>+-----+</pre><p>Moving on, we created a new column for churn (will_churn) using Cancellation Confirmation events from the page column, where churned users are identified with <strong>1</strong> and not churned users with <strong>0 </strong>to further analyse and gain insights into our data.</p><p><strong>1. Page counts of events with and without churns</strong></p><blockquote>After comparing the percentages of event counts for attributes in page, we got that churned users are less likely to hit the next song button than not churned users. Also, churned users have a lower and higher thumbs up and thumbs down rate respectively as compared to not churned users.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*rk3NdHWE7JVaDSofxwOm1Q.png" /></figure><p><strong>2. Understanding how gender plays a factor in churn rate</strong></p><blockquote>Male users are more likely to churn than female users.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*hkWzIX9cZp--Ls8wVEhqGQ.png" /><figcaption>Gender comparison</figcaption></figure><p><strong>3. Analysis of session time spent by users on the platform</strong></p><p>The analysis of session time shows that:</p><ul><li>The average session time of churned users is approximately: 283 minutes/session</li><li>The average session time of not churned users is approximately: 302 minutes/session</li></ul><blockquote><strong>Churned users tend to spend lesser time on the platform than not churned users.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hg40zIH2ZlUqJr6JAgvPfw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hwJNCTRQVsB3jjfEAeDh7g.png" /><figcaption>Statistics of session time</figcaption></figure><p><strong>4. Analysis of number of songs per session for each user group</strong></p><p>The analysis of session time shows that:</p><ul><li>The average songs played in each session by churned users is approximately 70 songs</li><li>The average songs played in each session by not churned users is approximately 75 songs</li></ul><blockquote><strong>Churned users tend to play lesser number of songs than not churned users.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZYaL1RffGDwMm_kQsfx9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRWygMDlYhelkHuF5v2U9Q.png" /><figcaption>Number of songs per session</figcaption></figure><p><strong>5. Analysis of registration days</strong></p><p>The analysis shows that :</p><ul><li>The number of registration days of churned users are an average of 57 days</li><li>The number of registration days of not churned users are an average of 86 days</li></ul><blockquote><strong>Churned users have a lower number of registration days than not churned users.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3gmelG8yBkjmBfMYrh4r8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOfNrKtLLEMtB5Ep01FEmQ.png" /><figcaption>Registration days</figcaption></figure><p><strong>6. Analysis of user level</strong></p><blockquote>The analysis of user level shows that the ratio of free and paid users who are churned and not churned are similar (around 55/45)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*Hrg6Gwph0vo8BHLGohZkJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*EUXO_Z7V6Hv-wqolG8AtXQ.png" /><figcaption>From L-R, level of Churned users and Not Churned users respectively</figcaption></figure><h3>Feature Engineering</h3><p>Based on the Exploratory Data Analysis, we identified some features that we used to create models to predict churn. We carried out feature engineering to transform the data into a suitable form for modelling.</p><p>Features:</p><ul><li>Gender</li><li>Average session time</li><li>Average number of songs played in each session</li><li>User registration period</li><li>User level</li></ul><p>For the<strong> Categorical variables </strong>which includes<strong> : </strong>Churn (Yes/No), Gender (Male/Female), User level status (Paid/Free)</p><ul><li>We used <em>pyspark.ml.feature StringIndexerModel</em> to encode the categorical variables to numbers and cast into integers. (View code snippet below)</li></ul><pre># Dropping duplicates <br>df_gender = df.dropDuplicates([&#39;userId&#39;]).sort(&#39;userId&#39;).select([&#39;userId&#39;,&#39;gender&#39;])<br><br># Creating index for gender using StringIndexerModel  <br><br>fromlabelsModel = StringIndexerModel.from_labels([&quot;F&quot;, &quot;M&quot;], \<br>    inputCol=&quot;gender&quot;, outputCol=&quot;gender_index&quot;, handleInvalid=&quot;error&quot;)<br>df_gender = fromlabelsModel.transform(df_gender)<br><br># Only extracted interested columns<br>df_gender = df_gender.select(&#39;userId&#39;, df_gender.gender_index.cast(&quot;int&quot;))<br>df_gender.head()</pre><p>While for <strong>Numerical variables </strong>which includes <strong>:</strong> Average session time, Average number of songs played in each session, User registration period, we scaled them so they can carry the same weight.</p><p>We did this by:</p><ul><li>Building a scale_column function which was done by creating a vector using <em>pyspark.ml.feature VectorAssembler </em>and passing the vector to a scaler class using <em>pyspark.ml.feature StandardScaler </em>which ensures that data in those numerical columns is scaled to unit variance. (View code snippet below)</li></ul><pre>def scale_column_with_StandardScaler(df, column_name):<br>    &#39;&#39;&#39;<br>    Scale column using the StandardScaler<br>    <br>    Input :<br>        df:Spark dataframe<br>        column_name:  Column name with numerical value to be scaled with the StandardScaler<br>    <br>    Output :<br>        df_scaled: New Spark dataframe with the &quot;_vec&quot; and &quot;_scaled&quot; columns<br>    &#39;&#39;&#39;<br>    <br>    # Creating a vector of sessionTime first before scaling <br>    column_vec = column_name + &#39;_vec&#39;<br>    assembler = VectorAssembler(inputCols=[column_name], outputCol=column_vec)<br>    df_scaled = assembler.transform(df)<br><br>    # Using the StandardScale to scale the session time<br>    column_scaled = column_name + &#39;_scaled&#39;<br>    scaler = StandardScaler(inputCol=column_vec, <br>                            outputCol=column_scaled, <br>                            withStd=True)<br><br>    # Selecting only the interested columns<br>    df_scaled = scaler.fit(df_scaled).transform(df_scaled)<br>    <br>    return df_scaled;</pre><p>Finally, we put our transformed data into a new data frame which contains two columns for <strong>features and labels.</strong></p><h3>Model building and Evaluation</h3><p>In this modelling section, we used Spark to build Machine Learning models in conjunction with CrossValidator and ParamGridBuilder to tune hyper parameters to find the best model.</p><p>After the feature engineering process, we kickstarted the process by splitting the data into training and test sets (80/20), and evaluated the accuracy of the various models, tuning parameters as necessary.</p><p>We Determined the winning model based on test accuracy and reported results on the validation set. Since the churned users are a fairly small subset, we used the F1 score as the metric to optimize.</p><p>We chose three models to train and compare with each other.</p><ul><li>logistic regression</li><li>Support Vector Machine</li><li>Gradient Boosted Tree</li></ul><p><strong>logistic regression: </strong>By using Spark’s machine learning capabilities we built a logistic model that was fast and easy to train. (View code snippet below)</p><pre>#Logistic Regression with a pipeline and paramGrid to construct a CrossValidator object<br>e1 = MulticlassClassificationEvaluator(metricName=&#39;f1&#39;)<br>paramGrid = ParamGridBuilder().addGrid(log.regParam,[0.0, 0.05, 0.1]).build()<br>crossval = CrossValidator(estimator=log,<br>                          estimatorParamMaps=paramGrid,<br>                          evaluator=e1,<br>                          numFolds=3)<br>#fit with the train set<br>cvModel_q1 = crossval.fit(train)<br><br>#report the f1 score <br>cvModel_q1.avgMetrics<br><br># Get predicted value of the test set<br>results_q1 = cvModel_q1.transform(test)<br><br># Checking accuracy of the results<br>print(results_q1.filter(results_q1.label == results_q1.prediction).count())<br>print(results_q1.count())<br><br>print(&#39;Accuracy of the best LogisticRegression model: {}&#39;.format((885/1055)*100.))<br><br>Using BinaryClassificationEvaluator to find the area under ROC<br><br>evaluator = BinaryClassificationEvaluator(rawPredictionCol=&quot;rawPrediction&quot;)<br>evaluator.getMetricName()<br>evaluator.evaluate(results_q1)</pre><p><strong>Results</strong></p><pre>F1 : 0.7626438334526409<br>Accuracy of the best LogisticRegression model: 83.88625592417061<br>BinaryClassificationEvaluator area under ROC: 0.7073533672206274</pre><p><strong>Support Vector Machine: </strong>A SVM model was built using Spark’s machine learning capabilities. (View code snippet below)</p><pre>#Support Vector Machine<br>e2 = MulticlassClassificationEvaluator(metricName=&#39;f1&#39;)<br>paramGrid = ParamGridBuilder().addGrid(svm.regParam,[0.01, 0.05, 0.5]).build()<br>crossval = CrossValidator(estimator=svm,<br>                          estimatorParamMaps=paramGrid,<br>                          evaluator=e2,<br>                          numFolds=3)<br><br>#fit with the train set<br>cvModel_q2 = crossval.fit(train)<br><br>#report the f1 score <br>cvModel_q2.avgMetrics<br><br># Get predicted value of the test set<br>results_q2 = cvModel_q2.transform(test)<br><br># Checking accuracy of the results<br>print(results_q2.filter(results_q2.label == results_q2.prediction).count())<br>print(results_q2.count())<br>print(&#39;Accuracy of the best SVM model: {}&#39;.format((883/1055)*100.))<br><br>Using BinaryClassificationEvaluator to find the area under ROC<br><br>evaluator = BinaryClassificationEvaluator(rawPredictionCol=&quot;rawPrediction&quot;)<br>evaluator.getMetricName()<br>evaluator.evaluate(results_q2)</pre><p><strong>Results</strong></p><pre>F1 : 0.7531738901952801<br>Accuracy of the best SVM model: 83.69668246445498<br>BinaryClassificationEvaluator area under ROC: 0.6981484895572702</pre><p><strong>Gradient Boosted Tree: </strong>We built a GBT model that took the longest to train but resulted in the best result. (View code snippet below)</p><pre>e3 = MulticlassClassificationEvaluator(metricName=&#39;f1&#39;)<br>paramGrid = ParamGridBuilder() \<br>    .addGrid(gbt.maxDepth,[5, 10]) \<br>    .build()<br>crossval = CrossValidator(estimator=gbt,<br>                          estimatorParamMaps=paramGrid,<br>                          evaluator=e3,<br>                          numFolds=3)<br><br>#fit with the train set<br>cvModel_q3 = crossval.fit(train)<br><br>#report the f1 score <br>cvModel_q3.avgMetrics<br><br># Get predicted value of the test set<br>results_q3 = cvModel_q3.transform(test)<br><br># Checking accuracy of the results<br>print(results_q3.filter(results_q3.label == results_q3.prediction).count())<br>print(results_q3.count())<br>print(&#39;Accuracy of the best GBT model: {}&#39;.format((1045/1055)*100.))<br><br>Using BinaryClassificationEvaluator to find the area under ROC<br><br>evaluator = BinaryClassificationEvaluator(rawPredictionCol=&quot;rawPrediction&quot;)<br>evaluator.getMetricName()<br>evaluator.evaluate(results_q3)</pre><p><strong>Results</strong></p><pre>F1 : 0.9553887649455196<br>Accuracy of the best GBT model: 99.0521327014218<br>BinaryClassificationEvaluator area under ROC: 0.9983736732597646</pre><p>We can see that the best model trained using <strong>Gradient-boosted Tree </strong>was very accurate in predicting churn with an accuracy score of 99% and the area under ROC curve metric at 99.8% when comparing to the best model trained using the Logistic regression which resulted in an accuracy score of 83.8% and the area under ROC curve metric of 70.7%</p><h3>Conclusion</h3><p>In this project, we were able to study the Sparkify streaming service dataset and created models to predict customer churn after carrying out feature engineering.</p><p>We started by exploring the data that we have and trying to understand the different levels of the dataset and how it impacted churn. Such a detailed analysis was necessary for an adequate selection of features for further model building. We went further to create features that were later used in building three machine learning models and limited our features to a handful of features to avoid overfitting of the models. The choice of features is also justified by the limitation in power and memory, so we were unable to select too many features.</p><p>In the modelling section, we used Spark to build Machine Learning models in conjunction with CrossValidator and ParamGridBuilder to tune hyper parameters to find the best model.</p><p>Among the three models we trained:</p><ul><li>logistic regression (best f1 score 0.7641) (Accuracy of the best Logistic model: 83.88%)</li><li>Support Vector Machine (best f1 score 0.7534) (Accuracy of the best SVM model: 83.69%)</li><li>Gradient Boosted Tree (best f1 score 0.7621 ) (Accuracy of the best GBT model: 99.05%)</li></ul><p>The GBT performed best with good f1 scores and high accuracy score of 99% although it took the longest time to train.</p><p>See an in depth analysis of this project on my <a href="https://github.com/OmoyeniO/Churn-Prediction-Using-Spark#:~:text=/-,Churn%2DPrediction%2DUsing%2DSpark,-Public">Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fce0e0f0f1d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WHAT DATA TELLS YOU ABOUT AIRBNB BUSINESS IN SEATTLE]]></title>
            <link>https://omoyeni-ogundipe.medium.com/what-data-tells-you-about-airbnb-business-in-seattle-5c403ebb9d15?source=rss-f97fcacf81fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c403ebb9d15</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[airbnb]]></category>
            <category><![CDATA[seattle]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[udacity-nanodegree]]></category>
            <dc:creator><![CDATA[Omoyeni Ogundipe]]></dc:creator>
            <pubDate>Wed, 07 Sep 2022 18:58:48 GMT</pubDate>
            <atom:updated>2022-11-13T18:59:58.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*IGPdRnuGWDVM5pSs2EQP2w.png" /></figure><p>Seattle, a seaport city on the West Coast of the United States, known amongst other things for being one of the most expensive places to stay in the United States.</p><p>Everybody wants to visit the bubbly city that boasts of rich culture, class and elegance and also houses the headquarters of global tech giants without breaking the bank. Wouldn’t it be nice to know what time of the year rent expenses are cheaper?</p><p>To find out, I have carried out data analysis on data from Airbnb in Seattle to answer some interesting questions and give some insights into the business.</p><p>The data is an open data gotten from <a href="https://www.kaggle.com/datasets/airbnb/seattle">Kaggle</a> and contains information on 3818 listings for 365 days from 2016 to 2017.</p><p>Some of the questions we hoped to answer were:</p><p>1) When is the busiest time of the year and what is the average price at that time?</p><p>2) Which neighborhoods are the most expensive?</p><p>3) Which listing features influence price? (Build a predictive pricing model)</p><p>4) Does cancellation policies have an effect on booking ?</p><h3>1. When is the busiest time of the year and what is the average price at that time?</h3><blockquote>The busiest time of the year for Airbnb in Seattle is around January. After that period, Airbnb occupancy rate experiences a decline before it begins to pick up again in March and fall again from July through December.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*yXTk8-v4qRNrQfDPuv5pKQ.png" /></figure><p><strong><em>What is the average price at the busiest time of the year?</em></strong></p><blockquote>The average price at the busiest time of airbnb listings in Seattle is around $122. As the month goes by, the average prices seem to rise. However, from July, when the prices are at the peak and when occupancy begins to decline, we also see a steady decrease in prices as well.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*cXrT142ZQ8KMJ4xnDcQSnA.png" /></figure><p><strong>We also looked at the busiest time of the week and prices at those times to get a deeper understanding.</strong></p><blockquote>The busiest time of the week is between Wednesday and Saturday, with the peak being Saturday. Also, the prices follow a similar trend to how busy the week is, with prices rising from Thursday and peaking on Saturday, followed by a price drop on Sunday.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*JvyVE6U_3MHaibiVrVZB3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*Cmj_HtvA-evs5mPli2Fm5g.png" /></figure><h3>2. Which neighborhoods are the most expensive?</h3><p><strong><em>Firstly, let’s look at how prices are distributed in Seattle.</em></strong></p><p>The prices of airbnb listings in Seattle ranges from $20 to $1000. The median price being $100 and the mean price $127. This discrepancy can be attributable to highly priced listings in Seattle (outliers) which we will exclude for this analysis.</p><p>Looking at the histogram, we can see the concentration of prices between the $100 and $130 mark</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*XB1HSdaWp4XELRmZ6gwCeQ.png" /></figure><p><strong><em>Secondly, we determine which neighborhoods have the most listings</em></strong></p><p>From the first EDA, we see that Broadway, Belltown and Wallingford are the top 3 neighborhoods based on the count of listings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*w1TUwEwz5OWecuBa18cJ_A.png" /></figure><p>However, this doesn’t show the full picture as some neighborhoods could have bigger counts due to a larger sizes. To better understand top neighborhoods, we look at listing density to see the spread of listings in a neighborhood and determined that indeed, neighborhood groups Capitol Hill, Downtown which contain Broadway and Belltown respectively are among the top three neighborhood groups based on listing counts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XnOb8nFVZlLs87C3Y26MDg.png" /></figure><p><strong><em>Finally, we determine which neighborhoods are the most expensive.</em></strong></p><blockquote>Central Business District is the most expensive, and North Beacon Hill is the cheapest neighborhood.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*gnqID-raI_hcOQJ_OUTVnQ.png" /></figure><p>Also, we notice that the more expensive neighborhoods have most of their listings in the $101 — $200 price range, whereas, the rest have most of their listings in the $1- $100 price range. Broadway, which is somewhere around the middle, has almost the same no of listings as Belltown in the $101- $200 price range.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*shNUq5PZSGlZtZL5J-dZFA.png" /></figure><h3>3) Which listing features influence price?</h3><p>To answer this question, we will:</p><p>i. Build a predictive model using different attributes of the listings.</p><p>ii. Train the model on the listing data and</p><p>iii. Find out the most important features that have an impact on the model.</p><p>After cleaning and preparing the data for modeling, and carrying out feature selection, a price prediction model was built and trained using LGBMRegressor(). The performance of the model was measured using Mean Absolute Error which resulted in a score of 0.2279 which is good but can be better.</p><p>Let’s look at a plot showing predicted values against actual values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*WIfEESW_cRyLyZX8Tfwddw.png" /></figure><p>One of the things we’ll notice from the plot is that the spread of the actual and predicted prices is quite low from below 200. This can be considered a good thing as most of the listing prices are below 200. However, more work can be done on the model to optimize it.</p><p>For example:</p><ul><li>We can try different other ways of handling missing values</li><li>Increase the corr coef threshold, which will in turn increase the list of numerical features used</li><li>Hyper-parameter tuning to improve model accuracy</li></ul><p><strong><em>Which features in the trained model are important in predicting a listing price?</em></strong></p><blockquote>Reviews per month, number of reviews, number of amenities, cleaning fee, and accommodates seem to be most important features in listing price prediction. Note that accommodates, extra people, guests included and bathrooms are all related to the size of the property. Thus, the size of the property is a very important feature in determining listing price, along with reviews and cleaning fee.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*XDh45Sonc0e1cYY9VSIOSQ.png" /></figure><h3>4) Does cancellation policies have an effect on booking ?</h3><p><strong><em>Firstly let’s try to understand listings and cancelation policies in Seattle.</em></strong></p><p>Listings with Strict cancellation policies are the most listed in Seattle. However, moderate cancellation policies have the maximum range of listing price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*0PH2ksWkZbtV6gUE4kiLDQ.png" /></figure><blockquote>We were unable to establish a linear correlation between occupancy and what the cancelation policy is as the correlation between occupancy and cancelation policy is 0.047.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*ZTmOn-DwPPUMnKzEZ12xKQ.png" /></figure><h3>Conclusion</h3><p>Although there are different ways to find out what time of the year would be a good time to visit Seattle without breaking the bank, the entirety of the decision depends on why you are visiting and how you plan your trip.</p><p>I hope that the insights gotten from this analysis gives a clearer picture about Airbnb business in Seattle.</p><p>I have used powerful python libraries for analysis, modeling and visualization. Please refer to my <a href="https://github.com/OmoyeniO/Analyzing-Seattle-Airbnb-Data-Udacity-Data-Science-Project-">Github</a> for the full code.</p><p>Thanks for reading !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c403ebb9d15" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>