<?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 Thomas Tshuma on Medium]]></title>
        <description><![CDATA[Stories by Thomas Tshuma on Medium]]></description>
        <link>https://medium.com/@thomastshuma43?source=rss-a705f4c42850------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*KmA_ixpbyK5bYgr-</url>
            <title>Stories by Thomas Tshuma on Medium</title>
            <link>https://medium.com/@thomastshuma43?source=rss-a705f4c42850------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 06:42:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thomastshuma43/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[How much is this problem worth?]]></title>
            <link>https://medium.com/@thomastshuma43/how-much-is-this-problem-worth-4ed108fff65a?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ed108fff65a</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Sun, 16 Mar 2025 08:31:03 GMT</pubDate>
            <atom:updated>2025-03-16T08:31:03.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xUIbJHeq-4iQpSPStXHovw.png" /></figure><p>Firstly im sorry this is so long but welcome again to the second part of the recommendation systems blog series, this time I wanted to discuss the figures with you. I want attach monetary value to the problem being solved by recommendation systems because after all it is the freedom units that keep the world spinning.</p><p>So first I think we can consider where the bulk amount of money comes from for most online platforms. For social platforms like Twitter (im not calling it X hayi….) , Facebook and Linkedin the key money maker is ad revenue, people and organizations pay these platforms billions each year to be able to show their products on different platforms and many eyeballs. That’s why the platforms are free to use, But you are a smart person you know this already what you are wondering is how are recommendation…..(I will call them recsys from here on) recsys are related to this.</p><p>Well the most important metric in social media is engagement. This is because the more of that you have the more time people are spending on your platform and the more ads they are likely to see. For example lets say you are on twitter (again I wont call it X) and you see a post you are in agreement with are you more likely to check the comments or you keep scrolling, then lets say you see a take that you really disagree with you will likely go see the comments for some reason and when you do you spend more time going back and forth with random strangers who may not even be real. This means you see more ads and just stay on the platform longer.</p><p>From this we can see that there is tremendous power in the algorithm that determines what you see because if its good enough to keep you engaged showing you enough of what you like and dislike and strikes the golden balance its very easy to keep people glued to their screens. A good recommendation system is the difference between a user clicking on an ad and buying and not engaging at all. And what do marketers pay for, the chance to get a user to buy a product that they are selling. The higher that likelihood goes the more that they will pay. Hence advertising on Linkedin is most expensive than say twitter, some traffic converts more than others.</p><p>In 2009 Netflix launched a million dollar competition to research teams that could improve their recommendation systems. Similar competitions have also been launched almost every year since then with varying prize amounts by different tech giants from Meta, Google and Amazon. All this has been in a bid to increase the number of scientists working in these problems and improve the current technology. I also have to mention that from my research data scientists in this area earn in the range of USD200k to USD250k+ a year (in the home of the brave obviously….but still).</p><p>Now lets look at the final part of this article why are companies willing to spend so much on these recommendation algorithms? The chart below shows the various ad revenue giants the x axis has the number of years they have been active, the y axis shows the number of users they have in terms of millions and the size of the dot is the amount of revenue. I did not include amazon and netflix because either the revenue isnt mostly from the ads or its hard to find the actually daily users. However its pretty clear that Meta with instagram, whatsapp and facebook are the leader in this space and the gap is pretty massive. However the company with the least amount of revenue in this list still earns almost a billion dollars from ad revenue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*h0x5w9reOymSKQT-I1YqeA.png" /></figure><p>The potential for higher earnings is still massive and the platform that can increase its engagement by showing users not only what they want to see the most, but what will get them to stay on the platform the longest will gain more market share. Despite the fact that others play podcasts, music, movies and goofy videos, they all sell the same thing ATTENTION IS ALL THAT MATTERS and the best recsys keeps it for the longest.</p><p>Ok that’s all, go away now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*wxSz8YHiEOL-gbMCGFufyQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ed108fff65a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why recommender systems?]]></title>
            <link>https://medium.com/@thomastshuma43/why-recommender-systems-858ee6cbb005?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/858ee6cbb005</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 15:03:04 GMT</pubDate>
            <atom:updated>2025-03-15T15:03:04.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*017slrf9g9LMGRkE3ZzbjQ.png" /><figcaption>Methembe Thomas Tshuma gives his thoughts on AI</figcaption></figure><p>I have decided to pursue recommendation systems as my new research direction and will spend the next seven days explaining to a non-technical audience why I chose this field, how it works, and how it impacts everyday life. I will also share my thoughts on the future of recommendation system research and may even touch on the work I am doing for my master’s dissertation.</p><p>So firstly I need to justify my choice of study in this area of machine learning. I believe that of you want to have a successful career you need to solve a problem that matters on these 3 dimensions. 1 a lot of people care about this problem, 2 solving this problem will make or save a lot of money and 3 the problem does not have a final solution (so you can work on it for a lifetime and not get bored). Recommender systems cover all three.</p><p>Why are recommend-er systems important? Well lets start with this interesting fact, the advertising industry surpassed the 1 trillion dollar mark in 2024 with more than half of that being generated by 5 companies. As such I genuinely believe that the recommendation system is most important aspect of any online platform regardless of the purpose of that system. From Music , ecommerce, youtube , pron (you know exactly what I mean) and movies, the quality of the platform is deeply anchored in how well they show you things that you are likely to enjoy engaging with. Since most social platforms heavily depend on advertising, keeping people engaged for as long as possible translates to actual dollars.</p><p>So its safe to say that this is a revenue driving part of internet based platforms that do all sorts of things. The natural question then is how is this actually done. Its better for us to dissect this problem into a few small parts. How do we decide to try something? For example listening to new artists or checking out a new show on HBO. We decide if its similar to something we have liked before or something that someone similar to us (in some shape or form) also liked the thing. In essence all recommendation systems try to do this.</p><p>They are split into two kinds of methods collaborative filtering (CF) and content based filtering…..wait I don’t want to bore with all this stuff. Now I want to give you an idea of why this is a hard problem to solve. So two main ideas we need to keep in mind as inputs for the system are things people similar you like and things that you have like before. In our case lets think about youtube videos, this system would need to look through millions and millions of videos to find the few that you would like, but this is a moving target because people wont like the same things the same way all the time.</p><p>So lets say to find videos of people similar to you we find the most popular videos right now and then we look at your demograph (age , geo-location , gender or genders leave alone hahahaha) and we find what people like that like and recommend that. For videos similar to what you like we look at your subscriptions, liked videos, saved videos find similarities among those and add them to your recommendations.</p><p>This sounds pretty simple BUT remember youtube has millions of users and millions of videos to recommend, trends change and people change ALL the time. Additionally its important for platforms to grow, so youtube needs content producers that will be or has the potential to be popular and need to recommend those videos to people so that the platform can continue to grow. That’s what makes this such hard problem to solve. New inventions are great and they show promising results BUT the engineering is a massive headache.</p><p>Anyways thanks for reading…..go away now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*QUBASWfwgV9bsoRo49kxRg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=858ee6cbb005" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Making of an African Banker — Page 1]]></title>
            <link>https://medium.com/@thomastshuma43/the-making-of-an-african-banker-page-1-9041feb812cc?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/9041feb812cc</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Mon, 11 Nov 2024 04:23:21 GMT</pubDate>
            <atom:updated>2024-11-11T04:23:21.453Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Making of an African Banker — Page 1</h3><p>“Why don’t you just become an investment banker then?”, his navy blue pinstripe suit was nothing short of magnificent, it wasn’t just a sight to behold it also spoke. His voice commanded respect. That right there was aura. Lets call him Mr Mthunzi. I had met him a week after my late night coffee fueled LinkedIn binges and was fortunate he had responded to my “no-spam” direct message I sent to him. This was one of the many coffee chats I had with him that would change the frame of my thinking all together.</p><p>Hie there, welcome to another chapter of my journey. Previously I was blogging about data science and its possible impacts in Zimbabwe and globally. I brought you along on my journey being a data analyst in Zimbabwe, you were part of my football escapades and that was a fun page to read I am sure.</p><p>Then you were also with me as I learned more about machine learning, reading papers and writing about them. Now its time for a new arc. I have decided that I will become an investment banker or at least a financial analyst in the coming 5 years. So I will be writing every week about what I am learning and what I am thinking and just like before, it will be very interesting.</p><p>So let me explain myself. I have been interested in building startups using tech for as long as I can remember and raising funding has always been the hardest part of getting started. As such I would try to read as much information as I could and listen to as many podcasts to know how startups get funding and what are the best ideas that get the most funding.</p><p>But in my quest I would find that they would be speaking a language I did not understand. Hella jargon! EBITDA, Equity, Preferred Stock, P/E Multiples, what’s all this chief? As such I started researching it more and more and I LOVE IT. I enjoyed it so much I created my own website to track relevant tech news and sort it by date and track funding news in different industries.</p><p>So when I wanted funding for my failed startup, well that was before it failed (dreams of brighter days ahhha ahha aaaaaha). I lived in Johannesburg, Maboneng at the time and Mr Mthunzi had eventually agreed to meet me at a coffee shop in Sandton. I was excited to finally share my idea with someone who could in theory show me the money. I told him about my idea, my research, my website everything INCLUDING how much I wanted and why I wanted that.</p><p>He simply scoffed and said “Why don’t you just become an investment banker then?”, it was a sad uber ride back home, but those words stuck in my head. As such the next week was followed by a tonne of research into this banking thing, the more I read the more I liked it. And I proclaimed to myself right in middle of the shoprite line, “I will become an investment banker, also does anyone has a savings card I could borrow?”</p><p>That’s all I have for you today. Go away now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7X4Wt9ruw2ZEtG_4LbZWsQ.jpeg" /><figcaption>A man on serious mission.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9041feb812cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Suits and hoodies: Bridging the gap in the ZIM-AI discussion]]></title>
            <link>https://medium.com/@thomastshuma43/suits-and-hoodies-bridging-the-gap-in-the-zim-ai-discussion-642e80adca65?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/642e80adca65</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 08:27:20 GMT</pubDate>
            <atom:updated>2024-01-31T08:27:20.489Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WCegOMZG3MVlHrnuV16Nw.jpeg" /></figure><p>I promised to write an article responding to the post by the Ubiquitous Professor Author Mutambara which was a presentation to the Zimbabwe National Chamber of Commerce that was posted on the inter-webs (X.com). In this article I do not intend to throw shade to what was said by the professor but to add a summary and a translation to both the suits and the hoodies (developers).</p><p>FYI this is what a developer advocate does. So in the post Mr Mutambara was providing guidelines that would make Zimbabwe more AI ready. He mentioned many things but the ones that I believe are actionable and actually affect the developers the most are. DIGITIZATION OF RECORDS and INTERNET ACCESS. In my humble opinion the presentation must end there because anything else in the discussion like fairness and regulation will without a doubt cloud these two pillars. This is what AI engineers only need to make magic DATA and DATA (internet access). When the results come the upper management will make a plan.</p><p>Where the suits miss it is that its innovation that drives regulation and everything else follows there after. I once mentioned before that it cannot be the other way round because knowing Zimbabwe if we place regulations on AI next thing you want to build an AI start up you will be asked for an AI license and AI tax by the boys (nevakomana). So the call for regulation must stop as we do not have anything to regulate if we are being honest. Also regulations tend to hit the smaller players more heavily than they do the bigger players like Econet and Crew. This is akin to buying a high school uniform for a kid in grade 3, now he has to pass a certain way so that your money is not wasted.</p><p>Where the hoodies miss it is two fold.</p><p>1. We don’t speak the language of the suits.</p><p>2. We don’t know what to ask for.</p><p>Starting with the first one. The problem we have as developers is that we do not know how to reach the suits, I know many developers who are brilliant but do not know how to reach their local MPs to inquire on how they can contribute with IT solutions, let a lot venture capitalists and investors. To play the game we need to know the rules. We need to learn lobbying and we need to organize (better) some how.</p><p>On the second point we have a challenge of not knowing what to ask for. There are many fronts to fight on when it comes to IT in Zimbabwe. So many, but the main pillars of where the problem originates are the same. If we are some how able to organize and lobby. I know there are a few organizations already aiming to do this but how many actual developers know about them and what they do?</p><p>I am not bashing them, my point is that we must organize effectively because the reason we are not getting what we need to drive AI innovation is because we are not asking the right people and not asking correctly. Twitter doesn’t count.</p><p>In the mean time I recommend that the developers on the ground just start. If the data is not there find it. If there’s a problem you see get the data to solve that problem and present it to whoever is in charge. Given that its Zimbabwe its likely they wont appreciate it. However it builds your track record for when you find people who do.</p><p>I recommend that the suits interested in investing in AI in Zim and growing the community like what Kuda Musasiwa better known as “Mdhara Kovo” did , to get in touch with the real developers and understand what it is they actually do and what goes into building these models. Even if they have AI experience working else where, just ask the Zimbos on the ground what’s up. You will find out fast.</p><p>Anyways these are my thoughts and recommendations.</p><p>As always you know what I&#39;m doing. I am just trying to keep you informed. Are you not enter-formed!</p><p>The best is blessed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=642e80adca65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML in Real Life: Using GNNs to improve high way safety in Zimbabwe]]></title>
            <link>https://medium.com/@thomastshuma43/ml-in-real-life-using-gnns-to-improve-high-way-safety-in-zimbabwe-a2e8e7567d29?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2e8e7567d29</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Wed, 24 Jan 2024 09:41:47 GMT</pubDate>
            <atom:updated>2024-01-24T09:41:47.776Z</atom:updated>
            <content:encoded><![CDATA[<p>As a researcher passionate about Graph Neural Networks (GNNs), I’ve been exploring potential applications in the domain of transportation. My focus? Building AI-powered solutions for Zimbabwe’s road safety challenges.</p><p>The Traffic Council of Zimbabwe reports paint a grim picture: between 2019 and 2022, an average of 1,500 lives were lost and 8,000 injured in road accidents annually. This not only overwhelms hospitals but also costs the state millions. Leveraging AI in road safety is undoubtedly crucial.</p><p>Let’s clarify — I’m not a politician; I’m a scientist. This article focuses on harnessing technology and data to solve a pressing issue, not finger-pointing or moral pronouncements.</p><p>Now, consider Zimbabwe’s road network. Its interconnected nature is ideally suited for representation as a graph. Numerous toll gates across the country provide valuable spatiotemporal data on traffic flow and accident locations. These features, coupled with the time-series aspect of the data, would empower GNNs to perform accident forecasting and traffic prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*CC49T2CvV7Ca1pNyJX-xVQ.png" /></figure><p>The system needn’t be exorbitantly expensive. A central AI hub could train the model, generate forecasts, and disseminate them to key locations. Traffic police could then efficiently allocate resources based on predicted traffic patterns and accident hotspots. Dynamic roadblocks, informed by these predictions, would further enhance road safety.</p><p>In essence, this article proposes leveraging GNNs for enhanced road monitoring through prediction and forecasting. The success hinges on two key factors: trust in the system and complete implementation. Half-hearted application risks undermining the technology’s true potential.</p><p>Thank you for reading. I welcome your thoughts in the comments below.</p><p>The best is blessed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2e8e7567d29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A new way of looking at insurance ML using GNNs]]></title>
            <link>https://medium.com/@thomastshuma43/a-new-way-of-looking-at-insurance-ml-using-gnns-666d89271b0a?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/666d89271b0a</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 10:03:44 GMT</pubDate>
            <atom:updated>2024-01-16T10:03:44.986Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*A7zwRSYsVGmji8xORRXgww.jpeg" /></figure><p>Being in machine learning I enjoy thinking about what I could be done that has not yet. Its literally the frontiers of science and I am happy to oblige. So lets look at the topic today. Machine learning in Insurance. This is not a new concept I and many other data scientists have taken a crack at it for a long time now, however I think maybe if we saw the data differently then maybe we could get different results. Using graph data for insurance premiums prediction.</p><p>I have not found any literature yet that talks about an attempt in this regard. Mostly the work that has been done has been in fraud detection. That is beyond the scope of this blog though it is interesting. So I think this could be something novel and exciting in machine learning. Ok so what do I mean by looking at the data as a graph?</p><p>Just to recap we talked last time how we can create a graph by making nodes and creating relationships between those nodes. Well in this model I think each client must have their of separate graph. Where the nodes in that graph are entities and the edges are the relationships between those entities. For example an entity can be a life partner and that partner can have node features that will determine the relationship between the person and the entity based on how both of their features relate to each other , this can apply to different things such as work , vehicle ownership etc.</p><p>But wait there’s more. We can create more modes stemming from those entities that add more and more complexity to the graph. In as much as people’s lives are similar , no two lives can be the same and the addition of more nodes can give true details on the complexity of human lives that otherwise cannot be determined by normal mathematical models.</p><p>The problem I am still trying to think past however is the edge weights. How do you go about that. Given that each node has a different number of features and that those features have different ranges , how does one go about calculating those edge weights in a way that computationally makes sense. My research then tells me that Graph attention networks maybe be the answer.</p><p>This is because graph attention networks have the ability to give the algo information of how important one node is to the current node being looked at. It takes advantage of the soft-max function that allows it to sum each value to 1. So the weight will be between 1 and 0. I think this will change the way that we look at asset management and risk assessment largely because we will be looking at an entity’s relationship to other entities giving us a closer look to the complex relationship that humans have.</p><p>I am still doing more research on the subject and hope to learn more as I go.</p><p>I am your data scientist from Bulawayo. The best is blessed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=666d89271b0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reimagining public transport using GNNs in Africa]]></title>
            <link>https://medium.com/@thomastshuma43/reimagining-public-transport-using-gnns-in-africa-b118c175f8b5?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/b118c175f8b5</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Sun, 07 Jan 2024 11:24:36 GMT</pubDate>
            <atom:updated>2024-01-07T11:24:36.717Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*-9QReqKX2SyGsZWi-hkBWw.jpeg" /></figure><p>I have been learning and working on GNNs for the past month and i have to say i am disappointed that i did not start on them sooner. I always had the wrong conception of what graph neural networks and the way i saw them made me think this was a dead end area and there was no point in me getting involved , boy was i wrong.</p><p>Lets start with the basics. Graphs in the context of machine learning are a different data structure that seeks to understand the data by establishing each data point as a node and the connections between these is known as edges. The Neural Network part of it comes when we want to learn the relationship that each nodes has with the rest of the graph and the edges.</p><p>The reason for wanting to understand these relationships is to enable us to make predictions such as link prediction , node prediction and graph classification. These create many avenues for applications in the real world such as recommendation systems , fraud prediction and chemical stuff I am still to fully understand. What I will be covering here is tempo-spatial applications we could try here in Africa.</p><p>Most people in Bulawayo where I am from relay on public transport to get by. The problem with this is that depending on your location its very hard to know when you are going to get a car at what time. So planning becomes very difficult. However using GNNs we could solve this problem. I acknowledge that this is inspired by the work done by google deep-mind for google maps , but then at the same time given that this is a problem of a different nature makes this research relevant.</p><p>How would we go about this? Firstly we would need to collect a massive amount of data using sensors that we will place on different cars and transport vehicles and this should give us a good picture of what we are working with. Ideally we could collect GPS data for different time steps and speeds. I think even for the same locations having data on different routes used by the drivers will go along way in the destination arrival prediction.</p><p>After this we need to process the data. We need to do two things, create a weight matrix and to create a time series dataset. I will make a blog talking about the basics of what these are. However it is essential to mention that in the times series we must remove seasonality from the data. I have found that the performance of the models after adding this step tends to improve depending on the project and the data being used. So this step is worth while in terms of inclusion.</p><p>After data processing we will train our model and test it. Then deploy with live data. There are few key things that we look to output. Predicting when a public transport vehicle is likely to turn up in your area as well as what time you are likely to arrive at your destination when you do get your transport. This seems like a daunting task but I believe that it can be done. How the sensors are used and work is something I have not gotten into yet but seeing that for real world applications they are essential I will also write on them and how to take advantage of that.</p><p>The main issue with this type of project as with many ML problems , is the scaling up of them. I think transfer learning can be a useful tool to help with this task. However I need to read more on transfer learning and how to apply it. Not all of us have Super GPUs.</p><p>Anyway its been your data scientist from Bulawayo. And as always, the best is Blessed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b118c175f8b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My plans for 2024]]></title>
            <link>https://medium.com/@thomastshuma43/my-plans-for-2024-b519057c53f8?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/b519057c53f8</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Tue, 02 Jan 2024 20:17:42 GMT</pubDate>
            <atom:updated>2024-01-02T20:17:42.910Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello there , it has been a while , your boy has been busy. So much to update you on and such much to write about. I took a break from writing for the month of December because I has been going hard consistently for a while and the quality of my work was starting to suffer. However I did not stop studying and working. Now I am back at it, here are what my plans are for the coming year and what my work will entail for 2024.</p><p><strong>Writing</strong> will remain at the top of my list of things I will be doing more. I want to focus on the different sectors of machine learning but this will depend on what my post graduate work will entail and I will be writing about that.</p><p><strong>Post-grad</strong>, I made it clear in previous posts that I am going to be pursuing my post grad in the future. I applied to many universities in my countries and I am now waiting to hear back. One of the professors to the universities I applied to suggested that if I do get to work with them my work will be focused on GNNs , graph neural networks. I am looking forward to this and I have started studying the topic. Its quite amazing and the article is coming soon on what I will be learning at the time as well as the papers I will be reading in preparation for the new venture. I plan to be in a Post grad program by September.</p><p>Research , my main interest is in machine learning and how we can use it to improve the lives of human beings with a focus on Africa. As such I plan to work on and produce world class research articles on this topic. I aim to dissect the problems around ML/AI in Africa as well as suggest solutions for the said problems. Since there will be a lot of research involved in it I am not sure how many of these I will be able to produce per week.</p><p><strong>Coding</strong> , I am more of an applied machine learning researcher (not sure if it’s a thing) and in the past year in as much I worked on a lot of projects my coding was not as good as it could have been as such I would love to write code more and learn more frameworks. I have been learning Pytorch this past December , it was quite a learning curve but I am glad that I did it.</p><p><strong>Certification</strong>, I also plan on getting certified as a data scientist with different platforms. I have experience with AWS , AZURE and ORACLE however I am still not certified as such I plan to get certified this year at at least 2 of these platforms.</p><p>The best is blessed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b519057c53f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-Agent Reinforcement Learning: A Frontier in AI]]></title>
            <link>https://medium.com/@thomastshuma43/multi-agent-reinforcement-learning-a-frontier-in-ai-ab31324a9277?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab31324a9277</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 06:27:12 GMT</pubDate>
            <atom:updated>2023-11-27T06:27:12.874Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*nLN_AjN7SqZMKPMbiTfWQA.png" /></figure><p>The more I delve into the realm of Reinforcement Learning (RL), the more I realize the vastness of the field and the depths of my own knowledge. This realization has ignited an insatiable thirst to learn more, leading me to the doorstep of another fascinating facet of machine learning: Multi-Agent Reinforcement Learning (MARL). In the domain of AI, MARL stands at the cutting edge, a wild and untamed frontier brimming with possibilities.</p><p>In my previous blog posts on RL, I explored how agents can navigate and interact within environments, whether custom-designed or real-world. Through trial and error, these agents strive to discover the optimal actions that maximize their reward. This approach has proven remarkably effective in various real-world applications, most notably in video games and robotics.</p><p>Now, let’s expand our horizons. Imagine training two agents simultaneously to collaborate on a specific task within a shared environment. Now, envision training five, ten, or even twenty agents to work together, enabling them to perform tasks such as rescuing people during natural disasters, managing traffic flow, constructing buildings, or troubleshooting computer systems. The possibilities with MARL are virtually limitless, spanning a vast array of industries.</p><p>MARL encompasses three primary use cases: Competitive AI, Cooperative AI, and a combination of both. The choice of approach largely depends on the specific application. Competitive AI involves agents vying for a single victory, with only one agent emerging as the winner and the others facing defeat. Cooperative AI, on the other hand, involves agents united in pursuit of a common goal. In my opinion, this domain holds the most promise for groundbreaking advancements in machine learning due to its immense potential. The hybrid approach, often seen in multiplayer games, combines elements of both competitive and cooperative AI.</p><p>Despite its immense potential, MARL faces several challenges. One significant hurdle is the non-stationary nature of the environment. Even with a single agent, the environment can undergo constant changes. However, when multiple agents are introduced, these changes become even more dynamic and unpredictable, making it increasingly difficult to compute optimal policies and predict actions that yield the highest rewards.</p><p>Another challenge lies in partial observability. Agents often have limited visibility of the environment, hindering their ability to perceive the complete state of the world and the actions of other agents. This incomplete information can significantly impede decision-making processes.</p><p>Finally, the computational cost of running MARL models poses a formidable challenge. In the context of robotics, sensors constantly gather data from the environment, including information about the robot’s position, battery level, and other crucial parameters. For vehicles, this data collection becomes even more complex, considering the vast array of sensors and the sheer volume of information that needs to be processed. The computational demands of these models are substantial and require careful consideration.</p><p>Despite these challenges, researchers and developers are actively addressing these issues, seeking innovative solutions to overcome these limitations.</p><p>In subsequent blog posts on MARL, I will delve into the algorithms being developed to tackle the challenges I’ve outlined. The field of MARL is brimming with exciting research, and I am eager to explore the latest advancements and discuss the potential impact of this technology on the future of AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab31324a9277" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ML in Real Life: Using Reinforcement Learning to Automate Tobacco Curing]]></title>
            <link>https://medium.com/@thomastshuma43/ml-in-real-life-using-reinforcement-learning-to-automate-tobacco-curing-9a1f3f374688?source=rss-a705f4c42850------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a1f3f374688</guid>
            <dc:creator><![CDATA[Thomas Tshuma]]></dc:creator>
            <pubDate>Tue, 21 Nov 2023 11:42:26 GMT</pubDate>
            <atom:updated>2023-11-21T11:42:26.739Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*TJZ9-pFczU1NpoWD3KUYNQ.jpeg" /></figure><p>Growing up, I lived next to a man who made his living cultivating tobacco. A legendary farmer, he imparted stories of the labor-intensive process of curing tobacco leaves. This process involved reducing leaf moisture to a specific level, traditionally achieved by burning logs to generate heat. Sometimes, metal dishes filled with water were placed in the barns to maintain humidity. The process was demanding and fraught with potential losses, given the capital-intensive nature of tobacco farming.</p><p>This experience got me thinking. Surely, in other parts of the world, advanced systems exist that allow supervisors to regulate temperature and humidity with the touch of a button. But what if we could take it a step further? What if we could develop an agent that autonomously adjusts temperature based on leaf status, reducing the workload for supervisors and minimizing human error?</p><p>I embarked on a project to create a custom environment and an agent capable of achieving this goal. In this blog, we’ll delve into the code and examine the project’s outcomes.</p><p>The code is divided into two main components: the agent and the environment. The agent handles the training, learning, and execution aspects, while the environment serves as the interactive space for the agent’s actions. I separated the code for the environment into a distinct class and imported it into the agent file.</p><p>Let’s examine the packages used in this project:</p><ul><li>Stable_baselines: Provides the algorithms for training the model.</li><li>Time: Supplies the time class for model training.</li><li>Gym (OpenAI gym): Offers functions for creating the environment.</li><li>NumPy: Facilitates efficient array creation.</li></ul><p>The agent file follows these steps:</p><ol><li>Import the necessary libraries and the environment class.</li></ol><pre>import gym<br>import time<br>from stable_baselines3 import TD3<br><br><br># Import the custom environment<br>from TobaccoEnv import TobaccoCuringEnv<br><br># Create the environment<br>env = TobaccoCuringEnv()</pre><p>2. Define and train the agent.</p><pre># Initialize the agent<br>agent = TD3(<br>    policy=&quot;MlpPolicy&quot;,<br>    env=env,<br>    verbose=1,<br>)<br><br># Train the agent for 100,000 steps<br>agent.learn(total_timesteps=500)</pre><p>3. Save, load, and test the model.</p><pre># Save the trained agent<br>agent.save(&quot;tobacco_curing_agent&quot;)<br><br># Load the trained agent<br>agent = TD3.load(&quot;tobacco_curing_agent&quot;)<br><br># Control the curing process<br><br>obs = env.reset()<br>episode_count = 0<br>while episode_count &lt; 5:  # Run for 5 episodes<br>    action, _ = agent.predict(obs)<br>    obs, reward, done, _ = env.step(action)<br>    print(&quot;Step:&quot;, time.time(), obs, reward)<br>    if done:<br>        episode_count += 1<br>        obs = env.reset()  # Reset the environment for the next episode<br><br># Close the environment<br>env.close()</pre><p>Since the model predicts the action taken by the agent, importing the model is crucial.</p><p>To understand the steps in the environment file, we must first grasp its objective. We aim to regulate temperature and humidity to gradually reduce leaf moisture. Upon achieving this, we want to terminate the episode. Each incorrect temperature adjustment results in a negative reward, while a correct adjustment yields a positive reward.</p><p>Now, let’s review the steps:</p><ol><li>Initialize the observation space variables (environment details — leaf moisture, humidity, temperature) and initial action space (action parameters) in the init function.</li></ol><pre>def __init__(self):<br>        # Define the state space<br>        self.observation_space = gym.spaces.Box(low=np.array([0, 0, 0]), high=np.array([100, 100, 100]))  # Temperature, humidity, leaf moisture content<br><br>        # Define the action space<br>        self.action_space = gym.spaces.Box(low=np.array([-1, -1, -1]), high=np.array([1, 1, 1]))  # Temperature adjustment, humidity adjustment, ventilation adjustment<br><br>        # Reset the environment<br>        self.reset()</pre><p>2. Take a step: This involves receiving an array of numbers indicating the amount to adjust each environmental aspect. These adjustments are applied to the state, the action’s reward is calculated, and the environment is reset upon completion.</p><pre>def step(self, action):<br>        # Apply the action to the environment<br>        moisture_loss_rate = 0.1<br>        temperature = self.temperature + action[0]<br>        humidity = self.humidity + action[1]<br>        ventilation = self.ventilation + action[2]<br><br>        # Update the leaf moisture content<br>        # leaf_moisture_content = self.leaf_moisture_content - 0.1  # Simulate moisture loss over time<br>        self.leaf_moisture_content -= moisture_loss_rate * (1 - temperature / 100) * (1 - humidity / 100)<br><br>        # Calculate the reward<br>        reward = calculate_reward(temperature, humidity, self.leaf_moisture_content)<br><br>        # Check if the episode is done<br>        # done = False  # Implement a termination condition based on the curing process<br>        done = self.leaf_moisture_content &lt;= 20<br><br>        # Update the state<br>        self.temperature = temperature<br>        self.humidity = humidity<br>        self.ventilation = ventilation<br>        self.leaf_moisture_content = self.leaf_moisture_content<br><br><br>        # Return the new state, reward, and done flag<br>        return [temperature, humidity, self.leaf_moisture_content], reward, done, {}</pre><p>The reward function is of paramount importance as it communicates our priorities to the agent. In this case, we penalize the model more heavily for incorrect leaf moisture than for the other parameters.</p><pre>def calculate_reward(temperature, humidity, leaf_moisture_content):<br>        reward = 0<br>        # Calculate the error between the current temperature and the desired temperature<br>        temperature_error = (temperature - 50)<br><br>        # Calculate the error between the current humidity and the desired humidity<br>        humidity_error = (humidity - 70)<br><br>        # Calculate the error between the current leaf moisture content and the desired leaf moisture content<br>        leaf_moisture_content_error = (leaf_moisture_content - 20)**2<br><br>        # Calculate the total reward<br>        reward = (temperature_error + humidity_error + leaf_moisture_content_error)<br><br>        # Bonus reward for achieving the desired color<br>        if temperature &gt;= 65 and temperature &lt;= 85 and humidity &gt;= 65 and humidity &lt;= 75:<br>            reward += 100<br><br>        # Bonus reward for achieving the desired flavor<br>        if leaf_moisture_content &gt;= 15 and leaf_moisture_content &lt;= 25:<br>            reward += 50<br><br>        return reward</pre><p>The reset function simply restores the environment to its initial state, ensuring that each new episode begins from scratch.</p><pre>def reset(self):<br>        # Reset the environment to its initial state<br>        self.temperature = 25<br>        self.humidity = 60<br>        self.ventilation = 50<br>        self.leaf_moisture_content = 80<br><br>        return [self.temperature, self.humidity, self.leaf_moisture_content]</pre><p>I’m currently facing challenges running this model consistently on my laptop. Cloud-based execution is not a viable option due to frequent resource limitations. Therefore, in the next blog post, we’ll explore the results, conduct further evaluations, and identify potential improvements. The final installment, scheduled for early next month, will delve into real-world implementation strategies.</p><p>For now, please excuse me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*e9kxam1csWZ4JphLr2_5-Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a1f3f374688" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>