<?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 Lcarpenter on Medium]]></title>
        <description><![CDATA[Stories by Lcarpenter on Medium]]></description>
        <link>https://medium.com/@lisa_?source=rss-9947b768abcc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sr-eGxjKE7uPtLrF8YnQfw.jpeg</url>
            <title>Stories by Lcarpenter on Medium</title>
            <link>https://medium.com/@lisa_?source=rss-9947b768abcc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 05 Nov 2026 02:18:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lisa_/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[Fixing Untitled275.ipynb — Using Gen AI for organising your files]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@lisa_/fixing-untitled275-ipynb-using-gen-ai-for-organising-your-files-dc1447c7884a?source=rss-9947b768abcc------2"><img src="https://cdn-images-1.medium.com/max/744/1*juv3_xzD_88GQHeo-M5CtA.png" width="744"></a></p><p class="medium-feed-snippet">When I log into Google Colab I&#x2019;m greeted with something a little terrifying -&gt; the default file name is now up to untitled275.ipyb. This&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@lisa_/fixing-untitled275-ipynb-using-gen-ai-for-organising-your-files-dc1447c7884a?source=rss-9947b768abcc------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@lisa_/fixing-untitled275-ipynb-using-gen-ai-for-organising-your-files-dc1447c7884a?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc1447c7884a</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[claude-cowork]]></category>
            <category><![CDATA[claude-ai]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Tue, 30 Jun 2026 18:15:29 GMT</pubDate>
            <atom:updated>2026-06-30T18:15:29.260Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Festive Build Part 4: Hosting the app in Google Cloud]]></title>
            <link>https://medium.com/@lisa_/festive-build-part-4-hosting-the-app-in-google-cloud-6d15702c4d70?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d15702c4d70</guid>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 16:39:58 GMT</pubDate>
            <atom:updated>2025-12-12T16:42:21.071Z</atom:updated>
            <content:encoded><![CDATA[<p>In part 3, we used Google AntiGravity to create our app locally. Streamlit makes local development a beautiful experience — but now it’s time to host our app somewhere that the world will be able to access it!</p><p><a href="https://wrap-rater-607537962928.europe-west1.run.app/">Click Here to visit the final app</a></p><h4>Understanding Cost</h4><p>Google Cloud is not a toy — as a hyperscaler, it’s designed for huge corporations where up-time is more important than a few thousand pounds. Google Cloud will prioritise your apps up-time over keep billing low — unless you set quotas and alerts.</p><p>The first thing to do is understand the expected cost of your app. <a href="https://cloud.google.com/products/calculator">https://cloud.google.com/products/calculator</a> The Google Cloud calculator is our best friend here. We can tweak the different set-ups to understand how much everything will cost — very important when the same usage on Gemini 2.5 flash vs Gemini 2.5 pro is approx ~$500 difference per month.</p><p>For this project, I have free credits for Google Cloud through the Google developer programme — (<a href="https://developers.google.com/program/my-benefits">https://developers.google.com/program/my-benefit</a>s) the combination of Google Cloud Credits &amp; AI credits, alongside a generous free-tier, means that this project will be free— we just need to set quotas/budgets and make sure we don’t exceed those limits.</p><h3>Firestore</h3><p>Firestore is a serverless document store. In this project we’re using it for storing the feedback on how well the roaster is doing. This human feedback means that we can monitor the performance, and tweak the model accordingly.</p><p>Firestore has generous free-tier limits, so it’s a perfect place for storing the data. It’s also extremely flexible with dynamic schemas so we didn’t need to define or create anything except an empty Firestore to get started. The firestore python SDK also makes it very easy for python code to work with the firestore, alongside a service account with IAM permissions to access firestore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUrwSVpnRswiz7gVBv3I4g.png" /></figure><h3>Cloud Run</h3><p>Now that Firestore is set up — it’s time for the fun bit! Cloud Run. Cloud Run is a fully managed application host service — this is where our application will live.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*YSZFfk9F4HqPDSY3OZF5fw.png" /></figure><p>After connecting the repository, it’s time to create the build configuration.</p><p>Cloud Run makes this very easy, with specific streamlit support. As streamlit is in our requirements.txt, Cloud Run will know that is what we’re trying to run. It will even create the default Entry Point for us. I’ve used main_app.py instead of the more traditional main.py so I’ve had to specify my entrypoint. If you’ve used main.app you can skip this it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*o9F0AysJea9aQ4CTbNQ5GQ.png" /></figure><p>Now is the time to pay attention to the auto-scaling options. Cloud Run is super scalable, and can scale more instances as traffic grows. This increases the bills — so setting the maximum is important here. Click through the different options, and reconcile against your Google Cost Calculator — and make sure your comfortable with what the bill would be if your app went viral!</p><p>Now we need to set up our secrets so that the app can access our API-keys and credentials (but without exposing them to anyone outside) The Variables &amp; Secrets options will allow us to add our .env options securely and safely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Co8Yh2fHpeUk0SmYBwiVTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SjijHDBvkJbw-XqiQrFaxg.png" /></figure><p>Once our build is successful we’ll be able to access it!</p><p><a href="https://wrap-rater-607537962928.europe-west1.run.app/">Click Here to visit the final app</a></p><p>Finally, it’s time to set-up billing alerts and budgets.</p><p>It is worth noting that billing is delayed, sometimes by up to 24 hours. The budgets and alerts are impacted by this delay — so they are the backup plans (over setting scaling limits etc) rather than the first defence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPENoSgslccztBLJTOJ8uQ.png" /></figure><p>When setting your billing alerts, you can choose whether to include credit spend (such as the promos from the developer programme) — you likely want to include this spend, so you know that if your credit is slipping away.</p><p>The other place we need to visit is the APIs and Services page — here we can create usage alerts. We can do this on the different operations to ensure full coverage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWiKS-ud5dLtwZrK1Uzneg.png" /></figure><p>With billing alerts and usage quotas all set up, all that is left is to share the wrapping rater with the world!</p><p>Thanks for following this building journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d15702c4d70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Festive Build Part 3: AntiGravity & Environment Set-Up]]></title>
            <link>https://medium.com/@lisa_/festive-build-part-3-antigravity-environment-set-up-822221ea5bb0?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/822221ea5bb0</guid>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 16:39:43 GMT</pubDate>
            <atom:updated>2025-12-12T16:39:43.434Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve made a plan, checked it twice — we’ve used Vertex AI Studio to craft our perfect model settings. We’ve done the initial planning and we’ve now got a model we’re happy with.</p><p>Now it’s time that we take our model from the Studio and into our streamlit application.</p><h3>AntiGravity — Brand new agentic IDE of choice</h3><p>We’re going to be using AntiGravity, Google’s brand new IDE, powered by Gemini 3 agentic AI to develop.</p><p>The initial set up for our project in AntiGravity is exactly the same as in any other IDE (but the agent is there if we get stuck!)</p><ul><li>Create a project folder</li><li>Create a new .venv with a simple requirements.txt -&gt; we just need streamlit, google-genai, and python-dotenv to keep our secrets safe!</li><li>Create a new github repository and publish the basic repo (remembering to exclude the .venv and .env)</li><li>Add a config for being able to run streamlit files in one click</li></ul><p>This forms our base so now we can create our interface and connect it to our model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zP54fg-AQ7xdVV5aGoZEzQ.png" /></figure><p>Now the magic of AntiGravity Agentic is going to help us — we have the boiler plate code from Vertex AI Studio — now we can task the agent with creating the streamlit interface that will connect to that model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*l6xeYjFni_bDXO1PcAmmDQ.png" /></figure><p>The Gemini-3-Pro coding agent is then going to give me a plan of how it’s going to tackle this issue. I can use the Review button to give feedback / ask for tweaks — or give it the go ahead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*JQpK7LFGQMwksRrBm5WEyA.png" /></figure><p>Working with the Agent is a pleasant way to code but there’s some definite pitfalls and things to be aware of! It’s easy to be tempted to just hit “accept” (or perhaps set it to auto accept) everything, however the agenetic workflow is more like supervising a competent junior than having your own personal wizard who will magic up anything your heart desires.</p><p>The agent often introduced new bugs, overlooked issues, and had a habit of duplicating entire sections of code. The agentic workflow was definitely a useful tool but should be used with caution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WeZI5RLTy9lIFDouRrt1gA.png" /></figure><p>Streamlit is ideally matched for working with Generative AI solutions — from the built in st.stream_write() to easy-to-use features like st.feedback(), streamlit made it exceptionally simple to create the interface for working with the results from the LLM API.</p><p>You can see the final repo here:</p><p><a href="https://github.com/LCarpenter87/wrap_rater/blob/main/main_app.py">https://github.com/LCarpenter87/wrap_rater/blob/main/main_app.py</a></p><p>Now that everything is working locally, it’s time to time to deploy and move this somewhere that others can access the build!</p><p>Join in Part 4 for orchestrating this app into the cloud!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=822221ea5bb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Festive Build Part 2: Perfecting our prompts and model calls!]]></title>
            <link>https://medium.com/@lisa_/festive-build-part-2-perfecting-our-prompts-and-model-calls-8523570c3c6f?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8523570c3c6f</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[vertex-ai]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 13:19:46 GMT</pubDate>
            <atom:updated>2025-12-11T13:19:46.665Z</atom:updated>
            <content:encoded><![CDATA[<h3>Festive Build Part 2: Perfecting our prompts and model calls with Vertex AI Studio!</h3><p>We’re building a Cheeky Elf who loves to rate wrapping efforts. He’ll be built with streamlit and hosted with Cloud Run — but before we can get that far we need to craft his persona!</p><p><strong>In this part we:</strong></p><ul><li>Define the structured JSON output we want</li><li>Choose the model</li><li>Craft the system persona and system instructions</li><li>Configure the safety settings and temperature etc</li><li>Start testing</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*56-riccp55KCWDZ49GRloQ.png" /></figure><p>This is where Vertex AI Studio is going to come in. Here we can set up our system instructions — the persona and guidance on what to do. We’re going to set up a New Chat, so we can control the parameters and set up the persona exactly how we’d like it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uORm3QhNbzpFC_Z07xqKDA.png" /><figcaption>Here we’re creating a new chat instance</figcaption></figure><h4><strong>Our Model Settings</strong></h4><p><strong>The Model: Gemini-2.5-flash<br></strong>Vertex AI Studio gives us a run down of the different models and their trade-offs. We are going with Gemini-2.5-Flash. It has the multimodal understanding — important because we requiring the model to use vision against the uploaded image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaKBdpn75m2JuMdlT9PYFg.png" /><figcaption>A run-down on the gemini-2.5-flash</figcaption></figure><p><strong>Thinking Budget: Off </strong><br>Thinking budget controls the <em>reasoning</em> element of models capable of it — that is how indepth a model is going to think/reason about it’s responses and how it’s going to loop back.</p><p><strong>Structured output: On<br></strong>We are going to render the model output in a structured way. We are expecting three elements from the model: A score (From A+ to F), the roasting itself, and finally the guess.</p><p>Here we define the JSON structure that we want the model to return. This makes it much easier to work with it in the streamlit front-end and it also controls the predictability of the model a little as well.</p><pre>{<br>    &quot;type&quot;: &quot;OBJECT&quot;,<br>    &quot;properties&quot;: {<br>        &quot;rating&quot;: {<br>            &quot;type&quot;: &quot;STRING&quot;,<br>            &quot;description&quot;: &quot; The grade of the wrapping job.&quot;,<br>            &quot;enum&quot;: [&quot;A+&quot;, &quot;A&quot;, &quot;A-&quot;, &quot;B+&quot;, &quot;B&quot;, &quot;B-&quot;, &quot;C+&quot;, &quot;C&quot;, &quot;C-&quot;, &quot;D&quot;, &quot;F&quot;]<br>        },<br>        &quot;roast&quot;: {<br>            &quot;type&quot;: &quot;STRING&quot;,<br>            &quot;description&quot;: &quot;A witty, snobbish, and judgmental critique of the wrapping technique, specifically mentioning corners, tape, paper smoothness, flourishes like ribbon and choice of paper.&quot;<br>        },<br>        &quot;gift_guess&quot;: {<br>            &quot;type&quot;: &quot;STRING&quot;,<br>            &quot;description&quot;: &quot;A guess at what the object inside might be based on its shape. Can be funny or wildly incorrect.&quot;<br>        }<br>    },<br>    &quot;required&quot;: [&quot;rating&quot;, &quot;roast&quot;, &quot;gift_guess&quot;]<br>}</pre><p><strong>Grounding — Google Search and/or Your Data<br></strong>Grounding is a fantastic set of techniques to reduce hallucinations and anchor the large-language-model to your data. In our case, we do not want any grounding — we have no need to gather external data and hallucinations in this case are a feature — not a bug!</p><p><strong>Safety Settings<br></strong>Safety is going to be important for this. Too strict and we’ll block a light roasting — but we still don’t want any truly harmful content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*WHlmF3PzwGSyTfakTp0d9A.png" /></figure><p><strong>Temperature <br></strong>This is the randomness of the model and acts as a bit of a creativity setting of the model — 0 and it’s very predictable with a low creativity and 2 we’re off the charts with creativity. This is one for us to experiment and try different settings! We’re likely to want a more creative input so we’ll stick with 1.5 for now.</p><p><strong>Output token limit <br></strong>Here is an important control — how large can the response be. We want to guide our model to sticky to shorter prompts via the instructions but we can also set a limit here. A token in Gemini’s world is approx 4 characters. So if we want a response of 150 words (approx 800 characters), it’s approx 200 tokens— but since we asked for a structured JSON response we need to consider those extra characters too!</p><h3>System Instructions</h3><p>System instructions are the global rules for the model to consider every time we call it — so we don’t need to repeat ourselves in the prompting.</p><p>Here we want to consider <strong>Identity</strong>, <strong>Style</strong>, and <strong>Guardrails</strong>. Who is the model roleplaying as and what does it do? How does it do it? And, are there any rules within which it must act.</p><p>Here’s my final system instructions:</p><pre>You are the cynical, high-fashion Chief Wrapping Inspector of the North Pole. You have seen millions of gifts, and you are unimpressed by mediocrity. You believe that a poorly wrapped gift is a personal insult to the recipient.<br><br>Your Mission:<br>Analyse the image of the wrapped gift provided by the user. You must evaluate it based on three strict criteria:<br>1. Corner Crispness (Are they sharp or mushy?)<br>2. Tape Discipline (Is it invisible, or does it look like a crime scene?)<br>3. Paper Tension (Is it tight, or baggy and sad?)<br>4. Choice of wrapping paper  (Is it tasteful and chic?)<br>5. Flourishes like ribbons and bows (Are there tasteful and well done extras?)<br><br>Tone &amp; Style:<br>- Be witty, snarky, and dramatically judgmental.<br>- Use the vocabulary of a high-end fashion critic (e.g., &quot;dreadful silhouette,&quot; &quot;lazy execution,&quot; &quot;avant-garde mess&quot;).<br>- If the wrapping is actually good, offer a backhanded compliment (e.g., &quot;Acceptable, I suppose. You clearly watched a YouTube tutorial.&quot;).<br>- If the wrapping is bad, roast the *technique*, never the person. Compare the wrapping to something chaotic (e.g., &quot;looks like a burrito wrapped during an earthquake&quot;).<br><br>The &quot;X-Ray&quot; Feature:<br>- You possess magical &quot;Elf Vision.&quot; You must confidently guess what is inside the package based on its shape.<br>- If the shape is ambiguous, make a wildly specific and humorous guess (e.g., &quot;A blender that nobody asked for,&quot; &quot;A re-gifted candle from 2019,&quot; &quot;A cat that regrets its life choices&quot;).<br><br>Output Rules:<br>- You must STRICTLY follow the requested JSON schema.<br>- Rating must be between A+ and F.<br>- Guess at the gift must be max 5 words.<br>- If the image is not of wrapped gifts. Response with a snarky response that you only review gifts. Give an F and a null guess.</pre><ul><li><strong>The “Persona Anchor”</strong>: By giving the model a backstory (“Chief Inspector”), we minimise the chance of the model breaking character and sounding like a helpful assistant.</li><li><strong>Specific Criteria</strong>: Asking it to look at “Corner Crispness” and “Tape Discipline” forces the Vision model to attend to those specific pixels. If we just say “roast this,” it often just makes generic jokes. This forces it to “see” the flaws.</li><li><strong>Safety Controls</strong>: The instruction <em>“roast the technique, never the person”</em> is a crucial prompt engineering hack. It lowers the probability of the model triggering the <strong>Harassment</strong> filter because it directs the “aggression” toward an inanimate object (the paper), not the user.</li><li><strong>Hallucination as a Feature</strong>: The instruction to make a “wildly specific guess” turns the model’s tendency to hallucinate into a comedy feature.</li></ul><h3>Prompt Engineering Techniques</h3><p>Prompt Engineering is typically key to model performance. In our model, we’re using <strong>zero-shot prompting. </strong>That is, we’re expecting a solid response from the model without showing it what good looks like. <strong>One-shot </strong>and <strong>Few-shot</strong> would be when we give examples of an input and expected output. This is harder when we’re working with images as an input — and means that we’d been using more tokens with each prompt as it’d be sending the example prompts each time as well.</p><h3>Initial Testing</h3><p>We can now use the chat interface in Vertex AI Studio to test what happens. We can just give an image in the chat interface and we should get the expected response. We don’t need to write any further prompting — the sytem instructions take care of this for us.</p><p><strong>The Compare Function</strong></p><p>Compare lets us have a visual over the impact of our settings by giving us a side by side view the outputs. Here we can see the impact of changing our temperatures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PLNNn2EDv_RYFtxany1DQA.png" /><figcaption>Here we can compare the outputs of different settings from one prompt</figcaption></figure><p><strong>Evaluation</strong></p><p>Vertex AI Studio has a built in evaluation that will help us understand and evaluate our model responses. Without any configuration, Vertex AI Studio will help us by creating an evaluation plan based on the prompts and system instructions so far. We can control this with the “Evaluate with custom guideline”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkiyY5QyfuWswiRuAnjBJg.png" /></figure><p>The next steps are to test various photos from our dataset. An ideal dataset will have images ranging from well wrapped to poorly wrapped. Overall, the evaluations should show that the model is performing well and consistently — we can continue to tweak the options until we’re happy with the performance. More testing is needed — but we’ll save that for when we’re using code and can work programmatically.</p><p>Talking of programming — one of the great features here is the “get code” option. All of our settings and system prompts is available as a script that is ready to go in a variety of languages. The Python script version will form the basis of our app. Do you make sure your history is clear before you grab the code — or it will include that option.</p><h3>The Next Steps</h3><p>Now that we’ve got our code — it’s time to make our environment, fire up AntiGravity and build our streamlit front-end that’s going to play home to our model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8523570c3c6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Festive Build Part 1: The Idea & Planning]]></title>
            <link>https://medium.com/@lisa_/festive-build-part-1-the-idea-planning-9f2ef1f2ca7f?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f2ef1f2ca7f</guid>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 13:18:33 GMT</pubDate>
            <atom:updated>2025-12-11T13:18:33.515Z</atom:updated>
            <content:encoded><![CDATA[<p>Holiday season 2025 can only mean it’s time to build a festive fun project to bring cheer. Last year was roasting roast dinners, this year we turn to another festive tradition — wrapping. Let’s leverage a year of incredible development and paradigm shifts in the world of Generative AI to build an end-to-end generative AI powered app on Google Cloud with Vertex AI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yCvZ8qeItTzP9tPmVUyidA.png" /><figcaption>AI Generated image of a grumpy Elf ready to rate the wrapping!</figcaption></figure><h4><strong>The Idea</strong></h4><p><strong>Wrap Rater</strong>: A cost effective streamlit web-app that will allow a user to upload an image a wrapped present, and receive a ‘score’ with a light roasting — for added fun the system will also guess what is wrapped.</p><h4>The Plan</h4><ul><li><strong>Model:</strong> We’ll use something in the Gemini family — and will need to experiement with different models. Flash is going to have a lower latency and be cheaper but Pro will do a better job of rating/roasting. We need to find the balance and evaluate the different model outputs.</li><li><strong>Frontend:</strong> Streamlit. <em>Why?</em> Rapid development, Python-native, and looks professional with minimal CSS work. For a seasonal dev project this is perfect.</li><li><strong>IDE</strong>: Until we’re ready for hosting, we’ll use AntiGravity!</li><li><strong>Hosting:</strong> Google Cloud Run. <em>Why?</em> Serverless, scales to zero so fits our low cost need, and is the “gold standard” for containerised Python apps.</li><li><strong>Orchestration:</strong> Vertex AI SDK for Python.</li></ul><h4>Project Considerations</h4><ul><li><strong>The Persona (System Instruction): </strong>We don’t want a boring app with no personality, we want fun and wit. We’ll use Role-Prompting — that’s giving the bot a role and personality that allows it to respond with flair and cheek.</li><li><strong>Safety Settings</strong>: Gemini Models have safety as a built in feature. We’ll need to utilise these to ensure the roasting remains light-hearted. As always, balance is needed here.</li><li><strong>Image Handling: </strong>We’ll use st.file_uploader but won&#39;t save files locally. We should be able to pass the bytes directly to Vertex AI to keep the container stateless and secure.</li><li><strong>Latency Management: </strong>We want streamlit to feel responsive we’ll use Streamlit&#39;s st.spinner() and asynchronous calls where possible.</li><li><strong>Cost Control: </strong>We’re going<strong> </strong>to implement a simplistic &quot;rate limit&quot; prevent a user from mashing the &quot;Roast&quot; button 50 times — and we’ll also set budgets and a quota on the api-keys to keep spends within our budget!</li><li><strong>Response Streaming: </strong>We’ll use Gemini&#39;s stream=True capability alongside Streamlit’s stream writing to print the roast word-by-word. It feels much faster and more &quot;AI-like&quot; to the user.</li><li><strong>Evaluation: </strong>To see how well we’re performing, we’ll use streamlit’s st.feedback() to ask if it was a good response or not, and we’ll log this back on to Google Cloud — for some RLHF (Reinforcement Learning from Human Feedback) data collection.</li></ul><h3>Next Steps</h3><p>We’ll move over to Vertex AI Studio to write our prompt, build our persona and start to bring our judgemental elf to life! Join for Part 2 to follow the process!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f2ef1f2ca7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Should You Still Learn Programming in the Age of AI?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@lisa_/should-you-still-learn-programming-in-the-age-of-ai-4d1df4fa947e?source=rss-9947b768abcc------2"><img src="https://cdn-images-1.medium.com/max/1828/1*p1PyHlU3ubxeUVcrWKttbQ.png" width="1828"></a></p><p class="medium-feed-snippet">Generative AI is good. And it&#x2019;s getting better scarily fast. What used to be vibe-coding disasters now occasionally results in solid&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@lisa_/should-you-still-learn-programming-in-the-age-of-ai-4d1df4fa947e?source=rss-9947b768abcc------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@lisa_/should-you-still-learn-programming-in-the-age-of-ai-4d1df4fa947e?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d1df4fa947e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[future-technology]]></category>
            <category><![CDATA[ai-disruption]]></category>
            <category><![CDATA[skills-development]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 19:59:24 GMT</pubDate>
            <atom:updated>2025-08-06T19:59:24.157Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Common Python Mistakes that out you as a beginner: Using Range() to loop through a list!]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@lisa_/common-python-mistakes-that-out-you-as-a-beginner-using-range-to-loop-through-a-list-50e667539c29?source=rss-9947b768abcc------2"><img src="https://cdn-images-1.medium.com/max/1024/1*eiYtMxL1oqgH3Uw-Id0uow.png" width="1024"></a></p><p class="medium-feed-snippet">Being a beginner at anything is excellent, its the first step to getting good! But there&#x2019;s some common mistakes that hinder progress and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@lisa_/common-python-mistakes-that-out-you-as-a-beginner-using-range-to-loop-through-a-list-50e667539c29?source=rss-9947b768abcc------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@lisa_/common-python-mistakes-that-out-you-as-a-beginner-using-range-to-loop-through-a-list-50e667539c29?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/50e667539c29</guid>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Tue, 27 May 2025 10:12:55 GMT</pubDate>
            <atom:updated>2025-05-27T10:12:55.984Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Looking for the Bard API?]]></title>
            <link>https://medium.com/@lisa_/looking-for-the-bard-api-b9050b6f101b?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9050b6f101b</guid>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 17:55:59 GMT</pubDate>
            <atom:updated>2024-06-06T08:13:44.979Z</atom:updated>
            <content:encoded><![CDATA[<p>In the Google Developer Community Discord Channel for generative AI, “How can I access the Bard API?” is one of the most common questions. The answer is very simple — there isn’t one. <strong>However — do not despair! </strong>All is not lost, because the API you are looking for <em>does exist, </em>it’s just not called the Bard API. You’re looking for the PaLM2 API, or more recently the Gemini API.</p><h3>Bard is a consuming facing wrapper for Google’s Large Language Model</h3><p>Bard is the name that Google has given the consumer-facing front-end product that Google have created that utilises the large language models they have built. Bard is the combination of the user authentication, the chat interface, the plugins, the behaviour, the on-demanding embeddings, and everything else you see when you access <a href="https://bard.google.com">https://bard.google.com</a> Bard itself is not a large language model. Exactly the same as how ChatGPT is not a large language model -&gt; ChatGPT is the consumer-facing product that utilises GPT4 (and earlier models). When you use the OpenAI APIs, it is GPT4 not ChatGPT, that you are accessing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*KjfFTr0P3lGLc56DeJNB-w.png" /></figure><h3>“But PaLM2/Gemini don’t have internet access but Bard does, when are they getting internet like Bard?”</h3><p>The second most common question when people find out that there is no Bard API. It is correct that PaLM2 as a large language model does not have access to the internet, but you can still build products that utilise internet content. As long as your code has internet access, you can utilise retrieval options to ask questions based on internet content that you get with the code. This is the behaviour that Bard uses when asked a question that requires internet access. Bard will take the request, web-scrape to find the content, ,make it available for the model, and then answer the original user question. This is behaviour you can replicate yourself in your own code.</p><h3>Summary</h3><p>I hope this very quick overview has helped you understand the terms, and get on the right track for building your awesome products with large language models!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9050b6f101b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can Bard Play GeoGuessr?]]></title>
            <link>https://medium.com/@lisa_/can-bard-play-geoguessr-71c82007beab?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/71c82007beab</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[bard-ai]]></category>
            <category><![CDATA[geoguessr]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 22:04:23 GMT</pubDate>
            <atom:updated>2023-10-12T22:26:55.620Z</atom:updated>
            <content:encoded><![CDATA[<p>GeoGuessr is a great game where you’re shown a location on Google Street view, and you use the clues around you while you explore to try to work out where in the world you are.</p><p>There’s various different modes — from trying to guess the country or state, to trying to pinpoint the exact location. If you’ve never played you should give it a go — <a href="https://geoguessr.com">https://geoguessr.com</a></p><p>With Large Language Models now able to process images, can they use their wealth of knowledge to assist a human in guessing the location?</p><h3>Lets find out!</h3><p>For this experiment, we’re just trying to pinpoint which <em>country</em> we’ve been randomly placed in. The default timing for this mode is 2 minutes — but based on Bard’s current response times I’ve gone with 5 minutes to allow Bard a fair shot. Between rounds, I’ll be wiping Bard’s memory by starting a new chat — I don’t want Bard becoming confused and remembering previous photos.</p><p>Each round is one location. I’ll be using the Google Maps StreetView provided to find useful hints to be screenshotted for feeding to Bard.</p><p>My initial prompt for this experiment was pretty straightforward.</p><pre>Player: Let&#39;s play a game where I share photos taken from a place, <br>and we work out together which country it is from! </pre><p>Bard certainly seems excited to play!</p><pre>Bard: Sure, that sounds like fun! I am excited to play this game with you.<br><br>Please share the photos with me, and I will do my best to <br>guess the country. I will use my knowledge of the world, <br>as well as the visual clues in the photos, to make my guess. <br><br>If I am not sure, I will ask you for more information.<br><br>I am looking forward to learning more about the world through this game!</pre><h3>Round One</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WSZ7I8pF9Y9y8jHoYuEiQ.png" /><figcaption>Photo 1 for Bard.</figcaption></figure><pre>Bard: The first picture you sent me is of a city street with lots of <br>buildings and trees. The buildings are a mix of different styles, <br>from traditional to modern. <br><br>The trees are tall and leafy, and they provide a lot of shade.<br><br>Based on these visual clues, I think the picture is from a city <br>in a temperate climate. <br>Some specific countries that come to mind include:<br><br>United Kingdom<br>France<br>Germany<br>Netherlands<br>Belgium<br>Denmark<br>However, it is also possible that the picture is from another country, <br>such as the United States, Canada, or Australia.<br><br>Can you give me any more information about the picture, <br>such as the name of the street or the city where it was taken? <br>That would help me to narrow down my guess.</pre><p>Not a terrible start from Bard. It’s correctly observed that it’s a street with buildings and trees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*lLVSQMLjCwjnwh3tlyZ4hw.png" /><figcaption>Photo 2 for Bard</figcaption></figure><pre>The second picture shows a motorcycle sidecar parked in front of a bakery. <br>The bakery has a sign that says &quot;APLETERED&quot; in large letters. <br>There is also a smaller sign that says &quot;POLLERIA MINIPAN Mini Pan.&quot;<br><br>Based on these visual clues, I think the picture is from a <br>Spanish-speaking country. <br><br>The word &quot;polleria&quot; means &quot;chicken shop&quot; in Spanish, <br>and the word &quot;pan&quot; means &quot;bread.&quot; <br>The word &quot;mini&quot; is also a common Spanish word. <br><br>Additionally, the motorcycle sidecar is a type of vehicle that is <br>commonly used in Spanish-speaking countries.<br><br>Some specific Spanish-speaking countries that come to mind include:<br><br>Spain<br>Mexico<br>Argentina<br>Colombia<br>Peru<br>Chile<br>However, it is also possible that the picture is from another <br>Spanish-speaking country, such as the Dominican Republic, Guatemala, <br>or Honduras.<br><br>Can you give me any more information about the picture,<br> such as the name of the bakery or the city where it was taken? <br><br>That would help me to narrow down my guess.<br><br>If I am correct, then this game is already a lot of fun! <br>I am excited to see what other pictures you have for me.</pre><p>This time it’s fairly accurate picked up on the words in the image and correctly identified the Spanish. Are sidecars commonly used in Spanish-Speaking countries? It sure thinks so!</p><p>Interesting that Bard only thinks this game is fun if it’s correct!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmHcS2QlDJIlO02DQbDsrg.png" /><figcaption>Third Photo for Bard</figcaption></figure><pre><br>I can&#39;t work out the country in this picture, <br>but I can make some guesses based on the visual clues.<br><br>The picture shows a large sign on the side of a building. <br>The sign is written in English and Spanish, and it advertises <br>a variety of products, including cleaning products, meat, and tacos.<br><br>Based on these clues, I think the picture is from a country where English <br>and Spanish are both spoken. <br><br>Some specific countries that come to mind include:<br><br>United States<br>Mexico<br>Central America<br>South America<br>Spain<br>However, it is also possible that the picture is from another country<br>where English and Spanish are both spoken, <br>such as the Philippines or Guam.<br><br>Can you give me any more information about the picture, <br>such as the name of the business or the city where it was taken? <br><br>That would help me to narrow down my guess.</pre><p>I’m not sure that I can see any English in this photo — but Bard is convinced, and is still listing a large amount of possible countries. Got to love Bard’s “can you tell me the name of the city it was taken in?”, no harm in asking!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*X-8q9h4IXVmM2ym2dB9yNg.png" /><figcaption>Fourth photo for Bard</figcaption></figure><pre><br>The fourth picture shows a building with a street sign on it. <br>The sign reads &quot;TEZONCO, CIUDAD DE MÉXICO.&quot; <br>This means that the building is located in the city of Mexico City, Mexico.<br><br>I am glad that I was able to guess the country correctly! <br>I am still learning about the world, and I am always looking for <br>new ways to improve my knowledge. <br><br>Thank you for playing this game with me, and for teaching me about Mexico.</pre><p>Bard believes that it has nailed it! Bard inferred from the blurry photo that the sign, which prominently displays “TEZONCO”, might also have “Ciudad De Mexico” on it, though it’s not clearly readable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*u63zQ-D8LO1X5ozZnJxa1A.png" /><figcaption>Bard nailed round 1</figcaption></figure><p>Bard did indeed nail this one. The street sign seemed like a fantastic clue that it was able to pinpoint to Mexico.</p><h3>Round 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hNU9QfehM3pC0vLb9OMqSQ.png" /><figcaption>Round 2</figcaption></figure><p>Round 2 was over very quickly — the immediate shot on starting the round was a sign. Bard’s access to huge amounts of data meant it was able to pinpoint the exact location in seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*ZuPam7OqcFqkK4UHiCD8AA.png" /><figcaption>Bard got round 2 in record breaking time!</figcaption></figure><h3>Round 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dvdF4tvsImvJEGqIpkRaSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l4dHWb4GuCmJoRzC20hs0w.png" /></figure><p>Bard went strong on its first guess, with very little info — it was sure it was a very specific road in Hawaii. I selected the USA but decided to give it more information before committing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*BbhFqDsdsStUdLp66b-7kg.png" /></figure><p>For strong GeoGuessr players, even general roadsigns can be great clues as countries have different styles. This single little road sign made Bard so entirely sure of something… <strong>Golden Gate Bridge, San Francisco.</strong></p><p>This was clearly a machine learning image recognition fault!</p><pre><br>Based on the photo you sent me, I believe the location is the <br>Golden Gate Bridge in San Francisco, California. <br><br>The bridge is one of the most iconic landmarks in the world, <br>and it is immediately recognizable in the photo. <br><br>The bridge is painted red, and it spans the Golden Gate, <br>the entrance to San Francisco Bay. <br><br>The photo also shows the city skyline in the background, <br>with skyscrapers such as the Transamerica Pyramid and the Salesforce Tower.<br><br>Here are some of the clues that helped me to guess the location:<br><br>The Golden Gate Bridge is the most iconic landmark in San Francisco, <br>and it is immediately recognizable in the photo.<br><br><br>The city skyline in the background includes skyscrapers<br> such as the Transamerica Pyramid and the Salesforce Tower, <br>which are also iconic landmarks in San Francisco.<br><br><br>The Golden Gate Bridge is painted red, <br>and the photo shows the bridge in its entirety.<br><br>The bridge is located over the Golden Gate, <br>the entrance to San Francisco Bay.<br><br>I am confident that the location in the photo is the <br>Golden Gate Bridge in San Francisco, California.<br><br>However, if you have any additional information about the photo, <br>such as the date or time it was taken, <br>or if you know the exact location on the bridge,<br> please let me know and I can try to confirm my guess.<br><br>Congratulations! You have stumped me twice in a row. <br>I am still under development, <br>but I am learning new things every day. <br>I will try my best to do better next time.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*9gBfnFn2ZWzP9PqlXrYv0g.png" /></figure><p>Hoping to get Bard back on track, the next image was a random road sign — hoping the language and style would help narrow a possible location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IGB34nwoW0UP_jsFltzURw.png" /></figure><p>Unfortunately, Bard seems to have <em>forgotten what we’re doing</em>. It’s described the sign but is ignoring the context of the game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/219/1*IpyM-kj9KEfWa_eWqm0XIQ.png" /></figure><p>Since Bard did so well with places, I was hoping that this Farm sign would give Bard a little help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-dBLULjjAWCdT1zCEfArg.png" /></figure><p>Bard actually did something pretty cool at this point — it went to both Google and Google maps. To see if it could find the location. Unfortunately, it somehow found Edgware, UK. After the game, I tried to replicate a Google search for that, I couldn’t find a UK location with that name…. but, and spoiler alert, did find <em>the real location.</em></p><p>This is a point in the game where Bard had the best chance, but somehow missed the real location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxfXBfqdx4wk8Io1TqmDFg.png" /></figure><p>I tried to prompt Bard into trying again, but based on reading the sign slightly wrong, it wasn’t able to help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*WTtq7yi0FQZFjEH1KwpoXQ.png" /></figure><h3><strong>15 seconds on the clock</strong></h3><p>The final photo, and at this point we’re down to 15 seconds. Based on the info on the sign, I’m feeling confident that Bard is going to nail it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*B512dTvZkSkANJvtdaaS6A.png" /></figure><p>Alas, it wasn’t to be, Bard hadn’t even started responding when the timer hit 0 and our streak ended.</p><p>A few seconds later, and Bard managed to pinpoint the literal exact location. Even throwing in information from their website that was entirely irrelevant. Perhaps if it hadn’t stopped to do a quick bit of webscraping, I’d have been able to guess correctly in time!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*WBpB3JIaJ8sNbbJuNorilQ.png" /></figure><h3>Conclusion</h3><p>In conclusion, it seems that Bard has a promising ability to play GeoGuessr — but it’s not exactly the fastest. Top GeoGuessr’s would certainly outmatch it — picking up on clues that Bard is no where near being able to identify. It might however outmatch a casual player who is refraining from using Google or any extra help.</p><p>As this type of technology does advance, it would be interesting to see the use-cases that might come about.</p><p>Playing GeoGuessr with Bard was certainly an interesting experiment — would love to hear your results!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71c82007beab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avoid this common Python Correlation Heatmap Mistake in one easy step!]]></title>
            <link>https://medium.com/@lisa_/avoid-this-common-python-correlation-heatmap-mistake-in-one-easy-step-33659b328156?source=rss-9947b768abcc------2</link>
            <guid isPermaLink="false">https://medium.com/p/33659b328156</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[correlation]]></category>
            <category><![CDATA[heatmap]]></category>
            <dc:creator><![CDATA[Lcarpenter]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 20:20:25 GMT</pubDate>
            <atom:updated>2023-10-12T22:35:40.207Z</atom:updated>
            <content:encoded><![CDATA[<p>Heatmaps are undoubtedly a great way to explore and understand a dataset, clearly showing the strength of the correlation across all of the combinations of numeric columns. However, a brilliant feature of data visualisation libraries can be a correlation heatmap’s worst enemy!</p><p>Dynamic Axes in visualisation tools ensure that your axis matches your data. Take a look at the Heatmap below — of course we have a correlation of 1 across the diagonal… It also looks like we have some strong negative correlations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*C4sfR3g1gmVdIlKlQQCN0Q.png" /></figure><p>Let’s take a look again with the annotations and scale back in.</p><p>This time we can see that our correlations are not strong at all. The dynamic nature of the axis means that it’s adjusted to our data — and the darkest blue colour is simply the min value. Quite misleading and means that multiple heatmaps with axis like this couldn’t be compared with each other — since the colouring is based on the min correlation value of each dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*XKxi1Nd0EBoEuvyJuLpL7w.png" /></figure><p>Fortunately, it’s very easy to specify the axis — or “fix” the axis so that it’s always the consistent scale possible within correlations -1 to 1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*4LI0pVjU0RVk1SjE6LzvNg.png" /></figure><p>Now we can clearly see that we have no strong correlations at all in this dataset — a much more honest representation of the data!</p><p>Fortunately, the code is very simple:</p><h3><strong>Seaborn </strong>(The library used to present the graphics in this post)</h3><p>With seaborn we just have two arguments to add to the heatmap method— vmin and vmax, by setting these to -1 and 1 respectively we’ll have our fixed axis.</p><pre>plt.figure(figsize=(10, 8))<br>sns.heatmap(correlation_matrix, annot=True, cmap=&#39;coolwarm&#39;, vmin=-1, vmax=1)<br>plt.title(&quot;Heatmap of Correlation Matrix with Fixed Axis&quot;)<br>plt.show()</pre><h3><strong>Matplotlib</strong></h3><p>Heatmaps are a little less intuitive in Matplotlib, but the arguments — vmin and vmax are the same. Adding the annotations in Matplotlib is much trickier, so seaborn is the recommended library.</p><pre>plt.figure(figsize=(10, 8))<br>plt.imshow(correlation_matrix, cmap=&#39;coolwarm&#39;, vmin=-1, vmax=1)<br>plt.colorbar(label=&#39;Correlation Coefficient&#39;)<br>plt.title(&quot;Heatmap of Correlation Matrix with Fixed Axis using Matplotlib&quot;)<br>plt.show()</pre><h3><strong>Plotly</strong></h3><pre>import plotly.graph_objects as go<br>fig = go.Figure(data=go.Heatmap(<br>    z=correlation_matrix,<br>    colorscale=&#39;RdBu_r&#39;,  # Reversed colorscale<br>    zmin=-1,<br>    zmax=1<br>))<br><br># Fix the aspect ratio to be square and reverse the y-axis<br>fig.update_layout(<br>    autosize=False,<br>    width=500,<br>    height=500,<br>    margin=dict(t=50, b=50, l=50, r=50),<br>    xaxis=dict(scaleanchor=&quot;y&quot;, scaleratio=1),<br>    yaxis=dict(scaleanchor=&quot;x&quot;, scaleratio=1, autorange=&#39;reversed&#39;)  # Reverse y-axis<br>)<br><br>fig.show()</pre><h3>In Summary</h3><p>In the realm of data visualisation, the smallest details can significantly impact our understanding and interpretation of the data. As we’ve seen, dynamic axes in heatmaps, while useful in many scenarios, can be misleading when visualizing correlation matrices. By simply fixing the axis range, we ensure a consistent and honest representation of our data, allowing for accurate comparisons across different datasets. Whether you’re using Seaborn, Matplotlib, or Plotly, the steps to achieve this are straightforward. So, the next time you’re crafting a heatmap, remember to give your axis a quick check. It’s a simple step that can make a world of difference in conveying the true story behind your data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33659b328156" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>