<?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 Belkacem Berchiche on Medium]]></title>
        <description><![CDATA[Stories by Belkacem Berchiche on Medium]]></description>
        <link>https://medium.com/@b_berchiche?source=rss-3771bcafe5a7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*40Hb1QS6d5cViuF37BFQ4w.png</url>
            <title>Stories by Belkacem Berchiche on Medium</title>
            <link>https://medium.com/@b_berchiche?source=rss-3771bcafe5a7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:15:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@b_berchiche/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[Money doesn’t win football matches. It buys 83% of them]]></title>
            <link>https://medium.com/@b_berchiche/money-doesnt-buy-football-matches-it-buys-83-of-them-3ccb84563bf9?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ccb84563bf9</guid>
            <category><![CDATA[sports-business]]></category>
            <category><![CDATA[sports-analytics]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 09:25:57 GMT</pubDate>
            <atom:updated>2026-08-05T09:27:46.979Z</atom:updated>
            <content:encoded><![CDATA[<p>Football is a market. Clubs buy talent. Wages are the price tag.</p><p>This raises a simple question: If you know a club’s payroll, do you know how good the team is?</p><p>The short answer: <strong>yes</strong>. You know almost everything.</p><p>We took the 2025–26 wage bills for 113 clubs across Europe’s top seven leagues. Then, we compared those numbers against each team’s actual strength, <a href="https://bayesfc.com/methodology.html">using data pulled from the betting markets.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNmE4q3f2445v4r78pZtZw.png" /><figcaption>Data and visualization via <a href="http://bayesfc.com/">BayesFC</a></figcaption></figure><p>The math is brutal. Each dot on that graph is a club. The horizontal axis is the payroll. The vertical axis is the team’s market-implied strength. As you can see, the cloud slopes cleanly up and to the right.</p><p><strong>Wages explain 83% of the difference in strength between teams across Europe</strong>. Every time a club doubles its payroll, the team takes a measurable step up.</p><p>There is no magic tactic. There is no free lunch. You largely get exactly what you pay for.</p><p>Sports economists have known this for decades. The academic literature consistently shows that wages dictate outcomes. Research by <strong>Stefan Szymanski </strong>— popularized in the book <strong><em>Soccernomics</em></strong> — proved that a club’s wage bill predicts its long-term league position with massive accuracy. Transfer spending is mostly statistical noise. Wages are the true signal.</p><h3>The Rule Breakers</h3><p>But wages only explain 83% of the board. The rest comes down to execution</p><p>Some clubs are brilliant bargains. Teams like Como and Sporting punch way above their weight. So do Brighton and Brentford. That is no surprise. Both English clubs are run by notoriously smart owners who use data to outsmart the market.</p><p>Other clubs just burn cash. Mid-table sides like Torino and Lazio pay huge wages for ordinary results. Money gets you in the game, but it guarantees nothing.</p><h3>The Real Madrid Exception</h3><p>Even the biggest checkbook has limits.</p><p>Real Madrid has the highest payroll on our list. Yet, Arsenal and Manchester City are actually stronger in our <a href="https://bayesfc.com/index.html">global ladder</a>. A massive wage bill guarantees a high floor. It does not automatically buy the highest ceiling.</p><p><em>(Note: These figures exclude hidden bonuses and transfer fees, and football changes every weekend.)</em></p><p>But the core truth holds up. Raw cash buys your baseline. Smart cash decides who wins.</p><p><em>Want to see where your club lands on the curve? Explore the</em><a href="http://bayesfc.com/"><em> full 2025–26 strength ratings at BayesFC</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ccb84563bf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the Top 1k Played FPL This Year]]></title>
            <link>https://medium.com/@b_berchiche/how-the-top-1k-played-fpl-this-year-077635579f51?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/077635579f51</guid>
            <category><![CDATA[football]]></category>
            <category><![CDATA[fpl]]></category>
            <category><![CDATA[fantasy-football]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Thu, 07 May 2026 07:19:33 GMT</pubDate>
            <atom:updated>2026-05-07T07:19:33.920Z</atom:updated>
            <content:encoded><![CDATA[<p>Every Fantasy Premier League season ends with the same sigh: “if only I’d captained X” or “I should’ve wildcarded sooner.” Around GW34 I scraped a stratified sample of 10,000 managers — 1,000 from the top 1k, 2,000 each from the top 10k and 100k, and 2,500 each from the top 1m and top 5m — and pulled their per-gameweek squads, transfers, and chip activations.</p><p>I wasn’t looking for “good FPL advice.” I wanted to know what the elite managers actually <em>did differently</em> this year, and whether the gap between top 1k and the masses came down to one or two big habits or a thousand small ones.</p><p>It’s mostly five things.</p><h3>The dataset, briefly</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*dwpfGma7oB8dBMVdm7m6bQ.png" /></figure><p>For context: top 1k mean total points was 2,260; top 1m mean was around 2,050; top 5m mean was 1,878. The headline charts in this piece compare top 1k vs top 1m — the top 5m sample is wider but noisier, and the top 1m is closer to “what a serious-but-not-elite manager actually does.” The full-tier gradient still shows up in the box and ridge plots.</p><h3><strong>Finding 1: They built team value early, and never gave up the lead.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qoyie8GzB2KCQLz5Uaky7w.png" /></figure><p>Every manager starts at £100.0m. By GW7 the top 1k were already half a million ahead of the top 5m. By GW20 the gap was a full £2m. The lines never cross — once the top 1k pulled ahead, they stayed ahead.</p><p>Two reasons this matters more than it looks:</p><p>1. <strong>Compounding.</strong> A top 1k manager with £104.0m at GW20 has £2m more buying power than a top 5m on £102.0m. That £2m buys a captain-tier upgrade.</p><p>2. <strong>Less price-rise pressure.</strong> Once you’re on the right side of the price-rise gradient, your opponents pay you to overtake you. Top 5m never benefit from this.</p><p>What the chart doesn’t show: how. Most of the value gap came from making the <em>right</em> transfers in the first 10 GWs — locking in early-season risers (cheap defenders from teams that started well) and avoiding the Tottenham / Newcastle disappointments. Those decisions paid for the rest of the season.</p><h3><strong>Finding 2: They timed their chips. The masses ran out of runway.</strong></h3><p>This was the season FPL gave every manager <strong>two of each chip</strong>: two Wildcards, two Free Hits, two Bench Boosts, two Triple Captains. Eight chips total, each worth potentially 20+ points if used on the right week.</p><p>The top 1k didn’t just play more chips — they played them on a different schedule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*yy13G00qHnvequll7--BpQ.png" /><figcaption>Median GW per chip play (top 1k vs top 1m)</figcaption></figure><p>On the <strong>1st copy</strong>, top 1k pulled the trigger ~6 weeks earlier on the Triple Captain and Bench Boost — captaining Haaland into the cushy Burnley home fixture in GW6 instead of waiting for the perfect week.</p><p>The takeaway: chip discipline wasn&#39;t about playing the right week. It was about not overthinking it</p><h3><strong>Finding 3: They took </strong><em>far fewer</em><strong> hits — but the ones they took mostly worked.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1Iu2K-_PLUYg_0KlPGpxA.png" /></figure><p>This was the most counterintuitive finding for me. I’d assumed elite managers took more hits — they’re more active, they’re optimising every week. The data says the opposite.</p><p>Mean hits per manager across the season:</p><ul><li>top 1k: <strong>1.1 hits</strong> (one −4 the entire year)</li><li>top 10k: 1.7</li><li>top 100k: 2.9</li><li>top 1m: 3.3</li><li>top 5m: <strong>7.7 hits</strong> — almost two −4s a month</li></ul><p>The top 5m distribution has a long tail of managers who took 15–20 hits. The top 1k distribution is concentrated near zero with almost no tail. Some top 5m managers paid 60+ points in hits over the season — the equivalent of a really good captain blank, every month, by choice.</p><p>When the top 1k <em>did</em> take a hit, it usually <strong>beat the tier baseline by 1–2 points after paying the cost.</strong> The −8s averaged +2.4 above baseline. So the “hits work” framing isn’t wrong — it’s just incomplete. The top 1k version is “hits work <em>if you pick your spots</em>.”</p><p>The conventional wisdom “don’t take hits” oversimplifies. The honest version: every hit is a -4 negotiation between cost and expected value, and most managers can’t accurately judge expected value, so they’re better off taking fewer of them.</p><h3>Finding 4: They saw the easy fixtures coming</h3><p>By GW35, the biggest top1k–top1m ownership gaps were mid-priced, in-form starters from teams with the easiest run-in fixtures — Brighton, Bournemouth, Leeds — plus the Palmer punt on top.</p><ul><li><strong>O’Reilly (MCI)</strong>: 91% top1k, 58% top1m</li><li><strong>Van Hecke (BHA)</strong>: 78% top1k, 36% top1m</li><li><strong>Verbruggen (BHA)</strong>: 76% top1k, 29% top1m</li><li><strong>Tavernier (BOU)</strong>: 74% top1k, 25% top1m</li><li><strong>Calvert-Lewin (LEE)</strong>: 76% top1k, 38% top1m</li><li><strong>Palmer (CHE)</strong>: 76% top1k, 22% top1m</li><li><strong>Struijk (LEE)</strong>: 58% top1k, 19% top1m</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pi3Y3uQOaMrCEIt_vlb1FA.png" /></figure><p>These aren’t differentials in the usual sense — they’re 70%+ owned at the top. They’re differentials <em>against the rest of the field</em>. They’re also mostly starters, hitting form, with the schedule on their side. The top 1m squad at GW35 was still half-anchored to the GW1 template (Salah, Haaland, Saka, Watkins, Raya). The top 1k had quietly pivoted weeks earlier, swapping out faded premiums for these mid-price run-in plays.</p><h3><strong>Finding 5: They converged on a consensus, not on individuality.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nmUMz4F2lIDmn_OPbOqstg.png" /></figure><p>This was the result I really didn’t expect. I’d assumed elite managers would be more individualistic — finding their own picks, building unique squads. The data says the reverse.</p><p>For each tier I sampled 200 managers at GW20, took every possible pair, and counted how many of their 11 starters they had in common. The median pair:</p><ul><li><strong>top 1k &amp; top 10k:</strong> 5 of 11 starters in common (45%)</li><li><strong>top 100k &amp; top 1m:</strong> 4 of 11 (36%)</li><li><strong>top 5m:</strong> 3 of 11 (27%)</li></ul><p>A typical pair of top 1k managers had nearly half their starting XI identical. A typical pair of top 5m managers shared less than a third.</p><p>The most likely explanation: there’s only a small set of correct moves at any given GW, and the top 1k all converge on them. They’re reading the same xGI dashboards, the same Discord chats, the same FPL Twitter discourse. The lower tiers run on vibes and pet picks, which produces high diversity but bad outcomes.</p><h3><strong>Putting it together</strong></h3><p>If you compress the five findings into a single sentence: <strong>the top 1k built value early, used every chip on purpose, took hits sparingly but well, anticipated the run-in, and didn’t try to be clever.</strong></p><p>None of those are individually surprising. What’s surprising is how cleanly the data separates them from the masses on every dimension simultaneously. The top 1k aren’t slightly better at one thing — they’re meaningfully better at all of them, and the gaps compound.</p><p>Hi, thanks for reading. My name is Belkacem, and I built <a href="https://chromewebstore.google.com/detail/ogkdbhbknekjafddbdimnppihjbhpabn?utm_source=item-share-cb"><strong>FPL Nemesis</strong></a> — a Chrome extension that helps you find the right differentials to climb your mini-league. It plugs into your live FPL squad, looks at who your rivals own, and surfaces transfers that swing the head-to-head in your favor instead of just chasing template points.</p><p>If any of the findings above resonated — particularly Finding 4, where the top 1k pivoted to mid-price run-in plays before the masses caught on — that’s exactly the kind of decision the extension is built to nudge you toward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=077635579f51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I was wrong about prediction markets]]></title>
            <link>https://medium.com/@b_berchiche/i-was-wrong-about-prediction-markets-eee6d4bdcef9?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/eee6d4bdcef9</guid>
            <category><![CDATA[sports-betting]]></category>
            <category><![CDATA[prediction-markets]]></category>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[information]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 13:45:55 GMT</pubDate>
            <atom:updated>2026-02-07T13:45:55.486Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUDBCJkF2Nkxj2FVckmP5Q.png" /><figcaption>The 10-minute lag: My data shows that Polymarket (P) doesn’t lead the market — it follows Tipico (T) with a significant delay.</figcaption></figure><p><em>Six months ago, I wrote a post claiming crypto prediction markets were faster than traditional sportsbooks. I gathered more data, ran the numbers, and found the exact opposite</em></p><p>Half a year ago, I <a href="https://medium.com/@b_berchiche/i-compared-prediction-markets-and-sportsbook-odds-for-a-week-heres-what-i-found-505473413e72">shared a little experiment</a> tracking Jannik Sinner’s odds for the French Open. In that snapshot, Polymarket seemed to move first, reacting to news while Tipico (the traditional German sportsbook) stayed flat.</p><p>My conclusion was intuitive and optimistic: <em>Of course!</em> The decentralized, open-to-the-world market moves faster! It acts like a stock market! It’s the “cleaner signal”!</p><p>Well, I decided to stop cherry-picking charts and actually do the math. I scraped thousands of price updates, segmented them into continuous “sessions,” and ran a formal lead-lag analysis.</p><p>The result? <strong>I was completely wrong</strong>.</p><h3>The Setup (Round 2)</h3><p>Instead of eyeing a single chart, I used a statistical technique called <strong>Cross-Correlation</strong></p><p>Basically, I asked the computer:</p><blockquote>”If I take Tipico’s price today, how well does it predict Polymarket’s price in the future?”</blockquote><p>and vice-versa.</p><ul><li>If Polymarket is the “smart money,” it should move first.<br>- If Tipico is the “smart money,” it should move first.</li></ul><h3>The “Wait, What?” Moment</h3><p>I expected to see Polymarket leading by a few minutes. Instead, the data spit this out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*3HQWheB6F2RDmjFYorzjNw.png" /></figure><p>See that big red bar at <strong>Lag -2</strong>?</p><p>That is the statistical “smoking gun.” It means a price change on Tipico is highly correlated with a price change on Polymarket <strong>~10 minutes later</strong>.</p><p>The correlation is strong (~0.52), and it’s heavily directional. In the vast majority of cases, the “old school” sportsbook moves, and then, slowly but surely, the “futuristic” prediction market drags itself up to match it.</p><h3>Why is the Dinosaur Beating the Spaceship?</h3><p>This broke my mental model. Why would a centralized, margin-heavy sportsbook be faster than a friction-free global market?</p><p>After staring at the data, I have a few theories:</p><p>1. <strong>The “Copy-Paste” Economy</strong>: Polymarket traders might not be handicapping matches themselves. They might just be watching bookies, seeing a price move, and then buying the “stale” price on Polymarket to capture the arbitrage. They aren’t <em>making</em> the price; they are <em>importing</em> it.</p><p>2. <strong>Volume Matters:</strong> Tipico and traditional books still handle vastly more volume than niche prediction markets. “Sharp” money, the professional syndicates that actually move lines, needs liquidity. If they can’t bet $50k on Polymarket without slipping the price 10%, they won’t bother. They bet on the main books, the main books move, and Polymarket follows.</p><p>3. <strong>The “News” vs. “Math” Distinction</strong>: My previous article wasn’t necessarily a lie. Polymarket <em>might</em> still lead on <strong>breaking news</strong> (like a player injury announced on Twitter). But for the slow, grinding work of “price discovery” (adjusting probabilities based on play-by-play data), the algorithmic models of traditional bookies seem to be superior.</p><h3>The Takeaway</h3><p>I started this project thinking I’d prove that decentralized markets are the future of truth. Instead, I proved that <strong>efficient markets are really hard to beat</strong>, even for a crypto hivemind.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eee6d4bdcef9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Compared Prediction Markets and Sportsbook Odds for a Week. Here’s What I Found]]></title>
            <link>https://medium.com/@b_berchiche/i-compared-prediction-markets-and-sportsbook-odds-for-a-week-heres-what-i-found-505473413e72?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/505473413e72</guid>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[prediction-markets]]></category>
            <category><![CDATA[polymarket]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 11:39:54 GMT</pubDate>
            <atom:updated>2025-06-11T11:42:21.863Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*wi5y6OXtN20dV9vD.jpg" /></figure><p>I’ve been playing around with a small side project to track odds between prediction markets (like Polymarket) and traditional sportsbooks (like Tipico here in Germany). I wanted to see if Polymarket, being open and global, actually reflects information faster.</p><p><strong>Spoiler</strong>: it kinda does.</p><h3>The Setup</h3><p>I picked a live market:</p><p><strong>“Will Jannik Sinner win the 2025 French Open?”</strong></p><p>Then I tracked the quotes over time from both Polymarket and Tipico. Here’s what I saw:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*DgoB0J8kBgZQiMuQlUKWqw.png" /></figure><p>The blue line is Polymarket, the darker one is Tipico.</p><p>You can see Polymarket start moving upward earlier, while Tipico just… stays flat for a while. Eventually, it catches up.</p><p>We don’t know exactly <em>why</em> Sinner’s odds moved. Maybe his rival got injured, maybe a betting influencer made a call, or maybe just a wave of sharp money came in. Whatever the reason, <strong>Polymarket reacted first</strong>, and that’s the interesting part.</p><h3>What&#39;s going on?</h3><p>This wasn’t a value bet or arbitrage situation: the prices were pretty close. But the timing difference is what caught my eye.</p><p>The prediction market moved first.</p><p>Why?</p><p>Probably because:</p><ul><li>It’s <strong>open to anyone</strong> in the world, no geo restrictions</li><li>People are <strong>trading directly</strong>, not just betting against a house</li><li>It has <strong>low fees</strong>, so people can react without friction</li><li>There’s no centralized control: prices shift with every trade</li></ul><p>Basically, it reacts more like a stock market. If new info hits Twitter, Polymarket feels it immediately.</p><p>Tipico? Not so much. Odds are managed, margins are baked in, and updates happen on a delay.</p><h3>Why I think this is cool</h3><p>It’s not about beating the bookies (though that’s an interesting angle too). It’s more about how prediction markets might give us a <strong>cleaner signal: </strong>a closer approximation of what the crowd <em>really</em> thinks is going to happen.</p><p>If you’re into market microstructure or just like tracking how info flows, this is a fun rabbit hole.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=505473413e72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPT-4 vs. The Monkey: Who’s Better at Picking Stocks?]]></title>
            <link>https://medium.com/@b_berchiche/gpt-4-vs-the-monkey-whos-better-at-picking-stocks-58ca927277a2?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/58ca927277a2</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[stock-market]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Sun, 06 Oct 2024 10:14:54 GMT</pubDate>
            <atom:updated>2024-10-06T10:14:54.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzYrbLMUZzj8ItABZ7bxyA.png" /></figure><p>What happens when you give $10,000 to a GPT-4-powered stock trader and a chimp and let them trade for a month? For the next 30 days, we’re going to find out.</p><p>It might sound strange, but this experiment is rooted in a classic question: is stock trading about skill, or is it mostly luck? There’s actually some history behind this idea, like the time economists argued that a monkey throwing darts at stock picks could do just as well as the pros.</p><p>So, here’s what I’m doing: I’ve built a GPT-4 bot that reads financial headlines from Yahoo Finance and makes stock picks based on the news. On the other side, we’ve got a monkey (okay, it’s just random stock picks, but you get the idea) making decisions purely by chance. Let’s see who wins.</p><h3>The Setup</h3><p>Both the AI and the monkey start with $10,000, and they’re only allowed to trade stocks from the S&amp;P 500. No short selling, no fancy derivatives — just plain old stock trading. For fairness and simplicity, there are no transaction fees, and both can make a maximum of three trades each weekday. The challenge will last 30 days.</p><h3>The Competitors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rl4cRhjmc9cmQfQSO-NT0w.png" /></figure><p>1. <strong>Wall-E Street: The AI Trader</strong><br> This isn’t some ultra-complex Wall Street trading algorithm — it’s GPT-4, reading Yahoo Finance headlines and making its moves based on what it thinks is going on in the market. It might spot a headline about a company’s quarterly earnings or a product launch and decide to buy or sell based on that. No complex market analysis, just quick reactions to the news.</p><p>2. <strong>Gorillionaire: The Random Trader</strong><br> The monkey doesn’t care about news or headlines. Every day, it picks stocks at random. There’s no strategy, no thought — just pure randomness. Will that be enough to beat the AI? That’s what makes this experiment interesting.</p><h3>A Little History: Active vs. Random Trading</h3><p>This idea of comparing human skill with randomness in stock trading isn’t new. Back in the 1970s, Burton Malkiel made the claim in his book “<strong>A Random Walk Down Wall Street</strong>” that a monkey throwing darts at a stock list could match professional traders. His point was that stock prices are largely unpredictable, and even the experts have a tough time consistently picking winners.</p><p>There have been a few studies and experiments that followed Malkiel’s idea, testing random selections against human traders. And while the results aren’t always the same, the main takeaway has been that luck can play a bigger role in trading than many like to admit.</p><p>But what about AI? That’s where things get interesting. Can GPT-4, with its ability to process information quickly and react to the news, outperform random stock picks? Or will the randomness of the monkey prove just as effective in the unpredictable world of the stock market?</p><h3>The 30-Day Showdown</h3><p>So, for the next month, the AI and the monkey will be making their trades. We’ll be tracking both portfolios to see who comes out on top in terms of profit, risk management, and consistency. Here’s what we’ll be watching for:</p><p>- Profit: Which trader can grow their $10,000 the most by the end of the 30 days?<br>- Risk: How much risk does each trader take, and how do they handle market downturns?<br>- Consistency: Will GPT-4 have steady gains, or will the monkey’s random approach deliver surprising wins?</p><h3>Follow the Competition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A80GITGY2WVJK_nd1hIyBA.png" /></figure><p>Want to see how this plays out? You can follow the daily updates <a href="https://monkey-vs-gpt.vercel.app/">here</a> and track the progress of both traders. We’ll be sharing results, insights, and some fun analysis as the competition unfolds.</p><p>Thanks for reading and stay tuned to see who wins!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58ca927277a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fantasy Premier league: Your gameweek 35 Wildcard drafts — aggressive, defensive, balanced]]></title>
            <link>https://medium.com/haul-9000/fantasy-premier-league-your-gameweek-35-wildcard-drafts-aggressive-defensive-balanced-c6410c843466?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6410c843466</guid>
            <category><![CDATA[premier-league]]></category>
            <category><![CDATA[fantasy-sports]]></category>
            <category><![CDATA[fpl]]></category>
            <category><![CDATA[fantasy-premier-league]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Tue, 23 Apr 2024 08:08:10 GMT</pubDate>
            <atom:updated>2024-04-23T08:08:10.292Z</atom:updated>
            <content:encoded><![CDATA[<h3>Fantasy Premier league: Your gameweek 35 Wildcard drafts — aggressive, defensive, balanced</h3><p>With many FPL players considering using their wildcards in Gameweek 35, this article will explore different strategies you can adopt based on your <strong>rank</strong> and <strong>style</strong> of play.</p><h3>You’re unhappy with your rank — the aggressive draft</h3><p>If you’re not where you want to be in terms of rank, it’s time to take the gloves off and pick some <strong>differentials</strong>. We want to select players that have good numbers, good fixtures, and that are not highly owned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*DvDcHJFFL_N5PIrQbj2huA.png" /></figure><p>Despite low ownership, these players have had a solid season and a promising run of fixtures. I especially love the <strong>Pascal Gross </strong>pick for the double gameweek.</p><h3>You’re OK with your rank — the conservative/balanced draft</h3><p>If you’re content with your rank but still want to inject a reasonable level of risk to try to improve it, you should consider players with a moderate level of ownership and a good run of fixtures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*KwDFrkMcn_1LfrUvpstb4A.png" /></figure><p>I like this draft but I would wait for Haaland news (as he’s too big of a risk to ignore, despite not being in great form recently)</p><p>If you want to get a free assessment of your FPL team or Wildcard draft, just take a screenshot and head over to <a href="http://rating.haul9000.team/">HAUL-9000</a>. Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6410c843466" width="1" height="1" alt=""><hr><p><a href="https://medium.com/haul-9000/fantasy-premier-league-your-gameweek-35-wildcard-drafts-aggressive-defensive-balanced-c6410c843466">Fantasy Premier league: Your gameweek 35 Wildcard drafts — aggressive, defensive, balanced</a> was originally published in <a href="https://medium.com/haul-9000">FPL Nemesis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2024 thematic investing trends: Where are investors placing their bets?]]></title>
            <link>https://medium.com/feehras/discover-2024s-top-thematic-investment-trends-where-are-investors-placing-their-bets-8dce3c68b98c?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dce3c68b98c</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[portfolio]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[asset-management]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Sat, 30 Mar 2024 16:19:58 GMT</pubDate>
            <atom:updated>2024-04-02T17:14:20.356Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuWpmr6G-OsMbcLKDAOgbA.jpeg" /></figure><p>As we approach the conclusion of the first quarter of 2024, it’s time to take stock of the top-performing companies and explore if there are any common threads or patterns that unite them. We’ll dive into the best performers and see if there’s a story behind their success — whether they share similarities that hint at broader themes shaping the market.</p><h3>Methodology</h3><p>We only look at companies valued at over <strong>$250 million</strong>. Then, we group these stocks into thematic portfolios (using <a href="http://feehras.com/">Feehras’s</a> AI clustering algorithm).</p><p>After that, we backtest the thematic portfolio against a sector benchmark (e.g: if the theme is “Antibody therapy”, we use the “S&amp;P 500 Health Care” index as a performance benchmark). We look at price changes and trading volumes to see what themes are catching people’s attention.</p><h3>1. Aerospace and Defense Companies in Europe</h3><p>Companies: <a href="https://www.baesystems.com/en/home">BAE Systems plc</a>, <a href="https://www.safran-group.com/fr">Safran SA</a>, <a href="https://www.dassault-aviation.com/en/">Dassault Aviation SA</a>, <a href="https://www.saab.com/">Saab AB (publ)</a>, <a href="https://www.airbus.com/en">Airbus SE</a>, <a href="https://www.leonardo.com/en/home">Leonardo S.p.a</a>., <a href="https://www.thalesgroup.com/en">Thales S.A.</a></p><p>European <strong>aerospace</strong> and <strong>defense</strong> companies have exhibited remarkable outperformance compared to their industrial stock counterparts. Heightened tensions and <strong>conflicts</strong> in Eastern Europe and the Middle East are anticipated to drive increased defense spending, translating into substantial revenue growth for these firms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qT3JBmbf3tAqIeUkcY9nug.png" /></figure><h3>2. Hotels &amp; hospitality</h3><p>Companies: <a href="http://group.accor.com/en">Accor SA</a>, <a href="http://www.ihgplc.com/">InterContinental Hotels Group PLC</a>, <a href="http://www.hyatt.com/">Hyatt Hotels Corporation</a>, <a href="http://www.hilton.com/">Hilton Worldwide Holdings Inc.</a>, <a href="http://www.airbnb.com/">Airbnb, Inc.</a>, <a href="http://www.marriott.com/">Marriott International, Inc.</a></p><p>The <a href="https://www.feehras.com/theme?query=Hotels,%20hospitality,%20residential">travel industry</a> continues its rebound from the aftermath of the COVID-19 pandemic, with hotel companies experiencing a resurgence in revenue as travel demand gradually returns to <strong>pre-pandemic</strong> levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y1BE_wdsvSpkq-IgWkl8Pw.png" /></figure><h3>3. American healthcare service providers</h3><p>Companies: <a href="http://www.hcahealthcare.com/">HCA Healthcare, Inc.</a>, <a href="http://www.uhsinc.com/">Universal Health Services, Inc</a>, <a href="http://www.apollomed.net/">Apollo Medical Holdings, Inc.</a>, <a href="http://www.chs.net/">Community Health Systems, Inc.</a>, <a href="http://www.selectmedical.com/">Select Medical Holdings Corporation</a>, <a href="http://www.tenethealth.com/">Tenet Healthcare Corporation</a></p><p>The United States healthcare sector remains a focal point for investors, with healthcare spending reaching a staggering $4.4 trillion in 2023. This robust spending trajectory is expected to persist, presenting significant growth prospects for American healthcare service providers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NFJOn67s3K6CzCk4Uw7yAQ.png" /></figure><p>Sign up for our waitlist on <a href="http://feehras.com/">Feehras</a> to stay in the loop and explore thematic investment trends and opportunities. Thanks for reading along!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dce3c68b98c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feehras/discover-2024s-top-thematic-investment-trends-where-are-investors-placing-their-bets-8dce3c68b98c">2024 thematic investing trends: Where are investors placing their bets?</a> was originally published in <a href="https://medium.com/feehras">Feehras</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uncovering hidden investment themes using LLMs]]></title>
            <link>https://medium.com/feehras/uncovering-hidden-investment-themes-using-llms-d5d35c4e50ea?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5d35c4e50ea</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[etf]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[index-funds]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 12:41:12 GMT</pubDate>
            <atom:updated>2024-02-18T12:41:12.379Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FJmoo21Ai1U69Kwe1kp%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2FJmoo21Ai1U69Kwe1kp&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExdWRuemt6bm9qZWJvOGlpd2JyeW1yMXBqMW9wbzlvYXFib3pnMWZleSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FJmoo21Ai1U69Kwe1kp%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="215" frameborder="0" scrolling="no"><a href="https://medium.com/media/28bf3dbc67e78dae6d2bb041e15b03e5/href">https://medium.com/media/28bf3dbc67e78dae6d2bb041e15b03e5/href</a></iframe><p><strong>Thematic investing</strong> is like choosing a story to follow — one that resonates with your values and beliefs. Yet, the traditional approach of categorizing stocks into sectors often overlooks the unique narratives behind each company. Take <strong>Tesla</strong> and <strong>Ford</strong>, for example. Both belong to the automotive sector, but their stories couldn’t be more different. Tesla embodies innovation and clean energy, while Ford represents tradition and reliability.</p><h3>Beyond sectors and industries</h3><p>In traditional investing, sectors label companies based on their main business. While useful, this approach misses the essence of a company’s success: its unique story. Take the pharmaceutical sector, for example. Companies here vary widely, from those creating life-saving drugs to others focusing on generics or biotech research. Despite sharing a sector, each company has its own narrative, growth path, and risks.</p><p>Rather than focusing solely on financial metrics or industry sectors, <strong>thematic investors</strong> seek out companies that align with broader societal trends, technological advancements, or emerging consumer preferences.</p><p>However, the challenge arises when trying to identify and <strong>quantify</strong> these narratives in a <strong>systematic</strong> manner. How do we measure the degree to which a company’s story aligns with a particular theme or trend?</p><h3>A story is a set of numbers</h3><p>Enter Language Models (<strong>LLMs</strong>). These powerful tools excel at quantifying stories. To them, words and stories are just vectors, and they can measure the similarity between different narratives by calculating the distance between these vectors. So, we leverage LLMs to analyse company descriptions and news articles, associating each with a high-dimensional vector that represents its unique story.</p><p>To make sense of this data, we turn to visualization techniques like t-SNE (t-distributed stochastic neighbor embedding). By plotting the vectors in a 2D space and color-coding them by sector, we can see if sectors truly encapsulate the full story.</p><p>You can interact with the chart on <a href="https://www.kaggle.com/code/berchichebelkacem/equities-theme-analysis">my Kaggle notebook</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*dCyyJLRN-WKSq3Je6KBu-Q.png" /></figure><p>We see clusters of dots in similar colors, especially in the upper-right corner (healthcare/biotech), indicating that sectors do play a significant role in telling the story. But when you zoom in to smaller clusters with dots of different colors, you can identify cross-sector themes.</p><p>For instance, here we’ve captured a “clean energy” cluster, with companies from four different sectors, all telling the “clean energy” story.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fg1YymT52Pmqv65QmX7%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fg1YymT52Pmqv65QmX7&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExZTl1MHhpMWliOXE1MXA2eTBob2dtaHUzeDA2b2l5cWtxanEwbDJ0YSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2Fg1YymT52Pmqv65QmX7%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="454" frameborder="0" scrolling="no"><a href="https://medium.com/media/b45ec8ffb285233d7f1b5ac469765cfc/href">https://medium.com/media/b45ec8ffb285233d7f1b5ac469765cfc/href</a></iframe><h3>Conclusion</h3><p>In the ever-evolving landscape of investing, understanding the underlying stories behind companies is key. With the help of Language Models, we can go beyond sector labels and uncover hidden investment themes that align with societal trends and emerging consumer preferences.</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5d35c4e50ea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feehras/uncovering-hidden-investment-themes-using-llms-d5d35c4e50ea">Uncovering hidden investment themes using LLMs</a> was originally published in <a href="https://medium.com/feehras">Feehras</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to play Fantasy Premier League like a Wall Street prodigy]]></title>
            <link>https://medium.com/haul-9000/how-to-play-fantasy-premier-league-like-a-wall-street-hotshot-633761e3c649?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/633761e3c649</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[fantasy-football]]></category>
            <category><![CDATA[fantasy-premier-league]]></category>
            <category><![CDATA[investing]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 17:43:54 GMT</pubDate>
            <atom:updated>2023-11-18T18:00:16.287Z</atom:updated>
            <content:encoded><![CDATA[<p>As a software engineer who’s worked in finance, I’ve always found it interesting how Fantasy Premier League (FPL) relates to investing. This article explores how they’re similar, looks at using investment tools in FPL, discusses the differences, and offers tips on making the most of them.</p><h3>Man vs markets</h3><p>Investors fall into two categories: active and passive. An <strong>active</strong> investor selects specific stocks or assets they believe will do well. On the flip side, a <strong>passive</strong> investor opts for a diversified basket of assets that mirrors the entire market, holding onto it for an extended period. They typically follow an index, such as the S&amp;P 500, representing the market. Generally, active investors often see more significant performance <strong>fluctuations</strong> compared to their passive counterparts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o_DnhZAmsx9xzKL54H_wFg.png" /></figure><p>In Fantasy Premier League, we find a parallel between investors and players. There are the “<strong>set and forget</strong>” managers, sticking with their initial picks, often popular choices. On the other side, we have the more “<strong>hands-on</strong>” managers, making weekly changes and injecting differentials to seek an advantage. Similar to active investors, this latter group in FPL often encounters more noticeable changes in their rankings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gsOv7wHkxd06C3zzazBHeg.png" /></figure><p>In the finance world, beating the market is often an impossible task. Many studies indicate that, on average, actively managed funds fall short of matching their benchmarks. However, things are different in Fantasy Premier League (FPL). Remarkably, consistent market-beating is not only possible but proven by well-known managers who consistently secure top 10K finishes. Websites like LiveFPL even keep a list of &quot;<a href="https://www.livefpl.net/elite">Legendary managers</a>&quot;.</p><p>While FPL lacks a direct equivalent of an “index fund,” we can construct a virtual “benchmark” team. This team comprises the most popular assets in the game, allowing us to evaluate our performance against this standard. Let’s take a closer look at what the benchmark team would look like for this season.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*kq2TdDhwdqgSwgNNh4AjqA.png" /></figure><h3>Differences</h3><p>There are two key distinctions in how you approach your investment portfolio versus your FPL squad.</p><p><strong>1/ FPL is purely competitive🥊</strong></p><p>In investing, your target often revolves around a specific financial goal — whether it’s a set amount before retirement or an annual return percentage. The gains or losses of your neighbor or friend don’t directly impact you. In FPL, it’s a different matter. <strong>The objective isn’t a fixed number of points</strong>; it’s about winning your mini-leagues and securing a high rank on the global scoreboard. In this context, simply tracking the average or benchmark team falls short. Injecting differentials is crucial. Ultimately, your aim is to chase those green arrows, not just accumulate points.</p><p><strong>2/ You can (almost) predict the future in FPL </strong>🔮</p><p>Predicting the real-world economy is complex and challenging. However, FPL offers a unique advantage — you can (almost) predict when the benchmark performance will dip. Factors like blank gameweeks and matchups between strong teams provide a level of predictability not easily found in the broader economic landscape.</p><h3>How to leverage the differences</h3><p>Now that we’ve clarified that the pursuit of points isn’t our goal, the widely used“expected points” model loses its relevance. Instead, our focus shifts to leveraging our unique ability to foresee future drops in the benchmark team’s performance. By optimizing our transfers strategically for these anticipated downturns, we prioritize maximizing green arrows over accumulating raw points. The Fixture Difficulty Rating looks like our best tool for estimating these drops in performance, serving as a reliable proxy in our strategic decision-making.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*PouMmEp29sdVk8QYPUAOWQ.png" /></figure><p>When you can anticipate a surge in fixture difficulty for the benchmark team, strategic transfer optimization comes into play. This involves judiciously holding onto your free transfers, deploying a wildcard if the challenging fixtures persist over several gameweeks, and making well-timed player swaps.</p><h3>Start defensive, observe, attack</h3><p>The optimal strategy begins by kickstarting the season with a team comprising the most popular assets, much like adopting a passive investment approach. This mirrors the benchmark’s early-season performance, shielding you from early drops in the ranks. However, as the season unfolds and more insights are gathered, the approach shifts. Injecting differentials becomes key, strategically seizing opportunities as they arise. This dynamic strategy mimics the <strong>transition from a passive to an active investment</strong> stance, capitalizing on the ability to adapt and optimize based on evolving circumstances.</p><p><strong>The implementation 🔨</strong></p><p>Now, to implement this system effectively, it’s crucial to monitor the benchmark team and stay informed about its upcoming difficulties. That&#39;s when the magic of scripting and software comes in 🪄</p><p>Over the past few months, I’ve been dedicated to developing this at <a href="https://haul9000.team/">HAUL-9000</a>. You can already test it out, <a href="https://app.haul9000.team/rate">get your team rated</a>, and assess its prospects against the benchmark team!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwklFplmhmAepOYl981MaQ.png" /></figure><p>I would greatly appreciate your feedback on both the strategy and the app. Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=633761e3c649" width="1" height="1" alt=""><hr><p><a href="https://medium.com/haul-9000/how-to-play-fantasy-premier-league-like-a-wall-street-hotshot-633761e3c649">How to play Fantasy Premier League like a Wall Street prodigy</a> was originally published in <a href="https://medium.com/haul-9000">FPL Nemesis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking football: build a comprehensive player metrics dataset for 0$]]></title>
            <link>https://medium.com/@b_berchiche/hacking-football-building-a-comprehensive-player-metrics-dataset-for-0-89ed94697949?source=rss-3771bcafe5a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/89ed94697949</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[soccer]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Belkacem Berchiche]]></dc:creator>
            <pubDate>Thu, 25 May 2023 05:51:54 GMT</pubDate>
            <atom:updated>2023-05-25T05:54:31.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*X0lHTVLdOpGyRiP2" /></figure><p>The first step to building football software is inevitably to get up-to-date, structured football data. Whether you’re building a football analytics app, an automated betting tipster or an Ultimate Team helper tool, data about team performances, individual player performances, physicality, fitness record, etc. is the foundation you build upon.</p><p>With the rising importance of data in the beautiful game, there is thankfully now an abundance of commercial data you can buy and build upon. However, if you’re an indie hacker who can’t afford it or just want to experiment and play around with some data, you still have some free options.</p><p>This is a problem I’ve encountered when building my FPL solver <a href="http://app.haul9000.team/build">HAUL-9000,</a> and I’d like to share my solution with you.</p><h3>The analytical soup: combining multiple sources</h3><p>For my Fantasy Premier League solving app, I could thankfully rely on the <a href="https://fantasy.premierleague.com/api/bootstrap-static/">official FPL API</a> for data like goals scored, assists, availability, expected goals and so on. It is a sound foundation to build upon. However, I still needed physical data (height, weight, age, estimated speed, strength) and player performance data.</p><p>For the physical data, I went with the FIFA video game dataset, which you can grab on <a href="https://futdb.app/">https://futdb.app/</a>. For player performance, I’ve built a custom scraper for the <a href="https://www.fotmob.com/">FotMob</a> website.</p><p>Now, all I had to do was to merge the external data with the existing FPL data. Pretty straightforward, right?</p><h3>What the fuzz?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*GftUD6sZ1MBnKQ9QrABhMw.png" /><figcaption>N’Golo Kanté or N’Golo Comté?</figcaption></figure><p>That’s when I ran into my first big problem. Each data source uses a different player identification system. In an ideal world, players should be identified by some universal system like <a href="https://www.fifa.com/football-development/fifa-connect">FIFA ID code</a>, but we do not live in such a world. Another option would have been to use the club and the player’s shirt number as identification, but shirt numbers can change during the season, and very few data providers give us that specific data.</p><p>My only option therefore was to merge using player names, but we all know how tricky and dangerous that can be. If your player is named “Heung Min Son” in FIFA and just “Son” on FotMob, there is no way to match the names together.</p><p>That’s when I found <a href="https://github.com/seatgeek/thefuzz">thefuzz</a>, a Python library that does fuzzy merging of strings. I would go through FPL players by name, find the closest matching names in the FIFA and FotMob datasets and tie them all together.</p><p>In order to do that, I would first need to implement function that finds the best match for a given name from a list of player names:</p><pre>from thefuzz import process<br>from typing import List<br><br>def find_best_matching_name(name: str, name_list: List[str]) -&gt; str:<br>    result = process.extractOne(name, name_list, score_cutoff=90)<br>    return result[0] if result else None</pre><p>For my specific needs, I found that a cutoff of 90 yielded the best results, but depending on your data, you’ll have to run through a trial-error phase to find the threshold that works best for you.</p><p>With the matching function implemented, all that was left to do was to create a “dictionary” for mapping player names from the 3 different sources. I like to use the pandas library for data manipulation, so here’s what my implementation looks like:</p><pre>import pandas as pd<br><br>async def main():<br>    # FPL data<br>    fpl_df = get_fpl_players_data()<br>    fpl_df = fpl_df[[&#39;player_name&#39;]]<br>    fpl_df.columns = [&#39;fpl_name&#39;]<br><br>    # FotMob data<br>    fotmob_df = pd.read_csv(&#39;data/fotmob.csv&#39;)<br>    fotmob_names = fotmob_df.player.values.tolist()<br>    fpl_df[&#39;fotmob_name&#39;] = fpl_df.fpl_name.apply(<br>        lambda x: find_best_matching_name(x, fotmob_names))<br>  <br>    # Get FIFA players data<br>    fifa_df = pd.read_csv(&#39;data/futdb_players.csv&#39;)<br>    fifa_df = fifa_df.drop_duplicates(subset=&#39;name&#39;, keep= &#39;last&#39;)<br>    fifa_df = fifa_df[[&#39;name&#39;]]<br>    fifa_df.columns = [&#39;fifa_name&#39;]<br>    fifa_names = fifa_df.fifa_name.values.tolist()<br>    fpl_df[&#39;fifa_name&#39;] = fpl_df.fpl_name.apply(<br>        lambda x: find_best_matching_name(x, fifa_names))</pre><p>After running this code, you’ll get a dataframe that looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ke3Q0qfWidG61ig6v_9ng.png" /></figure><p>You can now export it to a .csv or .json file and use it when you want to combine the data from these sources. Depending on the nature of the data, you’ll need to update it frequently. Athletic / physical data doesn’t need frequent updates typically, but performance data has to be updated weekly in order to be relevant. If you want to go deeper, you can maybe create your own database and have a background job that runs periodically to do the necessary scraping, merging and updating of data.</p><h3>In conclusion</h3><p>Assembling a player metrics dataset from various free football data sources opens up exciting possibilities whether you’re a student of the game and doing one-shot analysis, or an indie developer who’s looking to build football software. In this article, we’ve seen a technique that allows you to combine player data from different sources. Let me know if you’ve encountered this problem and how you solved it, or what topic do you want me to cover next. Happy hacking :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89ed94697949" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>