<?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 Valerie Lim on Medium]]></title>
        <description><![CDATA[Stories by Valerie Lim on Medium]]></description>
        <link>https://medium.com/@valerielimyh?source=rss-614d885a7aca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*9f9fkL5GmeM_PsEawxHk-g.jpeg</url>
            <title>Stories by Valerie Lim on Medium</title>
            <link>https://medium.com/@valerielimyh?source=rss-614d885a7aca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:20:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@valerielimyh/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[OMSCS CS7646 (Machine Learning for Trading) Review and Tips]]></title>
            <link>https://valerielimyh.medium.com/omscs-cs7646-machine-learning-for-trading-review-and-tips-f9c3a63e853f?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9c3a63e853f</guid>
            <category><![CDATA[course-reviews]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[omscs]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Sun, 26 Dec 2021 02:24:38 GMT</pubDate>
            <atom:updated>2021-12-27T05:18:51.542Z</atom:updated>
            <content:encoded><![CDATA[<p>In my first semester, I took Machine Learning for Trading (ML4T) and Reinforcement Learning (RL) which you can find my review and tips about that course <a href="https://medium.com/@valerielimyh/omscs-cs7642-reinforcement-learning-review-and-tips-5960090e6587">here</a>.</p><h3>Why did I take the course?</h3><p>Understanding human behaviours has been an area of interest to me, in particular human behaviour with a temporal aspect (such as consumer decision journey).</p><p>Through my projects in my current role at Dell, I found that sequential models (e.g. LSTM, transformers) are a great way to model unstructured text such as feedback. I found that such models achieve decent results in classifying feedback/comments into their respective categories with minimal feature engineering. As such, I wanted to dive into the ML4T course to learn more about sequential modelling, and how to frame the stock market data into a machine learning problem. I believe such techniques would be useful and transferable to datasets in other domains.</p><p>While I have some basic understanding of trading and investment that I gathered through research, I wanted to improve my acumen in this aspect, as I believe learning how to invest is a life skill, and it is an important component to achieve FIRE.</p><h3>What’s the course like?</h3><p>There are 2 components to this course, 8 homeworks, and 2 non-cumulative exams, a midterm and final exam. Most of the applied learning stems from the homeworks.</p><p>There is 1 homework assignment due every alternate week. The assignments require knowledge in Python programming and a basic understanding of object-oriented programming. All assignments are auto-graded when you submit your source code to the autograder system. Some assignments require an additional report (ranging from 5 to 7 pages depending on the assignment) that includes your methodology, discussion of results and visualizations, in addition to your source code. There are grading test scripts for most of the assignments. These were really helpful checks to ensure my scripts were functioning as intended.</p><p>These are the eight assignments we had in Fall 2021:</p><ul><li>Assignment 1: Martingale: Analyze the “Martingale” roulette betting approach for unlimited vs. limited loss</li><li>Assignment 2: Optimize Something: Use <a href="https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html">optimization</a> to find the allocations for an optimal portfolio</li><li>Assignment 3: Assess Learners: Implement decision tree learner, random tree learner, and bag learner (i.e., ensemble)</li><li>Assignment 4: Defeat Learners: Create data sets better suited for Linear Regression vs. Decision Trees, and vice versa</li><li>Assignment 5: Marketsim: Implement code that takes trades data as input and output portfolio values and metrics given a start value, commission and impact</li><li>Assignment 6: Manual Strategy: Create a manual strategy that outputs higher returns than benchmark (this manual strategy is used as a comparison with a machine learner in assignment 8)</li><li>Assignment 7: Q Learning Robot: Implement a Q-Learner with Dyna Q framed by a simple robot navigation problem</li><li>Assignment 8: Strategy Learner: Frame the trading problem using a learning approach from one of the earlier assignments (Tree-based, Q-Learner).</li></ul><p>Lastly, each exam consists of 30 MCQs, to be completed in 35 min. I prepared for it by going through the lectures, assigned readings. I also practiced past year exam questions.</p><ul><li>Question bank for midterm <a href="https://kirkbrunson.github.io/ml4t-guide/">here</a></li><li>Question bank for finals <a href="https://quizlet.com/348217964/ml4t-questions-4-rating-3-votes-flash-cards/">here</a></li></ul><p>The class is organised into three mini courses: (1) General Python, Numpy, Pandas, (2) Finance, (3) Machine Learning (in Finance). The first mini-course covered the use of Python libraries for data manipulation and analysis. This would be a breeze for those with a background in Python. It is also a good refresher on the use of Numpy to perform vectorization to reduce the time complexity of your code. The second mini-course covered fundamental analysis and technical analysis, with a stronger focus on the latter, as this is where machine learning can be applied on. The final minicourse covered the use of decision trees and Q-learning to solve a trading problem. More details can be found on the <a href="https://lucylabs.gatech.edu/ml4t/fall2021/">course website</a>.</p><h3>What did I learn?</h3><p>The course helped to supplement my knowledge in trading — I had a better understanding on how the stock market works, on stock market data, on how to leverage technical indicators to construct a portfolio. I also enjoyed framing the stock market trading problem into a supervised learning problem for machine learning, such as prediction the next day’s price (i.e. a regression problem), or whether to buy or sell (i.e. a classification problem)</p><h3>Grades</h3><p>I got an A for this course :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9c3a63e853f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OMSCS CS7642 (Reinforcement Learning) Review and Tips]]></title>
            <link>https://valerielimyh.medium.com/omscs-cs7642-reinforcement-learning-review-and-tips-5960090e6587?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/5960090e6587</guid>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[deep-rl]]></category>
            <category><![CDATA[omscs]]></category>
            <category><![CDATA[course-reviews]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Sun, 26 Dec 2021 02:21:46 GMT</pubDate>
            <atom:updated>2021-12-27T05:19:16.479Z</atom:updated>
            <content:encoded><![CDATA[<p>In my first semester, I took Reinforcement Learning (RL) and Machine Learning for Trading (ML4T) which you can find my review and tips about that course <a href="https://medium.com/@valerielimyh/omscs-cs7646-machine-learning-for-trading-review-and-tips-f9c3a63e853f">here</a>.</p><p>The RL course was a very fruitful one. We learnt how an agent can take the best action while navigating the world, and implemented <a href="https://ai.googleblog.com/2019/06/introducing-google-research-football.html">seminal</a> algorithms in the Multi-agent RL space.</p><h3>Why did I take the course?</h3><p>Understanding human behaviours has been an area of interest to me, in particular human behaviour with a temporal aspect (such as consumer decision journey). I’m excited to uncover how to leverage sequential data and techniques in RL to understand human behaviour, and suggest the next best action. I believe learnings from RL can help me build more accurate people-centric models. The teaching assistants (TAs) made this course a lot more enjoyable, with their regular office hours and guidance throughout this period. The TAs would clarify doubts and questions about the lectures, homeworks, projects and exams during the office hours (held twice weekly).</p><h3>What’s the course like?</h3><p>This course is rather heavy in terms of workload. There are 4 components to this course, 6 homeworks, 3 projects and 1 final exam. There are about 2 hours of lectures every week.</p><p>There is 1 homework assignment due almost every other week, except on weeks where we have to submit our projects too. These 6 homeworks constitute 30% of the overall grade. They are designed to hone the basics of RL, such as using Policy Iteration, or SARSA, or Q-learning to solve a problem.</p><p>There are also 3 projects that make up 45% of the overall grade. Each project involves writing a report of no more than 5 pages, and submitting your source code. In the first project, we replicated the seminal <a href="https://www.semanticscholar.org/paper/Learning-to-Predict-by-the-Methods-of-Temporal-Sutton/6ce57ab17fcd507b856a79874063b59555c76b3a">TD-lambda paper by Sutton</a>, while in the second project, I built a deep RL agent to land a rocket in <a href="https://gym.openai.com/envs/LunarLander-v2/">OpenAI’s LunarLander environment</a>! The last project involved building a multi-agent deep RL agent to beat the baselines provided by the RL teaching team in the <a href="https://ai.googleblog.com/2019/06/introducing-google-research-football.html">Google Football Research environment</a>! I enjoyed the last 2 projects, as they provided hand-on experience with deep RL, though I found the last project to be the most rewarding and practical. This is because a successful agent rarely acts in a vacuum — in applications such as flying a drone, negotiating, agents must learn to act optimally not only within their environment, but also in the presence of other adaptive agents in their environment. While the last project was the most time-consuming, I’m very glad to dig into this new field of multi-agent deep RL, digging into RLlib (which is an open-source library for RL).</p><p>Lastly, there is a heavy weightage (worth 25% of the overall grade) final exam. The exam format was 50 MCQs, that tested knowledge from the whole course. I prepared for it by going through the lectures, assigned readings and textbook. Most of the MCQs were very tricky. You get to see your results immediately after submitting your responses.</p><h3>What did I learn?</h3><p>The course covered the basics of RL, starting from model-based methods such as Value Iteration and Policy Iteration, as well as model-free methods such as SARSA, Q-learning (using tabular methods) and deep Q-learning, to multi-agent RL (I implemented Counterfactual multi-agent Proximal Policy Optimization (COMA PPO) in my third project). I also enjoyed learning to use a new library, RLlib, to implement the COMA PPO algorithm in my final project.</p><p>There are many opportunities to read, understand and replicate research papers, and finally convey your understanding and analysis in a report.</p><h3>What’s next?</h3><p>I’m excited to further explore deep RL, and learn how they can be applied to understand and predict human behaviour. One of the TAs, Miguel wrote a great <a href="https://github.com/mimoralea/gdrl">book</a> on deep RL which I’ll find time to dive deeper into. I also hope I will be able to find useful use cases to apply them at work.</p><h3>Tips</h3><p>I did some preparation work ahead of the course, such as covering the first 8 chapters of David Silver’s <a href="https://www.davidsilver.uk/teaching/">seminars</a> and looking through the textbook to fill gaps in my learning.</p><h3>Grades</h3><p>I’ve been an average performer for projects and homeworks. The exam was really tricky, and I was quite shocked when I received my exam results. Thankfully, there was a curve that was skewed in my favour, and I got an A in the end :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5960090e6587" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m starting my Masters in Computer Science journey at Georgia Tech!]]></title>
            <link>https://valerielimyh.medium.com/im-starting-my-masters-in-computer-science-journey-at-georgia-tech-75a432e32002?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a432e32002</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[georgia-tech]]></category>
            <category><![CDATA[omscs]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[masters-degree]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Sun, 26 Dec 2021 02:09:21 GMT</pubDate>
            <atom:updated>2021-12-26T02:09:21.921Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been accepted into Georgia Tech’s Online Master of Science in Computer Science (OMS CS)!</p><p>I’m eager to learn at a top CS school and apply my new knowledge simultaneously at my job in Dell Tech.</p><p>Here are my essays I wrote for my application:</p><h3>Essay 1: Background</h3><p><em>Please describe your background (academic and extracurricular) and experience, including research, teaching, industry, and other relevant information (&lt;=2000 characters).</em></p><p>My career goal is to build machine learning products that can transform people’s lives. To achieve my goal, I have been learning voraciously about Data Science such as Python programming, statistics, computer science for the past two years. My current job and past experiences have honed those skills tremendously. I believe I am ready to take my career to the next level by going for formal education in an esteemed CS programme at a world-class institution like Georgia Tech.</p><p>After college, I joined the Ministry of Communications and Information (MCI) as an analyst. At MCI, I used Python extensively to automate various analytics workflow and won an award for my contribution. I also built various Machine Learning models using logistics regression, LDA and time series modelling for numerous use cases centering on Singaporeans’ sentiments about core issues in the country.</p><p>I joined a three-month Data Science bootcamp called Metis after my role at MCI. At Metis, I implemented a range of machine learning projects. in the areas of regression, supervised and unsupervised learning, natural language processing, recommender system and more. One of my key projects is a recommender system built with Spark ALS model to improve e-commerce product recommendation. After twelve gruelling weeks, I successfully landed a job at Dell Technologies as a Data Scientist.</p><p>At Dell, I spearheaded the development of a multi-label classification model using BERT to triangulate feedback from the sales team and customers at Dell. My team’s effort was eventually recognized by Dell leaders at a global competition. In my free time, I also conducted a training session for my team to share how to build a scalable analysis workflow with Spark.</p><p>My journey to become a data scientist to build machine learning products has been quite successful yet rather arduous. While my knowledge in CS has improved a lot over the past two years through my work and various activities, I still believe that a formal postgraduate education in CS is a much-needed and invaluable opportunity to master advanced topics in CS that I would not have the chance to learn on the job.</p><h3>Essay 2: Statement of Purpose</h3><p><em>Please state why you wish to study in your chosen program at Georgia Tech. Your statement should describe your academic background, training, and professional experiences. You should also mention honors, memberships, and extracurricular activities. Be sure to discuss special areas of research or interest. Please be concise and specific in your response (&lt;= 1000 words).</em></p><p>My career goal is to design and build innovative Machine Learning products that can transform people’s way of living. Think autonomous vehicles, smart home devices, and even more futuristic products. In order to achieve my goal, I have been dedicating time on weekday evenings and weekends to learn programming, Machine Learning, statistics and computer science for the past 2 years through a combination of MOOCs, Leetcode/Hackerrank and personal projects. I have further honed my programming and Data Science skills through an intensive full-time 3-months Data Science Bootcamp at Metis. I also have relevant technical working experiences at a Singapore ministry and more recently, Dell Technologies. My various technical experiences have prepared me well for OMSCS. On top of that, I believe that my grit and persistence to succeed would allow me to do well in OMSCS.</p><p>I graduated with an Honours degree in Psychology from the National University of Singapore (NUS). At NUS, I was trained in statistical modeling, research, and experimental design. I also learned about how people perceive, think, and behave, which helps me build customer-facing Machine Learning features in my work. In my undergraduate years, I was more interested in the statistical aspect of Psychology, and started honing my coding and Data Science skills by applying techniques I learned through online courses to my side projects and final year<strong> </strong>thesis. For my thesis, I used Python to preprocess my data, and applied regression analysis and discovered that academic motivation, parental involvement and personality traits such as consciousness are factors in predicting academic resilience among students. I also embarked on an internship at Urban Redevelopment Authority, where I assisted to build an ETL pipeline by preprocessing data using Python, which further developed my coding skills.</p><p>After college, I joined the Ministry of Communications and Information as a full-time Data Analyst. I spearheaded the first unsupervised segmentation model, using Singaporeans’ demographics data. Subsequently, I uncovered the corresponding sentiments for each segment which helped inform policymakers about different engagement strategies to employ with different citizen segments. I also automated various analytics workflows and reduced computation time by 90% which won an award at a ministry-wide competition. I yearned to deepen and accelerate my knowledge in Machine Learning and build personalized end-to-end systems that address clients’ and businesses’ needs. Hence, I embarked on Metis Data Science Bootcamp.</p><p>At Metis, I implemented five Machine Learning projects that address business challenges and enhance business value. One of them involved developing a recommender system using Spark ALS for individuals based on their customers lifetime value and product ratings to provide more targeted suggestions that improve user experience and ensure retention. With my heightened passion for Machine Learning, I embarked on the next phase of my career as a Data Scientist.</p><p>At Dell, I build systems to deepen businesses’ understanding of their clients and translate it to business growth and profitability. To triangulate feedback from the sales team and customers, I developed a Multi-Label Classification API using BERT with an F1 score of 87%, and deployed the Flask app on Dell’s server. The contextual model saved around 84 man-hours in tagging comments to their appropriate labels, and would potentially lead to revenue preservation of USD 2.7B by addressing key challenges impacting topline growth and customer retention. This project was recognized by Dell leaders at a global competition. In addition, I deployed Convolutional Neural Network (CNN) and Object Detection models with 98% accuracy on Flask using Docker to automate manufacturing defect detection for a Fortune 500 company as a Proof of Concept. I also developed and automated unit testing scripts such as pre-train tests to ensure correct implementation of the CNN and Object Detection model algorithms, and evaluation tests to ensure satisfactory model performance. During my free time, I also conducted a training session for my team to share how to build a scalable analysis workflow with Spark.</p><p>Why study computer science if I want to be a full-stack Data Scientist? My research and work experience revealed that an infrastructure able to store, ingest and process data and generate real-time predictions for business users or customers is equally<strong> </strong>or more important than developing a model using open-source tools. To develop scalable and high-performance end-to-end systems, I need to master the fundamentals of<a href="https://omscs.gatech.edu/cs-7641-machine-learning"> Machine Learning</a> and advanced topics in computer science, such as<a href="https://omscs.gatech.edu/cs-6515-intro-graduate-algorithms"> Algorithms</a> and <a href="http://www.omscs.gatech.edu/cs-6290-high-performance-computer-architecture">High-Performance Computing</a></p><p>Thus far, I derive my computer science knowledge from self-learning and work experience, albeit facing some technical difficulties along the way as my CS knowledge fell short. Through a holistic and structured OMSCS program at Georgia Tech, with a specialization in Machine Learning, I believe I can accelerate my learning under the guidance of experienced and dedicated instructors, and engagement with fellow enthused learners.</p><p>At the same time, immersing myself in a rigorous learning experience like the OMSCS while working full-time in a rewarding job at Dell Technologies would be an excellent catalyst for my career goal. The synergy between applied technical knowledge and hands-on work experience would empower me to build scalable and high-performance systems in course projects and at work.</p><p>With my enhanced skill sets upon graduation, I intend to apply my acquired knowledge in Machine Learning algorithms, software development cycles and good architecture design, etc., to my work in Dell, share my knowledge with the team and improve their understanding and development of efficient Machine Learning systems. This would allow us to iterate more quickly and improve our ability to build scalable end-to-end systems for our customers. I aspire to become the Head of a data team some day where we develop innovative and practical Machine Learning systems that augments the intelligence of a hardware, like <a href="https://techwireasia.com/2020/09/everyone-will-have-one-alibaba-unveils-personal-cloud-computer/">the personal cloud computer that Alibaba has created</a>, which seeks to improve the convenience of people’s way of life.</p><h3>What’s next?</h3><p>I’ll be busy studying from Aug 2021 onwards. I’ll be writing reviews and tips of the courses I’ve taken, to share my experience, so my fellow coursemates can be better prepared when they take the same courses. If you’re also embarking on your journey at GT OMSCS too, feel free to drop me a message, looking forward to being classmates with you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a432e32002" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MLOps: Integrate DevOps in ML systems]]></title>
            <link>https://valerielimyh.medium.com/mlops-integrate-devops-in-ml-systems-d44d954de876?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/d44d954de876</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Wed, 19 May 2021 15:06:31 GMT</pubDate>
            <atom:updated>2021-07-21T02:25:45.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgkp670oau2Ku7mdehIPGw.png" /><figcaption>MLOps lifecycle</figcaption></figure><p>In line with the <a href="https://www.deeplearning.ai/program/machine-learning-engineering-for-production-mlops/">recent MOOC released by DeepLearning.AI on MLOps</a>, this article provides a starter kit on ML deployment, focusing on how we can integrate ML API with DevOps using Jenkins and Docker. This Continuous Integration (CI), Continuous Delivery (CD) and continuous training (CT) pipeline is implemented on AWS. This pipeline involves developing tests and automating ML deployment to ensure we can continuously deliver updated ML solutions quickly and reliably. The full end-to-end implementation can be found on my <a href="https://github.com/valerielimyh/ml_deploy_aws">Github</a></p><p>The tools used to create the examples for this post are:</p><ul><li>Github for source code management and control</li><li>Flask to deploy the ML model as an application</li><li>Docker to containerize the app. This is to ensure the model/API can be deployed in any environment</li><li>Jenkins to orchestrate the CI/CD pipeline flow so as to to seamlessly incorporate future improvements</li><li>AWS EC2 instance</li></ul><p>The current pipeline includes these jobs</p><ol><li>Train and validate model</li><li>Create a docker image for your model. This spins up a fresh, clean environment in each run, and the microservice is served in a container</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rei-wFWiDgUH8jwgpZwfaA.png" /><figcaption>A screenshot of Flask app. Demo can be found here (<a href="https://youtu.be/eAlhw-Nu_CQ">https://youtu.be/eAlhw-Nu_CQ</a>)</figcaption></figure><p>3. Create Jenkinsfile that contain all the instructions needed to orchestrate the entire pipeline automatically. The current Jenkinsfile would perform the following: When developers commit the repository to Github, Jenkins will pull the repo, build the virtual environment to run the ML model and unit tests. A new Docker image is built if the tests are passed successfully, and deployed to Docker Hub. Older versions of Docker images will be removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYEf6xEdAGW2hOzW7xtGsg.png" /><figcaption>A screenshot of a successful orchestration</figcaption></figure><ul><li>This pipeline ensures all developers’ working copies are merged into a shared mainline (Continuous Integration) and the model still functions as intended after making improvements (Continuous Delivery). As such, end-users would be able to obtain the latest build of the model.</li></ul><h3>Outlook: Production perspectives</h3><p>There are still a lot more techniques and best practices to be added to the current pipeline. E.g.</p><ol><li><strong>Techniques to create a lightweight model:</strong></li></ol><ul><li>Quantization: approximating a neural network that uses floating-point numbers by a neural network of low bit width numbers</li><li>Weight pruning: Eliminates specific connections between neurons to reduce size of neural networks</li></ul><p>2. <strong>Perform quality analysis</strong>:</p><ul><li><strong>Data drift</strong>: e.g. rotated, cropped, blurred, blocked images</li><li><strong>Model drift</strong>: model performance degrades over time. E.g. accuracy, recall, or some downstream business KPI, such as click-through rate.</li></ul><p>3. Use <strong>FastAPI</strong> as API development, instead of Flask</p><ul><li>It is faster because it’s built over ASGI vs. WSGI in Flask, and can handle multiple requests in parallel, hence the framework scales well.</li></ul><p>4. Develop <strong>integration tests</strong> to ensure the components work together seamlessly (e.g. input data is consumable by the model)</p><p>5. The current ML model is a simple image classification solution, as an example to implement the MLOps cycle. More learnings to be gained and shared when <strong>designing</strong> an end-to-end ML production system that involves project scoping, modeling strategies, deployment requirements etc. Perhaps in a follow-up post!</p><p>6. There are <a href="https://eugeneyan.com/writing/challenges-after-deploying-machine-learning/">challenges</a> post-deployment, and here’s a helpful <a href="https://eugeneyan.com/writing/practical-guide-to-maintaining-machine-learning/">guide to address those challenges</a>.</p><p>There is some work left for your productive application! Let me know how it goes in the comments below!</p><p>Take care and stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d44d954de876" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My career transition from a Data Analyst to Data Scientist]]></title>
            <link>https://medium.com/data-science/my-career-transition-from-a-data-analyst-to-data-scientist-12f79931d2fc?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/12f79931d2fc</guid>
            <category><![CDATA[lessons-learned]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[job-search]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Mon, 13 Jul 2020 13:23:51 GMT</pubDate>
            <atom:updated>2020-07-13T13:23:51.739Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UmJZ0FdbSQVgfaVECh92eg.jpeg" /></figure><h4>How I remain steadfast in my pursuit of Data Science</h4><p>6 months ago, I left my role as a Data Analyst to accelerate my learning at <a href="https://metis.kaplan.com.sg/">Metis Data Science bootcamp</a>. The 3 months course allowed me to learn in a structured way, advance my technical capabilities and gain more professional experience with the up-to-date technologies today. I implemented five end-to-end DS projects that address business challenges and enhance business value. One of them involved an <a href="https://medium.com/analytics-vidhya/personalised-recommendations-based-on-customer-segmentation-and-e-commerce-product-ratings-6465b8877815">end-to-end recommender system</a> for individuals based on their CLV and product ratings to provide more targeted suggestions that improve user experience and ensure retention.</p><p>With my heightened passion for Data Science, I embarked on my next career journey as a DS. However, searching for my next opportunity amidst the COVID-19 pandemic was fraught with challenges and setbacks. A corollary of the pandemic is uncertain business climate, hiring freeze, retrenchment. Nevertheless, finding a job during this uncertain and difficult period has taught me various lessons.</p><h4>1. A career is a marathon, not a sprint.</h4><p>While there were bouts of excitement and eagerness as I made it to the last round of hiring processes, there were also disheartening periods of rejections. Instead of being overly dismayed by the outcome, I constantly remind myself to focus on the process, learn something new every day and apply it. Undoubtedly, this was not easily achieved as my results-oriented personality runs contrary to a slow and steady approach.</p><h4>2. This brings me to my second lesson — perspective shifting.</h4><p>I remind myself to adopt another perspective when disheartened by declines or worn out from the learning process. For instance, when displaced by applicants with more experience or stronger domain knowledge, I perceive such setbacks as an opportunity to hone my skills, gain more industry knowledge, and prepare myself for my right job out there, but just not visible yet.</p><p>After over 70 applications, 30 interviews, numerous take-home assignments and live coding sessions, I’m honoured and thankful to be a Data Scientist at Dell’s Customer Experience Group, and excited to work alongside a talented DS community to improve user experience and ensure retention.</p><h4>3. This process would not have been possible without the strong support from my family, friends and mentors.</h4><p>I’m also immensely grateful for my friends for their unwavering support, and mentors for their invaluable guidance and encouragement during this period. Your support and advice have helped me hang in there during this challenging and uncertain business climate. A big thank you to my friends who have kindly agreed to refer me during my job search process too, I truly appreciate your help.</p><h4>4. As I begin my journey as a Data Scientist, I’m also reminded not to rest on my laurels, and to be always hungry for knowledge.</h4><p>This Data Science/Artificial Intelligence industry is evolving rapidly every day, with a vast amount of new knowledge to be acquired. To this end, I seek to hone my technical capabilities by taking <a href="http://coursera.org/verify/specialization/NH8FTXZ5URG5">Deep Learning course</a>, becoming <a href="https://aw.certmetrics.com/amazon/public/verification.aspx?code=QXNCNF3KEMQEQDCK">AWS certified</a>, applying state-of-the-art NLP (Natural Language Processing) techniques such as BERT on my side projects, such as to <a href="https://github.com/valerielimyh/Intent_Recognition_using_BERT">recognise users’ intention from their messages</a>, and to <a href="https://medium.com/analytics-vidhya/to-be-rt-or-not-to-be-rt-7b7b1f008d37">extract key phrases from sentences that best describe its sentiment</a>. Currently, I’m participating in Shopee’s largest online competition in Asia (<a href="https://careers.shopee.sg/codeleague/">Shopee Code League</a>) where I applied the latest Computer Vision techniques to <a href="https://www.kaggle.com/datahan/tf-record-pipeline">classify Shopee’s product images into its corresponding categories</a>, and apply <a href="https://engineering.fb.com/ai-research/unsupervised-machine-translation-a-novel-approach-to-provide-fast-accurate-translations-for-more-languages/">Unsupervised Machine Translation</a> to translate Traditional Chinese product titles to English, without the use of parallel data.</p><p>I’m eager to develop my skillset to unlock the power of data, empower others to make data-informed decisions and communicate these insights to them, and work towards becoming a Full-Stack Data Scientist in which I build automated and scalable applications for people!</p><p>Interested to follow my journey? Feel free to reach out to me on <a href="https://www.linkedin.com/in/valerie-lim-yan-hui/">LinkedIn</a>, to exchange ideas or an informal chat. You can check out my write-ups for my other Data Science projects <a href="https://medium.com/@valerielimyh">here</a> too :) Take care and stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12f79931d2fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/my-career-transition-from-a-data-analyst-to-data-scientist-12f79931d2fc">My career transition from a Data Analyst to Data Scientist</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To be(rt) or not to be(rt) ]]></title>
            <link>https://medium.com/analytics-vidhya/to-be-rt-or-not-to-be-rt-7b7b1f008d37?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b7b1f008d37</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[bert]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[hugging-face]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Tue, 26 May 2020 14:38:33 GMT</pubDate>
            <atom:updated>2020-05-27T13:21:31.311Z</atom:updated>
            <content:encoded><![CDATA[<h3>To be(rt) or not to be(rt)</h3><p>A beginner’s friendly walkthrough of the current SOTA NLP model</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfn6WmU8hCi44e56CtTRVQ.png" /><figcaption><a href="https://medium.com/tensorflow/using-tensorflow-2-for-state-of-the-art-natural-language-processing-102445cda54a">Image credit</a></figcaption></figure><p>There are a variety of NLP techniques, from simple Bag of Words approach (e.g. TF-IDF), to static word embeddings (e.g. word2vec, Glove), to contextualized (i.e. dynamic) word embedding. Static word embeddings generate the same embedding for the same word in different contexts. For instance, these two sentences — “this movie is not good at all” vs. “this offer is too good to be true” have the same word ‘good’, but they have different meanings in the two sentences. Static word embeddings would return the same embedding for ‘good’. On the other hand, the current state-of-the-art NLP technique, BERT (Bidirectional Encoder Representations from Transformers), uses transformers, which introduced an attention mechanism, that processes the entire text input simultaneously to learn contextual relations between words (or sub-words). As such, BERT would return different embeddings for the word ‘good’. At the same time, unlike static word embeddings which only outputs vectors for downstream tasks, BERT outputs the trained model and vectors. This means we can fine-tune a pre-trained transformer model for our own use cases.</p><p>There are different versions of same model from tfhub, google-research, huggingface, etc. I will be using Huggingface since they have made it very easy to switch between different models (e.g. BERT, DistilBERT, RoBERTa, XLNet. I covered a brief difference between these variations in section ii of this article) and the models are compatible with PyTorch and Keras.</p><p>This tutorial will be based on a tweet sentiment extraction obtained from <a href="https://www.kaggle.com/c/tweet-sentiment-extraction/overview">Kaggle</a>. A training input has the 4 variables, id, `full text`, `sentiment label`, and `selected text` that best represents the sentiment label. Given a new input with only full text and sentiment label, the model would extract support phrases from the full text that best represents the corresponding sentiment. Sentiment analysis is prevalent in many aspects of NLP, such as understanding the tone of users’ messages on chatbots so as to provide appropriate responses as per user mood and help in downstream analysis of services and breakdowns. Capturing support phrases that led to the sentiment description can help in downstream analysis.</p><h3>i) A general pipeline for a transformer model</h3><ol><li>Text preprocessing</li><li>Model Training</li><li>Fine-tuning</li><li>Inference</li></ol><h4>1. Let’s preprocess our data so that it matches the data DistilBERT was trained on.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*py_4IQGNaI2f6HK3c078uA.png" /></figure><h4>2. Model Training</h4><p>For every token in the input sentence, DistilBERT will output a 768-dimension vector (i.e. embeddings. I use the default hidden layer size but this is configurable). The first output from DistilBERT are embeddings of all input tokens. This represents DistilBERT’s ‘understanding’ of the token’s meaning in the sentence context, and serves as inputs for fine-tuning step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-7gHAtocbcz_wIwjpvaxw.png" /></figure><h4>3. Fine-tuning</h4><p>The embeddings serve as inputs for the 2nd model which I build to adapt DistilBERT to my use case. To extract the support phrases, the model would predict the start and end indices of the tokens (which are spatial, i.e. where the words are located), based on the full text and sentiment label. Hence, I used 1D convolution layer to preserve this spatial information. After flattening and applying softmax, the output are the one hot encodings of the start and end tokens indices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*mYr38M_Cry7qND7B43gZ4g.png" /></figure><h4>4. Inference</h4><p>I use the fine-tuned model to predict the locations of the support phrases based on the full text and sentiment label. Subsequently, I extract the support phrases by locating their corresponding indices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rvOSeIwsEPLSR92wsYCPvw.png" /><figcaption>An illustration of how a prediction is made</figcaption></figure><h3>ii) Comparison of BERT models</h3><p>1. BERT</p><ul><li>By giving a masked token, BERT will use both sides (before and after target token) to predict the masked token in order to learn text representation.</li></ul><p><em>Limitations</em></p><ul><li>[MASK] token exist in training phase while it doest not exist in prediction phase.</li><li>Can’t handle long text sequence. By default, BERT supports up to 512 token. overcome it by ignoring text after 512 tokens or split tokens to 2 or more inputs and predict it separately.</li></ul><p>2. DistilBERT</p><ul><li>uses a technique called distillation, which approximates the Google’s BERT, i.e. the large neural network by a smaller one. The idea is that once a large neural network has been trained, its full output distributions can be approximated using a smaller network.</li></ul><p>3. RoBERTa</p><ul><li>To improve the training procedure, RoBERTa removes the Next Sentence Prediction (NSP) task from BERT’s pre-training and introduces dynamic masking so that the masked token changes during the training epochs.</li></ul><p>4. XLNet</p><ul><li>Overcome uni-directional way of encoding text by using Permutation Language Modeling (PLM) where all tokens are predicted but in random order. This is in contrast to BERT’s masked language model where only the masked (15%) tokens are predicted. This is also in contrast to the traditional language models, where all tokens were predicted in sequential order instead of random order. This helps the model to learn bidirectional relationships and therefore better handles dependencies and relations between words.</li><li>PLM does not change original sequence order but manipulating it in attention part.</li><li>Handle long text sequence by using hidden state (from Transformer-XL)</li></ul><p>I hope this article gave you an intuitive understanding of how you can use BERT for a wide range of NLP application, such as Text classification, Question-Answer system, Text summarization etc. Head over to the Hugging Face’s <a href="https://huggingface.co/transformers/">docs</a> for more detail.</p><blockquote>I am currently on a look out for Data Scientist opportunity, to join a team that allows me to apply my data science knowledge on real life business challenges that can deliver business values. If you found this article useful, hit the applause button below, it would mean a lot to me and it would help others to see the story. If your Data Science team is expanding, feel free to reach out to me via <a href="https://www.linkedin.com/in/valerie-lim-yan-hui/">LinkedIn</a>. I’m happy to share more about my profile :)</blockquote><p>Check out my write-ups for my other Data Science projects <a href="https://medium.com/@valerielimyh">here</a> too.</p><p>Take care and stay safe :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b7b1f008d37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/to-be-rt-or-not-to-be-rt-7b7b1f008d37">To be(rt) or not to be(rt) 🤗</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reaching out to underserved areas in Chicago to increase business growth and profitability for…]]></title>
            <link>https://valerielimyh.medium.com/reaching-out-to-underserved-areas-in-chicago-to-increase-business-growth-and-profitability-for-4a0ca761995d?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a0ca761995d</guid>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[geospatial-analytics]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[big-data-analytics]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Sun, 05 Apr 2020 10:25:18 GMT</pubDate>
            <atom:updated>2020-04-05T10:25:18.225Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reaching out to underserved areas in Chicago to increase business growth and profitability for taxi companies</h3><p>I used Google Cloud’s BigQuery public dataset on Chicago’s taxi trips and Tableau to investigate where the underserved areas are located and whether taxi companies should reach out to these areas with lower demand to unlock greater growth.</p><p>To supplement the taxi trips dataset, I retrieved information on Chicago’s neighbourhood boundaries from <a href="https://data.cityofchicago.org/Facilities-Geographic-Boundaries/Boundaries-Neighborhoods/bbvz-uum9">Chicago Data Portal</a> and used BeautifulSoup to scrape information on the <a href="https://statisticalatlas.com/place/Illinois/Chicago/Population#figure/neighborhood/total-population">population densities</a> in the 30 most densely populated neighbourhoods. As there were some inconsistencies in the neighbourhood names in both datasets (e.g. Archer Hts vs. Archer Heights), I performed some text cleaning using Natural Language Processing before joining the 2 datasets.</p><p>Over the years, the number of pickups varies widely across community areas in Chicago, with the most pickups located near Streeterville. However, there are also several pockets of underserved areas spread out across the city. Let’s find out where these areas are located.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*PxGIhSeBhahZpDMr6eOHFA.png" /></figure><p>The 10 areas with the least pickups evolved over the years. From 2013 to 2016, these areas are concentrated closer to the South. From 2017 to 2019, these previous pockets dispersed to the central regions and closer to the North.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*ExmsbI030W7Cd4OnASV3wQ.png" /></figure><p>That said, there are several community areas such as 52, 54, 55 and 74 that were consistently underserved. This could be because these areas are not among the densely populated neighbourhood, hence taxi companies are channelling their resources to more densely populated areas to reach out to more customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*jAfZW3WoZiOslbbEtRTnNQ.png" /></figure><p>However, from 2019 to 2020, new underserved community areas 18 and 64 emerged. They are near Belmont Cragin and Archer Heights which are among the top 30 densely populated neighbourhood.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*mTSjkKYSX2HbN7Kq1GwN5Q.png" /></figure><p>There are several amenities such as shopping malls, grocery stores in these 2 neighbourhoods, and customers may want or need a convenient ride if they are carrying multiple loots after shopping. Hence, Chicago taxi companies may consider diverting more taxis here to meet the projected demand to boost their revenue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OI8baZstXYGUlcarfU8VRg.png" /><figcaption>Amenities near Archer Heights</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acbBlfNiQiZz7X5mT4xLdw.png" /><figcaption>Amenities near Belmont Cragin</figcaption></figure><p>There are still areas for improvement in this dashboard. Some of my next steps are:</p><ol><li>to spatially join the 2 maps, such that the map of underserved areas in Belmon and Archer Heights overlays on top on their corresponding population densities polygon</li><li>to drill down on the time of day that customers visit these 2 areas, so that taxi companies can make data-informed decisions on the approximate timings in which there are potentially more customers, and reach out to them as quickly as possible to boost their earnings.</li></ol><p>The potential use cases for such analysis are aplenty. For instance, restaurants that offer delivery or team up with delivery aggregators can boost their business growth by uncovering these underserved communities. This strategy could empower restaurant industries to cater to the changing preferences of increasingly time-challenged consumers living in increasingly connected homes, who like the experience of a restaurant meal — only eaten at home.</p><p><em>Thank you very much for reading :) If you enjoyed it, hit applause button and the like button on my </em><a href="https://www.linkedin.com/pulse/reaching-out-underserved-areas-chicago-increase-business-valerie-lim/?published=t"><em>LinkedIn post</em></a><em>, it would mean a lot to me and it would help others to see the story. You can view the interactive dashboard </em><a href="https://public.tableau.com/profile/valerie.lim#!/vizhome/UnderservedareasinChicagodashboard/Story1?publish=yes"><em>here</em></a><em> too. Let me know what you think by</em><a href="https://www.linkedin.com/in/valerie-lim-yan-hui/"><em> reaching out</em></a><em>!</em></p><p><em>Stay safe, take care and have a great day! :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a0ca761995d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Personalised recommendations based on customer segmentation and e-commerce product ratings]]></title>
            <link>https://medium.com/analytics-vidhya/personalised-recommendations-based-on-customer-segmentation-and-e-commerce-product-ratings-6465b8877815?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/6465b8877815</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[collaborative-filtering]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Sun, 08 Mar 2020 02:04:17 GMT</pubDate>
            <atom:updated>2020-05-27T01:38:27.973Z</atom:updated>
            <content:encoded><![CDATA[<h3>Personalised product recommendations based on customer lifetime value and e-commerce product ratings</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sKCcFYnlwmRFWfr9gPSExg.png" /></figure><h3>Background</h3><p>The explosive growth of online content and services has provided a myriad of choices for users. For instance, on e-commerce websites or apps, users are provided an overwhelming volume of products than the amount that users can digest. Imagine you have to search multiple pages on website A to find the item of interest but to no avail. As such, you go to website B and the same item is shown to you upon entering. Do you think the platform A lost just your order? No ─ it likely lost a dozen times more, possibly you as a customer lifetime value plus referrals. And platform B succeeded at acquiring it, possibly because it has a recommendation engine in place. Therefore, personalized recommendations are necessary to improve user experience and ensure retention. The corollary of pleasant and convenient user experience is augmented profits for businesses.</p><p>Before curating a set of products for different users, it is imperative to understand them better. Every customer is unique. Hence, if you treat them the same way with the same content, same channel, same importance, they will find another option which understands them better. Some of your users might make small purchases every week, others might make big purchases once a year — and there are all sorts of combinations in between. How can you possibly have foresight on what they might potentially purchase and recommend them accordingly?</p><h3>Customer Segmentation</h3><p>Customer Lifetime Value (CLV) takes some of the mystery out of knowing how your current and future customers will behave. CLV informs you how often certain types of customers will make purchases and when those same customers will stop making purchases for good. One way to quantify CLV is through the use of Recency-Frequency-Monetary Value (<strong>RFM</strong>) model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*uIg5JUbPiDhJdgFxQ28u1g.png" /></figure><ul><li>Recency: A customer who has made a purchase recently is more likely to make a repeat purchase than a customer who hasn’t made a purchase in a long time.</li><li>Frequency: A customer who makes purchases often is more likely to continue to come back than a customer who rarely makes purchases.</li><li>Monetary Value: A customer who makes larger purchases is more likely to return than a customer who spends less</li></ul><p>I applied k-means clustering to assign a recency score, and used the Elbow Method to determine the optimal number of clusters. This framework is used to derive a frequency score and monetary value score. An overall score is computed based on a sum of those three scores.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*7pQ1LiKTwE9k4UK7jPPJeA.png" /><figcaption>The mean of Recency, Frequency and Monetary Value score for various OverallScore</figcaption></figure><p>The scoring above shows us that customers with score 9 is our best customers whereas 0 is the worst. To keep things simple, three buckets of customers were derived — low, mid and high-value customers.</p><ul><li><strong>Low Value</strong>: Customers who are less active than others, not very frequent buyer and generates very low revenue (i.e. those with scores from 0 to 3).</li><li><strong>Mid Value</strong>: In the middle of everything. Often using our platform (but not as much as our High Values), fairly frequent and generates moderate revenue (i.e. those with scores from 4 and 5).</li><li><strong>High Value</strong>: High Revenue, Frequency and low Inactivity (i.e. those with scores 6 and above).</li></ul><h3>Recommender Systems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*un9tUqhcwGoYQh9S-3FLyw.png" /></figure><p>Collaborative filtering models were then developed for each customer. Collaborative Filtering (CF) is a technique that predicts the interest of a user by collecting taste or preference information from many other users. It assumes that if a user A and B like Product 1, A is more likely to have B’s preference on another product (i.e. user-based CF). Item-based CF and Matrix Factorization are other methods of CF. I used Matrix Factorization because</p><ol><li>it is the state-of-the-art solution for sparse data problem which is applicable in this dataset where most users rated a product category once only.</li><li>it works by decomposing the user-item matrix into a product of user and item representations.</li><li>it allows us to discover the latent (hidden) features underlying the interactions between users and items (in this case, I used product categories as there were no corresponding labels at product ID level). As such, less-known categories can have rich latent representations as much as popular categories have, which improves the recommender’s ability to recommend less-known categories.</li><li>it circumvents the issue of having to know about relevant information pertaining to item content (e.g. item name), which is unavailable in this dataset.</li></ol><p>I chose Alternating Least Square (ALS) implemented in Spark because it is a parallel algorithm designed for large-scale collaborative filtering problems. This method is doing a pretty good job at resolving scalability and sparseness of the user profiles, and it’s simple and scales well to very large datasets. Furthermore, it performed better compared to other matrix factorization methods such as SlopeOne, CoClustering, Non-Negative Matrix Factorization (NMF) and Singular Value Decomposition (SVD), as it had a lower Root Mean Squared Error (RMSE). RMSE of less than one means that the average error term between the predicted and actual rating is less than one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H1hL4NGSJ88OZ8wU2hhq_Q.png" /><figcaption>Test RMSE for various Matrix Factorization methods</figcaption></figure><p>I also used Precision and recall at k to evaluate the ALS models. Precision at k is the proportion of recommended items in the top-k set that are relevant. Precision at 10 were consistently close to 100% for all three customers. This suggests that, if 10 products were recommended to the customer, almost all of them were bought. On the other hand, recall at 10 were consistently close to 88% across all three customers. This means that if a customer bought 10 products, our recommendation showed close to 9 of them.</p><p>Collaborative filtering method is appropriate for existing users, because we have prior knowledge on their CLV. However, we do not know how to quantify the CLV for new users. Hence, a popularity-based model that recommends popular products is created for new users. Popularity rating for a category is a function of its global average rating and the number of ratings received. The top five categories were furniture décor, telephone, health beauty, baby products and watches. As this popularity-based model is based on purchases made by existing customers, I can evaluate the model’s performance by comparing whether new users indeed bought the popular item categories.</p><h3>Building a Flask app</h3><p>As a minimum viable product, I have created a Flask app where existing users can enter their User ID, and different recommender systems are implemented based on their CLV.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*LbBFj5RPEhMpGV3tiOUz3g.png" /><figcaption>Home page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*OCZnzjSILO51bYpqvegdYw.png" /><figcaption>Existing customers can select the product categories they are interested in and their user ID</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*Zorh8yFR4WxjUJZfeYuqCw.png" /><figcaption>Recommended categories based on User 64’s interest in furniture_decor</figcaption></figure><h3>Future Work</h3><ol><li>Precision and recall scores seem too good to be true. Instead of the current random 80–20 train-test split, I could order the observations in chronological order and use a blocking time series split and evaluate the model again.</li><li>Develop rules to transit a new user from using a popularity based model to a Collaborative based system. After making a few purchases, I can infer his or her CLV and determine whether he or she is a high, mid or low value customer, and use the appropriate model to recommend accordingly.</li><li>Explore whether a Collaborative based recommendation system using <a href="https://towardsdatascience.com/deep-autoencoders-for-collaborative-filtering-6cf8d25bbf1d">Autoencoder</a> or reinforcement learning can lead to a better model performance. I could start with a simple Autoencoder with the user-product matrix as the input, and see how close the model can reproduce the matrix. After which, I could try a Deep Autoencoder that embeds more hidden layers that learn mathematically more complex underlying patterns in the data. This <a href="http://www.personal.psu.edu/~gjz5038/paper/www2018_reinforceRec/www2018_reinforceRec.pdf">paper</a> on reinforcement learning proposed a Deep Q-Learning based recommendation framework which can model future reward explicitly.</li><li>To minimise user cold-start problem associated with a popularity-based recommendation system where personalization is not available since it is recommending items that are currently in trend, I could explore how <a href="https://towardsdatascience.com/solving-cold-user-problem-for-recommendation-system-using-multi-armed-bandit-d36e42fe8d44">Multi-Armed bandit algorithms</a> explore/ exploit optimal recommendations for new users.</li></ol><p><em>Thank you very much for reading :) If you enjoyed it, hit the applause button below, it would mean a lot to me and it would help others to see the story. Let me know what you think by reaching out on </em><a href="https://www.linkedin.com/in/valerie-lim-yan-hui/"><em>Linkedin</em></a><em>.</em></p><blockquote>Feel Free to check out:</blockquote><blockquote><a href="https://github.com/valerielimyh/Customer_segmentation_and_personalised_recommendation"><em>Github Repository of this post</em></a></blockquote><blockquote><a href="https://medium.com/@valerielimyh"><em>My Other Medium Posts</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6465b8877815" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/personalised-recommendations-based-on-customer-segmentation-and-e-commerce-product-ratings-6465b8877815">Personalised recommendations based on customer segmentation and e-commerce product ratings</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimising customer engagement efforts using machine learning: Application on retail banking]]></title>
            <link>https://valerielimyh.medium.com/optimising-customer-engagement-efforts-using-machine-learning-application-on-retail-banking-a4e8a30cee1c?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4e8a30cee1c</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 11:22:26 GMT</pubDate>
            <atom:updated>2020-02-25T11:51:26.417Z</atom:updated>
            <content:encoded><![CDATA[<h3>Background</h3><p>Telemarketing is a strategy marketers commonly use to promote products or services to customers because it is more cost effective than conducting roadshows. Banks, too often adopt telemarketing. But, this pool of customers may be too huge and contacting all of them is extremely resource intensive and inefficient. Hence, if banks can find out who among this pool of customers are more likely to subscribe, and target them, banks can stretch their marketing expenses to the fullest, which in turn increase sales revenue and thus profits. In this article, I will walk you through how I used Machine Learning models to predict customers’ subscription behaviour, so marketers can focus their efforts on higher-propensity leads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*bGAXqexWUeA7LgJq09Sq6w.png" /></figure><h3>The Process</h3><p>The dataset is obtained from <a href="https://www.kaggle.com/psvishnu/bank-direct-marketing">Kaggle</a>, which is derived from a Portuguese bank that has over 45,000 individual observations. I tested several machine learning models to see which model gave the best performance in predicting customer’s subscription behaviour.</p><p>After which, I created a Flask app tool and deployed it on Heroku so that marketing teams can key in relevant attributes of the customer and find out their likelihood of subscription and adjust their marketing efforts accordingly.</p><h4><em>Feature Engineering</em></h4><ol><li><em>Second half of the month</em>: From day and month that the customer was last contacted, I found that more subscriptions happened in the second half of the month.</li><li><em>New customers: </em>From the duration of engagement, I can determine whether the customer was existing or new (i.e. 0 seconds of engagement).</li><li><em>Cluster type</em>: Customers’ segmentation can augment companies’ ability to target customers and make better campaign, which in turn improves customer relationships that can be translated into business profitability. As such, prior to building the classification model, I applied k-modes clustering to segment the customer population into different profiles and used their respective labels as additional input for the model.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*tPeS_NhWCGimr5SiuimprA.png" /><figcaption>List of original dataset features and engineered features. Colours indicate the features from which the engineered features were created from.</figcaption></figure><h4>Feature Selection</h4><p>I selected features based on their <a href="https://medium.com/@sundarstyles89/weight-of-evidence-and-information-value-using-python-6f05072e83eb">Information Value (IV)</a>, which ranks features based on how well they predict the target. I used these 9 features to create the model, and obtained similar results as using all features you saw earlier, suggesting those that were dropped were very weak predictors of subscription behaviour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*eDuNj4NPlS6XK95ORsXFsg.png" /><figcaption>Selected features and their Information Value (IV) scores.</figcaption></figure><h4>Model Building</h4><p>The dataset was split into 20% test and 80% cross-validation data sets. I used Stratified 5-fold cross validation so that each fold has similar percentage of samples for each class. Using 5 training-validation folds, the data was fitted on three supervised learning algorithms:</p><ol><li>LightGBM</li><li>Catboost</li><li>Random Forest</li></ol><p>I tried to fit the data using a simpler model such as Logistic Regression, but the model’s performance were not as good as the above gradient boosting and bagging algorithms. This could be due to the categorical nature of my features, which require them to be converted into one-hot encoded values. However, this results in a sparse dataset, resulting in a poorer model performance. On the other hand, gradient boosting models have categorical encoding support built-in which can handle categorical features without having to apply one-hot encoding, thus improving the models’ performance. LightGBM was eventually chosen over Catboost because of its lower log loss and higher F1 score. But recall score is relatively low across 3 models, at about 0.4. This means that, out of 10 customers who subscribed, we only engaged around 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*_9-47JBSyQKX5PV4_IK6TQ.png" /><figcaption>Test score using various metrics</figcaption></figure><p>Can we improve recall score? Yes! After balancing our dataset by oversampling the number of people of subscribed, recall score increased by 40%. In this context, between precision and recall, recall score is the metric of concern, because I want to minimise false negatives (i.e. ppl who would subscribe but we didn’t engage them). Nevertheless, precision score is decent (i.e. out of 10 people we engaged, 4 subscribed).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*l16-vL5KJMmVDUNUpe_Ipg.png" /><figcaption>Test score from LGBM before and after handling class imbalances</figcaption></figure><p>To best understand how the model works, let’s dive into the features. The plot below shows the relative importance of each feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rK1Frwve9fsvXeq9UCEEBg.png" /><figcaption>Feature importances</figcaption></figure><p>Stronger predictors of customers’ subscription were Month, age group of customer, duration of engagement, cluster that customers belong to, and outcome of previous campaign. On the other hand, relatively less important predictors of customers’ subscription were mode of contact, whether customer has a housing loan, number of days since the customer was last contacted and number of engagements performed before this campaign.</p><h3>Conclusion</h3><p>This model can inform telemarketers on the profile of the key leads that they should focus their marketing efforts on. As seen in this lift curve, by focusing their efforts on the top 20%, the proportion of customers who would subscribe to the bank’s term deposit is 4 times more than the average.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*OVI0YxfX_cfeIdu3BKwgdg.png" /></figure><h3><strong>Building a Flask app and deploying it on Heroku</strong></h3><p>As a minimum viable product, I have created a Flask app. You can access it <a href="https://targeted-campaign.herokuapp.com/">here</a> or view it here.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDAYXgnx3xd0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDAYXgnx3xd0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDAYXgnx3xd0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d2960de9183afa85dbb3207e6b1eb4bb/href">https://medium.com/media/d2960de9183afa85dbb3207e6b1eb4bb/href</a></iframe><p>Marketing teams can enter customer’s attributes on this app. Clicking on the ‘submit’ button generates a likelihood of the customer actually subscribing to the term deposit. Assuming the marketing team’s internal threshold is 60%, with the given inputs shown in the video, the model generated a prediction of 80% likelihood of this customer subscribing. Since the likelihood is greater than the threshold, they could perhaps decide to invest more time in sharing with the customer the benefits of this term deposit etc.</p><h3>Future Work</h3><p>Besides demographic and campaign related features, I could</p><ol><li>Include other social and economic context features that could affect customers’s decision to subscribe (e.g. consumer price index, unemployment rate).</li><li>Tune the threshold based on the business’s needs.</li><li>Explore whether an ensemble model would improve model’s performance.</li></ol><p><em>[This project was done as part of an immersive data science program called Metis. You can find the files for this project at my </em><a href="https://github.com/valerielimyh/Targeted-marketing-campaign/"><em>GitHub</em></a><em> and the slides </em><a href="https://www.slideshare.net/ValerieLim30/optimising-customer-engagement-efforts-in-retail-banking"><em>here</em></a><em>.]</em></p><p>Feel free to <a href="https://mailto:valerieeelimyh@gmail.com/">reach out</a> with any questions :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4e8a30cee1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is this house ‘worthy’ to be your home?]]></title>
            <link>https://valerielimyh.medium.com/is-this-house-worthy-to-be-your-home-a19d27e8aeaa?source=rss-614d885a7aca------2</link>
            <guid isPermaLink="false">https://medium.com/p/a19d27e8aeaa</guid>
            <category><![CDATA[regression]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Valerie Lim]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 00:03:32 GMT</pubDate>
            <atom:updated>2020-02-19T00:06:19.777Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Regression Analysis to Predict HDB Resale Prices in Singapore</h3><h3><strong>Background</strong></h3><p>You and your significant other wish to live together, but were unsuccessful in securing a BTO (Build-To-Order) flat, or the BTO launches are not within your desired locations. What would you do? Turn to housing resale market? However, you’re a first-time home buyer. Unless you’re sufficiently well-read and/or has done extensive research about the property market, the various resale property websites such as SRX, PropertyGuru etc, and aplenty customisable features on their websites would probably leave you slightly overwhelming and with a paradox of choice. More importantly, a house would likely be one of your biggest investments. How would you know whether the housing price is valued at its “true value”? And what features are truly important in determining its value?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8KqZheYX7H_Zp714_aW5g.png" /></figure><h4>A kickstarter guide for first-time home buyers</h4><p>Without sufficient prior knowledge, first-time home buyers are probably either clueless at guesstimating the housing price and/or letting their property agents or sellers lead the conversation or negotiation process. A guide that informs buyers of the key features that affect housing price or whether a certain flat is overvalued compared to the “norm” would be useful, which would hopefully help to tilt the previously asymmetrical balance between agents/sellers and buyers to a more symmetrical one. In this article, I will walk you through how I used Lasso Regression to find out what these key features are, and the estimated housing price based on variations of those key features.</p><h3><strong>The Process</strong></h3><p>For this initial concept, I focused on HDB listings that are 3 room and above as couples like you are commonly looking at this range.</p><h4>Data Collection</h4><p>HDB listings were scraped from SRX website using BeautifulSoup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*4kkpLjwM-rOjsAkme5JHJw.png" /><figcaption>A screenshot of a listing on SRX website</figcaption></figure><p>Each listing has various information from main features such as housing type, location etc to peripheral features such as whether the flat is renovated or a corner unit. In total, 1,980 listings were collected.</p><h4>Data Cleaning</h4><p>1. Dropped duplicated listings: Some agents posted the same listings on different pages.</p><p>2. Removed leading and trailing whitespace characters in PSF (Per Square Foot)</p><p>3. Different variations of model type were reduced to its common denominator: E.g.: Model A Simplified is considered as Model A.</p><p>4. Some listings omitted that other listings provided. These missing ones were imputed as 0</p><p>5. Ordinal variables (e.g. property type, model type) were converted to dummy variables.</p><p>6. Prices were log transformed as they were slightly left skewed.</p><h4>Feature Engineering</h4><p>1. For ease of interpretation, age of the flat was derived from number of years since it was built</p><p>2. HDB towns were aggregated into regions to investigate whether different areas (e.g. Central, North, South, East, West) in Singapore have an impact on prices.</p><h4>Feature Selection</h4><p>Feature selection was conducted at various stages of the model building process.</p><p>1. <em>Before building the models</em>: To avoid multicollinearity, between features that were highly correlated with one another, one of them was removed. Features that had zero correlation with the target were dropped too.</p><p>2. <em>After selecting an appropriate linear model</em>: Features were selected using backward stepwise method. Features with the p-values above 0.05 were removed.</p><p>3. <em>After cross-validation established that a linear model was likely to be suitable for the data</em>: Lasso regression was used for feature selection. An alpha value was obtained using LassoCV and applied to the model. Features that had zero-value coefficients were removed.</p><p>Here’s a summary of the variables and why they were removed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdUtH-RdabhgCERzT1GGZw.png" /><figcaption>Table of variables, and their status (removed/included in model)</figcaption></figure><h4>Model building</h4><p>Thefinal dataset was split into 20% test data, and 80% training-validation data (for k-fold cross-validation). 5 k-fold cross-validation was used due to the small number of observations. Backward stepwise method was applied using Lasso regression, to determine whether a simpler model (one that has fewer features) can explain similar amount of variance as a model with more features. The final model had a Mean Absolute Error of 0.1. After reversing the log transformation, this error is equivalent to $52k, which means buyers using this tool can expect roughly that much wiggle room in determining housing prices based on the features mentioned earlier.</p><p>To best understand how the model works, let’s dive into the features. The plot below shows the relative importance of each feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePvNd0bLXyJuvksL2QxMcg.png" /></figure><p>The strongest positive predictors is PSF (per square foot). With a model intercept of 13.1, for 1 unit increase in PSF, price are estimated to increase by $61k . Property type is the next important feature. As compared to 3-room flats, executive flats and 5-room flats are are estimated to be $55k more expensive, while Jumbo flats are $51k more pricey. Lastly, for an additional bedroom, prices are estimated to increase by around $54k.</p><p>Sklearn’s Lasso regression was selected over statsmodel’s Ordinary Least Square model because the former uses coordinate descent for local optimization, without having to find the exact, closed-form equation. Hence, Lasso regression would be more appropriate as I scale up this model to include more observations or to include another target variable.</p><h4>Checking Assumptions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekT5cvm8cZrmrL0fEWQGyA.png" /><figcaption>Left to Right: Scatterplot of y-residuals and y-predicted; Q-Q plot of y-residuals; Scatterplot of actual price (log) and predicted price (log).</figcaption></figure><p>There are a few outliers in which the predicted price is lower than the actual price. Upon inspecting them, they have features that are outside the ‘norm’ e.g. corner unit in Central area etc. Hence, the current model may not be suitable to predict these listings. Collecting more data could improve the model’s predictability. Other than that, there were no discernible patterns from the scatter plots, and y-residuals appear to be normally distributed.</p><h3>Conclusion</h3><p>There are different types of HDB houses you can call home. Besides the intuitive finding that you could consider a 3-room flat with smaller PSF if you have costs constraints, vs. opting for a bigger living space such as a 5-room, jumbo or executive flat if you are planning to start a family soon or have more budget, the current model also suggests that aesthetics factors (e.g. sea view, renovated, corner unit) are not as significant in determining prices as core features (e.g. property or model type), but they could matter based on individuals’ preferences.</p><p>Therefore, instead first-time home buyers like yourself could use these nuggets of insights as a rough indicator of the market price of your desired home and to focus on the aforementioned features if you feel overwhelmed by the wide range of customizable features on property market websites.</p><h3>Future Work</h3><p>Current model has still a lot of room for improvement. To increase the accuracy of prediction, I can collect more data, as this model is based only on 1000 data points. Having more listings would lower the MAE. At the same time, the current source of data is limited to SRX. For a more comprehensive analysis, I could scrape from multiple property market websites such as Propertyguru, 99.co. However, relying on data from property portals may be biased as agents may hike up prices to earn a larger share of the pie. For an even more accurate analysis, I could gather the actual purchasing prices from ERA. I could also create additional features e.g. distance from business districts — Central Business District, Mapletree Business District, Jurong Lake District to determine whether distance between homes and workplaces affect housing prices. Lastly, feature selection using statsmodel Ordinary Least Square model to perform backward stepwise method may be too rash. I could apply clustering algorithm(s) on features before performing feature selection.</p><p><em>[This project was done as part of an immersive data science program called Metis. Linear regression and web scraping were project requirements. You can find the files for this project at my </em><a href="https://github.com/valerielimyh/Predict_housing_prices"><em>GitHub</em></a><em> and the slides </em><a href="https://www.slideshare.net/ValerieLim30/predicting-hdb-resale-price-in-singapore"><em>here</em></a><em>.]</em></p><p>Feel free to <a href="https://mailto:valerieeelimyh@gmail.com/">reach out</a> with any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a19d27e8aeaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>