<?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[ML Hobbyist - Medium]]></title>
        <description><![CDATA[Machine Learning and Data Science learning, practicing and enjoying. - Medium]]></description>
        <link>https://medium.com/ml-hobbyist?source=rss----35f56d839b94---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>ML Hobbyist - Medium</title>
            <link>https://medium.com/ml-hobbyist?source=rss----35f56d839b94---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 05:36:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/ml-hobbyist" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What Sherlock Holmes Can Teach Us About Large Language Models]]></title>
            <link>https://medium.com/ml-hobbyist/what-sherlock-holmes-can-teach-us-about-large-language-models-5a84ea5344a4?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/5a84ea5344a4</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Sun, 26 Jan 2025 02:39:42 GMT</pubDate>
            <atom:updated>2025-01-26T02:39:42.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k0TbraOT7Bh3teBIflvvlw.jpeg" /></figure><p>Large Language Models (LLMs) like GPT-4 can seem mystifying in their ability to process and generate human-like text. However, their fundamental principles can be understood through an unlikely source: a Sherlock Holmes story written over a century ago. In “<a href="https://en.wikipedia.org/wiki/The_Adventure_of_the_Dancing_Men">The Adventure of the Dancing Men</a>,” Holmes’s method of breaking a mysterious code provides a perfect metaphor for understanding how modern LLMs work.</p><h4>The Case Study: Dancing Men Cipher</h4><p>Our story begins when Hilton Cubitt, a Norfolk squire, visits Holmes with a peculiar problem. His wife, Elsie, has been deeply disturbed by mysterious stick figures appearing on their property. These figures, drawn in a dancing pose, look like innocent children’s drawings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cpyH_3h6PtiUxpTdlUHHWA.jpeg" /></figure><p>But they are far from innocent. Elsie’s reaction to these figures — turning pale and fainting at the sight of them — suggests they carry a sinister meaning. More messages keep appearing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*jnqWE-pjdZzdNzs5vaD2pA.jpeg" /></figure><p>What makes this case particularly intriguing is that Elsie, an American who married Cubitt after a whirlwind romance, had made her husband promise never to ask about her past. The dancing figures seem to be messages from that mysterious past, now threatening her present happiness.</p><p>Holmes approaches these childlike drawings as a sophisticated cipher, and his method of breaking this code provides us with a perfect framework for understanding how modern Large Language Models process and generate text. Just as these simple stick figures contain complex encoded messages, the seemingly magical abilities of LLMs can be understood through fundamental principles of pattern recognition and contextual analysis.</p><p>Let’s examine how Holmes methodically breaks this cipher, and see how each step parallels the functioning of modern language models:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*zaeOgEtrjd2zzsTidfkyaA.jpeg" /><figcaption>How Sherlock solved the dancing men mystery and their LLM parallel</figcaption></figure><h4>Lesson 1: The Power of Training Data</h4><p>Before Holmes even begins to decode the dancing men, he mentions that he’s familiar with 160 different ciphers. This is his “training data” — the foundation of knowledge he brings to the problem. Similarly, LLMs start with extensive training on vast amounts of text data.</p><h4>Lesson 2: Probability and Frequency Analysis</h4><p>Holmes’s first breakthrough comes from a basic principle: “E is the most common letter in the English alphabet.” When he sees a symbol appear four times in a fifteen-character message, he deduces it likely represents ‘E’.</p><p>This teaches us two fundamental concepts about LLMs:<br>1. Base probability distributions (which tokens appear most frequently)<br>2. Contextual frequency analysis (how often patterns appear in specific contexts)</p><h4>Lesson 3: Context Is Everything</h4><p>Watch how Holmes progresses after finding ‘E’:</p><p>1. He looks for a pattern: two ‘E’s with three letters between them<br>2. He guesses this might spell “ELSIE” (the wife’s name)<br>3. Once confirmed, he uses these new letters to decode more of the message</p><p>This perfectly illustrates how LLMs use context windows and attention mechanisms:</p><p><strong>Original</strong>: “<em>.M .ERE ..E SL.NE.”</em><br><strong>Context</strong>: <em>Known patterns + Surrounding letters</em><br><strong>Result</strong>: “<em>AM HERE ABE SLANEY”</em></p><h4>Lesson 4: Iterative Refinement</h4><p>Holmes doesn’t decode the message all at once. He:<br>1. Starts with high-probability guesses (‘E’)<br>2. Uses confirmed letters to make new predictions<br>3. Cross-references patterns across multiple messages<br>4. Builds confidence through consistent results</p><p>This mirrors how LLMs:<br>1. Begin with token probability distributions<br>2. Use attention to weight different contexts<br>3. Apply learned patterns to new situations<br>4. Refine predictions through multiple layers</p><h4>Lesson 5: Generation From Understanding</h4><p>Perhaps the most impressive part comes when Holmes creates his own message using the dancing men code to trap the culprit. This demonstrates the same principle that allows LLMs to not just understand but generate text:<br>- Understanding the patterns deeply enough to reproduce them<br>- Maintaining consistency with learned rules<br>- Generating contextually appropriate responses</p><h4>Understanding LLM Limitations Through Holmes</h4><p>Holmes’s method also helps us understand LLM limitations:</p><p>1. <strong>Context Length</strong><br> — Holmes needs enough examples to break the code<br> — LLMs have fixed context window sizes</p><p>2. <strong>Pattern Dependence</strong><br> — Holmes relies on standard English patterns<br> — LLMs can struggle with highly unusual or novel content</p><p>3. <strong>Statistical vs. Semantic Understanding</strong><br> — Holmes decodes meaning through patterns, not true understanding<br> — LLMs predict tokens based on statistical patterns, not genuine comprehension</p><h4>Practical Applications of These Lessons</h4><p>Understanding these parallels helps us better utilize LLMs:</p><p>1. <strong>Input Quality</strong><br> — Just as Holmes needs clear examples, LLMs need well-formed inputs<br> — Garbage in, garbage out applies to both</p><p>2. <strong>Context Matters</strong><br> — Provide relevant context in your prompts<br> — Structure inputs to maximize pattern recognition</p><p>3. <strong>Iterative Refinement</strong><br> — Use multiple steps for complex tasks<br> — Build upon successful patterns</p><h4>Conclusion</h4><p>Through Holmes’s methodical approach to the dancing men cipher, we can understand the core principles behind modern LLMs. While today’s AI systems process billions of parameters instead of dozens of characters, they follow remarkably similar principles to those employed by the Victorian detective:<br>- Pattern recognition<br>- Statistical analysis<br>- Context consideration<br>- Iterative refinement</p><p>The next time you’re working with an LLM, think of Holmes studying his dancing men. Understanding these fundamental principles can help you better harness the power of modern language models, making the seemingly magical become, as Holmes would say, “elementary.”</p><p><em>Note: This article uses a simplified analogy to explain complex AI concepts. While the parallels are instructive, modern LLMs involve many additional layers of complexity and mathematical operations beyond what’s discussed here.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a84ea5344a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/what-sherlock-holmes-can-teach-us-about-large-language-models-5a84ea5344a4">What Sherlock Holmes Can Teach Us About Large Language Models</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Streamlit App on Google Cloud Platform: App Engine vs. Cloud Run]]></title>
            <link>https://medium.com/ml-hobbyist/deploying-a-streamlit-app-on-google-cloud-platform-app-engine-vs-cloud-run-1625232d0363?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/1625232d0363</guid>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[app-engine]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[streamlit]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 08:06:29 GMT</pubDate>
            <atom:updated>2023-04-10T08:05:54.697Z</atom:updated>
            <content:encoded><![CDATA[<p>Author: Ali Shahed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Vx7e3Rt_q-Od4NZvkaH13w.png" /></figure><h3>Introduction</h3><p>Streamlit is an open-source Python library that simplifies the process of creating custom web applications for data science and machine learning. In this article, we’ll guide you through deploying a Streamlit app on Google Cloud Platform (GCP) using two popular compute services: App Engine and Cloud Run. By the end, you’ll understand the key differences between the two services and how to deploy a simple Streamlit app to both.</p><h3>App Engine Deployment</h3><p>App Engine is a fully managed Platform as a Service (PaaS) that allows developers to build and deploy applications without worrying about infrastructure management. It supports various runtime environments, including Python.</p><ul><li><strong>Install the required tools:</strong></li></ul><ol><li>Install the Google Cloud SDK: <a href="https://cloud.google.com/sdk/docs/install">https://cloud.google.com/sdk/docs/install</a></li></ol><p>2. Install Streamlit: pip install streamlit</p><ul><li><strong>Create a Streamlit app:</strong></li></ul><p>Write a simple Streamlit app and save it as app.py:</p><pre>import streamlit as st<br><br>st.title(&quot;Hello, Streamlit on App Engine!&quot;)<br>st.write(&quot;This is a simple Streamlit app running on Google App Engine.&quot;)</pre><ul><li><strong>Create an </strong><strong>app.yaml configuration file:</strong></li></ul><pre>runtime: python39<br><br>entrypoint: streamlit run app.py --server.enableCORS false --browser.serverAddress 0.0.0.0 --browser.gatherUsageStats false --server.port $PORT</pre><ul><li><strong>Deploy the app to App Engine:</strong></li></ul><ol><li>Authenticate with Google Cloud: gcloud auth login</li><li>Initialize your project: gcloud init</li><li>Deploy the app: gcloud app deploy</li></ol><ul><li><strong>Access the app:</strong></li></ul><p>Run gcloud app browse to open your app in a browser.</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nh1owl6a3HdaRB_Y0y04pw.png" /></a></figure><h3>Cloud Run Deployment</h3><p>Cloud Run is a managed Containers as a Service (CaaS) platform that lets you run stateless containers on a fully managed environment. It supports any language or framework packaged in a Docker container.</p><ul><li><strong>Install the required tools:</strong></li></ul><ol><li>Install the Google Cloud SDK: <a href="https://cloud.google.com/sdk/docs/install">https://cloud.google.com/sdk/docs/install</a></li><li>Install Docker: <a href="https://docs.docker.com/get-docker/">https://docs.docker.com/get-docker/</a></li><li>Install Streamlit: pip install streamlit</li></ol><ul><li><strong>Create a Streamlit app:</strong></li></ul><p>Follow the same steps as in the App Engine deployment.</p><ul><li><strong>Create a </strong><strong>Dockerfile:</strong></li></ul><pre>FROM python:3.9-slim<br><br>WORKDIR /app<br><br>COPY requirements.txt .<br>RUN pip install -r requirements.txt<br><br>COPY . .<br><br>CMD [&quot;streamlit&quot;, &quot;run&quot;, &quot;app.py&quot;, &quot;--server.enableCORS&quot;, &quot;false&quot;, &quot;--browser.serverAddress&quot;, &quot;0.0.0.0&quot;, &quot;--browser.gatherUsageStats&quot;, &quot;false&quot;, &quot;--server.port&quot;, &quot;8080&quot;]</pre><p>Also, create a requirements.txt file containing streamlit.</p><ul><li><strong>Build and deploy the container to Cloud Run:</strong></li></ul><ol><li>Authenticate with Google Cloud: gcloud auth login</li><li>Initialize your project: gcloud init</li><li>Build the container: gcloud builds submit --tag gcr.io/PROJECT-ID/streamlit-app</li><li>Deploy the container: gcloud run deploy --image gcr.io/PROJECT-ID/streamlit-app --platform managed --allow-unauthenticated</li></ol><ul><li><strong>Access the app:</strong></li></ul><p>The deployment output will display the URL of your app.</p><h3>Conclusion</h3><p>In this article, we showed you how to deploy a Streamlit app to both App Engine and Cloud Run on the Google Cloud Platform. While App Engine is a PaaS suitable for web applications with built-in support for specific runtime environments, Cloud Run is a CaaS platform that offers more flexibility and can run any language or framework packaged in a Docker container. The choice between App Engine and Cloud Run depends on your application’s requirements, preferred development tools, and desired level of infrastructure management. With this guide, you can now deploy a Streamlit app to either service and make the best choice for your needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1625232d0363" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/deploying-a-streamlit-app-on-google-cloud-platform-app-engine-vs-cloud-run-1625232d0363">Deploying a Streamlit App on Google Cloud Platform: App Engine vs. Cloud Run</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Visualization Using Natural Language Prompt Powered by ChatGPT]]></title>
            <link>https://medium.com/ml-hobbyist/data-visualization-using-natural-language-prompt-powered-by-chatgpt-d615b7f711cb?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/d615b7f711cb</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[natural-language]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Sun, 02 Apr 2023 06:55:39 GMT</pubDate>
            <atom:updated>2023-04-02T06:55:11.364Z</atom:updated>
            <content:encoded><![CDATA[<h4>Discover how natural language inputs can transform the way you create graphs from .csv datasets</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FDc4cXm-T2A0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDc4cXm-T2A0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FDc4cXm-T2A0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/038271814a8e2c8209acde7890dc05c6/href">https://medium.com/media/038271814a8e2c8209acde7890dc05c6/href</a></iframe><h3>Introduction</h3><p>Data visualization is essential for effectively communicating insights and trends hidden within large datasets. However, the process of creating graphs can be time-consuming and requires coding skills or the mastery of specific tools. This can be a significant barrier for many individuals, particularly those without a technical background.</p><p>Enter a game-changing solution: an app that leverages the <strong>power of ChatGPT to generate graphs using natural language inputs</strong>. This user-friendly app allows anyone to create stunning visualizations from .csv datasets with just a few simple English queries.</p><p>In this article, we’ll explore how this breakthrough tool works, its features, and its benefits to students, researchers, data analysts, and anyone interested in visualizing data.</p><h3>How the App Works</h3><ol><li><strong>Uploading a .csv dataset:</strong> The app allows users to upload a .csv file directly into the interface. Once uploaded, the dataset is processed, and users can generate graphs using natural language inputs.</li><li><strong>Generating graphs with natural language queries:</strong> By entering simple English queries, users can create various types of graphs, such as bar charts, pie charts, line graphs, and scatter plots. The ChatGPT 3.5 API intelligently interprets these queries and generates the desired visualizations.</li><li><strong>Customizing and exporting visualizations:</strong> Users can easily customize the generated graphs by tweaking the query or providing additional information. Once satisfied with the visualization.</li></ol><h3>Features and Benefits</h3><ol><li><strong>Seamless integration with ChatGPT 3.5 API:</strong> The app’s seamless integration with the ChatGPT 3.5 API enables it to understand and process natural language inputs efficiently. This makes it incredibly easy to generate graphs without having to write a single line of code or use complex tools.</li><li><strong>Time-saving and efficient:</strong> By leveraging the power of natural language processing, the app significantly reduces the time and effort required to create visualizations. Users can now generate graphs in a matter of seconds, streamlining their data analysis process.</li><li><strong>Supports various graph types:</strong> The app supports a wide range of graph types, including bar charts, pie charts, line graphs, and scatter plots. This versatility allows users to create the most appropriate visualization for their specific dataset and analysis needs.</li></ol><p><strong>Conclusion</strong></p><p>Using natural language for data visualization is a game-changer in the world of data visualization. It breaks down barriers and democratizes data visualization for everyone.</p><p>Whether you’re a student, researcher, or data enthusiast, this app shows you the potential of ChatGPT which can revolutionize the way you visualize and communicate insights from your data.</p><p>Also, remember! If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WoUhsG8R9J6EdKlrPu2Dww.png" /></a></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tJ7rbBt9QNXVnMilUeeQg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d615b7f711cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/data-visualization-using-natural-language-prompt-powered-by-chatgpt-d615b7f711cb">Data Visualization Using Natural Language Prompt Powered by ChatGPT</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[European Soccer League Results App With Streamlit (Part 2)]]></title>
            <link>https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-2-29632cce9192?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/29632cce9192</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Thu, 23 Mar 2023 00:04:14 GMT</pubDate>
            <atom:updated>2023-03-23T00:30:03.884Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to deploy the app on the streamlit community cloud</h4><p>Author: Ali Shahed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*SiwTJAmyFG4jQvY01x_RPw.png" /></figure><p>If you have followed <a href="https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-1-742891f753dc">part 1 of this article</a>, you should have the Streamlit app running locally on your computer. In this article, we go one step further and describe the steps that you need to take to deploy your app on <a href="https://streamlit.io/cloud">Streamlit community cloud</a> service and share the app with the public. These are the steps you need to deploy your app:</p><ol><li>Create a GitHub repository and host your codebase there.</li><li>Connect your GitHub repository to the Streamlit community cloud.</li></ol><p><strong>Bonus</strong>: Here is <a href="https://alishahed-european-league-analysis-european-league-app-sib244.streamlit.app/">my version of the app</a> that I have already deployed to Streamlit Community Cloud.</p><h3>Create your Github repository (Mac os)</h3><p>Here we go through the steps that you need to follow in order to create a git repository and place your code there. For more info on Github and its basic operations, you can check my article <a href="https://medium.com/ml-hobbyist/essential-git-and-github-for-the-beginners-b61312e59826"><strong>Essential Git and Github for Beginners</strong></a> .</p><ul><li>First, make sure you have Git installed on your Mac. If not, you can download and install it from <a href="https://git-scm.com/download/mac">https://git-scm.com/download/mac</a>.</li><li>Open Terminal on your Mac.</li><li>Navigate to the directory where you have saved the project. Assume, your directory name is “European_league_streamlit_app” under “Desktop”, you should type this command:</li></ul><pre>cd ~/Desktop/Eropean_league_streamlit_app</pre><ul><li>Now, initialize the Git repository on your local directory:</li></ul><pre>git init</pre><ul><li>Configure your Git identity (if you haven’t already), and replace “Your Name” and “<a href="/service/mailto:youremail@example.com">youremail@example.com</a>” with your actual information:</li></ul><pre>git config --global user.name &quot;Your Name&quot;<br>git config --global user.email &quot;youremail@example.com&quot;</pre><ul><li>Stage and commit all the codes that you have in the directory with the message “initial commit”.</li></ul><pre>git add .<br>git commit -m &quot;Initial commit&quot;</pre><p>Note that in the original codes that you have copied from my Github, there is a file “.gitignore”. You can write the names of files that you don’t want to be pushed to Github. For example, we need the file “secrets.toml” in this file as all the API keys from GCP are saved there.</p><ul><li>Go to GitHub (<a href="https://github.com/">https://github.com</a>) and sign in to your account.</li><li>Click the “+” icon in the upper right corner, and select “New repository”.</li><li>Enter a name for your repository, choose its visibility (public or private), and click “Create repository”.</li><li>On the new repository page, you’ll see a section called “…or push an existing repository from the command line”. Copy the URL provided under that section (it should look like “<a href="https://github.com/username/repository_name.git">https://github.com/username/repository_name.git</a>&quot;). Where “username” is your username and “repository name” is the name that you chose for your repository.</li><li>Add the remote GitHub repository URL to your local repository:</li></ul><pre>git remote add origin https://github.com/username/repository_name.git</pre><ul><li>Push your local changes to the remote repository:</li></ul><pre>git push -u origin master</pre><p>If you have <a href="https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication">enabled two-factor authentication for your GitHub</a> account, you might need to generate a personal access token and use it as your password when prompted.</p><p>Now your local code has been pushed to the GitHub repository and you should see the app code in your GitHub repository.</p><h3>Connect GitHub repository to the Streamlit community cloud</h3><p>Now that you have the code in Github, you need to let Streamlit community cloud know about it. Here are the steps you need to follow.</p><ul><li>Go to the Streamlit community cloud page and log in to your account. (If you don’t have an account you need to create one.)</li><li>When you log in, you see a page like this ( I have a couple of apps there. Yours will be empty.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M9P0L5qkvuuW0xCUE8V3_g.jpeg" /></figure><ul><li>Click on the “New app” button. A form pops up.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zo7nZv7A5OjMJqMhPBJZWg.jpeg" /></figure><ul><li>Copy and paste your repository link from Github, its branch, and the main file path into the form. ( In your case the main file is “<em>european_league_app.py</em>”)</li><li>DON’T PRESS THE “DEPLOY!” BUTTON YET! we need to add the secret information too. For that click on “Advanced settings…”. Another form pops up…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvZZQtf0ba8wBrmVz9Q9_w.jpeg" /></figure><ul><li>Now, copy and paste all the lines from the file “<em>secrets.toml</em>” to the form and click save.</li><li>You can safely press “Deploy!” now. Wait for a while and your app is now deployed. Enjoy!</li><li><strong>Bonus point</strong>: After deployment, you can switch the visibility of your app between private and public by clicking on the vertical ellipsis which opens the menu, and going to “setting”. In sharing menu there you can change the visibility of your app.</li></ul><p>If you like this article and want to see more, click on the banner below and buy me a coffee so I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCQqlZr6doDP-cszzpaSpw.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29632cce9192" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-2-29632cce9192">European Soccer League Results App With Streamlit (Part 2)</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Learning AI: Essential Topics and Study Tips]]></title>
            <link>https://medium.com/ml-hobbyist/a-beginners-guide-to-learning-ai-essential-topics-and-study-tips-ce2f0c832add?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/ce2f0c832add</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 00:55:54 GMT</pubDate>
            <atom:updated>2023-03-15T20:44:56.910Z</atom:updated>
            <content:encoded><![CDATA[<h4>Author: Ali Shahed</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*J7XyxB0qlsLjMYsGngiYUw.png" /><figcaption>“young person climbing a ladder toward the sun in the style of van Gogh” created by the stable diffusion model in Canva</figcaption></figure><h3>Introduction</h3><p>Artificial Intelligence (AI) is a rapidly evolving field that deals with the development of intelligent machines capable of performing tasks that normally require human intelligence. As a beginner, having a strong foundation in <strong>high school mathematics</strong> and a <strong>basic understanding of the Python programming language</strong> is a great start. In this article, we will discuss essential topics you need to study to build a solid foundation in AI, as well as some study tips to help you learn effectively.</p><h3>Linear Algebra</h3><p>Linear algebra is a cornerstone of AI, as it provides the mathematical framework for dealing with vectors, matrices, and systems of linear equations. It is fundamental to many AI concepts, including data representation, neural networks, and computer graphics.</p><h4>Key topics to study:</h4><ul><li>Scalars, vectors, and matrices</li><li>Matrix operations (addition, subtraction, multiplication, and inversion)</li><li>Vector spaces, basis, and linear independence</li><li>Eigenvalues and eigenvectors</li></ul><h4>References:</h4><p><strong>Books:</strong></p><p><em>a. “</em><a href="https://math.mit.edu/~gs/learningfromdata/"><em>Linear Algebra and Learning from Data</em></a><em>” by Gilbert Strang</em></p><p>This book, written by a renowned mathematician, provides a comprehensive introduction to linear algebra with a focus on its applications in machine learning and data science.</p><p><em>b. “</em><a href="https://www.deeplearningbook.org/"><em>Deep Learning</em></a><em>” by Ian Goodfellow, Yoshua Bengio, and Aaron Courville</em></p><p>Although this book primarily focuses on deep learning, it contains an excellent chapter on linear algebra that covers the essential concepts required for machine learning.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://ocw.mit.edu/courses/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/"><em>Matrix Methods In Data Analysis, Signal Processing, And Machine Learning</em></a><em>”</em><a href="https://ocw.mit.edu/courses/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/pages/syllabus/"><em> </em></a><em>(MIT OpenCourseWare)</em></p><p>This free online course is based on Prof. Strang’s book, “Linear Algebra and Learning from Data.” The lectures are available on MIT OpenCourseWare and provide an excellent foundation for learning linear algebra with a focus on machine learning.</p><p><em>b. “</em><a href="https://www.coursera.org/learn/linear-algebra-machine-learning"><em>Mathematics for Machine Learning: Linear Algebra</em></a><em>“ by Imperial College London (Coursera)</em></p><p>This course, offered by Imperial College London on Coursera, covers the essential concepts of linear algebra and their applications in machine learning. It includes interactive examples and practical exercises to reinforce learning.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. </em><a href="https://www.3blue1brown.com/lessons/eola-preview"><em>3Blue1Brown’s Essence of Linear Algebra</em></a><em> playlist</em></p><p>Grant Sanderson’s 3Blue1Brown channel offers a visually engaging series on the fundamental concepts of linear algebra. Although it doesn’t specifically target machine learning, intuitive explanations, and visualizations help build a strong foundation in linear algebra.</p><p><em>b. </em><a href="https://www.khanacademy.org/math/linear-algebra"><em>Khan Academy’s Linear Algebra course</em></a></p><p>Khan Academy provides a comprehensive series of videos covering linear algebra topics. While it doesn’t focus exclusively on machine learning, it serves as an excellent resource to solidify your understanding of core concepts.</p><p>If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RdraXTBOUakuiEO9.png" /></a></figure><h3>Calculus</h3><p>Calculus is essential for understanding how AI algorithms work, especially when it comes to optimization and machine learning. It helps to model and solve real-world problems by analyzing the change and motion of functions.</p><h4>Key topics to study:</h4><ul><li>Limits, continuity, and differentiability</li><li>Derivatives (single and multivariable)</li><li>Integration (single and multivariable)</li><li>Partial derivatives and gradients</li><li>Optimization and convexity</li></ul><h4>References</h4><p><strong>Books:</strong></p><p><em>a. </em><a href="https://a.co/d/2aFoVaz"><em>Mathematics for Machine Learning</em></a><em>” by Marc Peter Deisenroth, A. Aldo Faisal, and Cheng Soon Ong</em></p><p>This book provides a comprehensive introduction to the mathematical concepts required for machine learning, including a thorough treatment of calculus. It covers both single-variable and multivariable calculus, along with their applications in machine learning.</p><p><strong>Online Courses:</strong></p><p><em>a. </em><a href="https://www.coursera.org/learn/multivariate-calculus-machine-learning"><em>Mathematics for Machine Learning: Multivariate Calculus by Imperial College London</em></a><em> (Coursera)</em></p><p>This course, offered by Imperial College London on Coursera, covers multivariable calculus and its applications in machine learning. The course includes interactive examples and practical exercises to reinforce learning.</p><p><em>b. “</em><a href="https://ocw.mit.edu/courses/18-01sc-single-variable-calculus-fall-2010/"><em>MIT Single Variable Calculus</em></a><em>” and “</em><a href="https://ocw.mit.edu/courses/18-02sc-multivariable-calculus-fall-2010/"><em>MIT Multivariable Calculus</em></a><em>” (MIT OpenCourseWare)</em></p><p>While these courses are not specifically designed for machine learning, they provide a solid foundation in calculus, which you can then apply to machine learning. The lectures are available for free on MIT OpenCourseWare.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. </em><a href="https://www.khanacademy.org/math/calculus-all-old"><em>Khan Academy’s “Calculus”</em></a><em> playlist</em></p><p>Khan Academy offers a comprehensive series of videos covering single-variable and multivariable calculus. Although not specifically targeted at machine learning, these videos will help you build a strong foundation in calculus.</p><p><em>b. </em><a href="https://www.youtube.com/@ProfessorLeonard/playlists"><em>Professor Leonard’s</em></a><em> “Calculus 1,” “Calculus 2,” and “Calculus 3” playlists</em></p><p>Professor Leonard provides in-depth lectures on calculus, covering single-variable and multivariable concepts. While these playlists are not focused on machine learning, they will help you develop a strong understanding of calculus that can be applied to machine learning and AI.</p><h3>Probability and Statistics</h3><p>Probability and statistics play a vital role in AI, as they help in modeling uncertainty, making predictions, and evaluating the performance of algorithms. They are widely used in areas such as natural language processing, computer vision, and robotics.</p><h4>Key topics to study:</h4><ul><li>Probability theory (conditional probability, Bayes’ theorem, and probability distributions)</li><li>Descriptive statistics (mean, median, mode, variance, and standard deviation)</li><li>Inferential statistics (hypothesis testing, confidence intervals, and regression analysis)</li><li>Bayesian statistics and decision theory</li></ul><p><strong>Books:</strong></p><p><em>a. </em><a href="https://a.co/d/f6s8ys5"><em>“Pattern Recognition and Machine Learning”</em></a><em> by Christopher M. Bishop</em></p><p>This book provides an excellent introduction to probability theory and statistics in the context of machine learning. It covers various probability distributions, Bayesian methods, and statistical concepts relevant to machine learning.</p><p><em>b. “</em><a href="https://www.amazon.com/All-Statistics-Statistical-Inference-Springer/dp/1441923225"><em>All of Statistics: A Concise Course in Statistical Inference</em></a><em>” by Larry Wasserman</em></p><p>Although this book is not specifically targeted at machine learning, it provides a comprehensive introduction to statistics and is suitable for those who want to build a strong foundation in probability and statistical inference.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://www.coursera.org/learn/probability-statistics"><em>Probability and Statistics: To p or not to p?</em></a><em>” by the University of London (Coursera)</em></p><p>This course introduces the fundamental concepts of probability and statistics with a focus on their applications in data science and machine learning. It covers probability distributions, hypothesis testing, and Bayesian methods.</p><p><em>b. “</em><a href="https://www.edx.org/course/probability-and-statistics-in-data-science-using-p"><em>Probability and Statistics in Data Science using Python</em></a><em>” by UC San Diego (edX)</em></p><p>This course covers probability and statistics in the context of data science using Python. It discusses probability distributions, hypothesis testing, and Bayesian methods, which are essential for understanding machine learning algorithms.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. </em><a href="https://www.youtube.com/@statquest/featured"><em>StatQuest with Josh Starmer</em></a></p><p>This YouTube channel covers a wide range of probability and statistics topics, often with a focus on machine learning and data science applications. The videos provide intuitive explanations and visualizations, making complex concepts easier to understand.</p><p><em>b. </em><a href="https://www.khanacademy.org/math/statistics-probability"><em>Khan Academy’s “Statistics and Probability”</em></a><em> playlist</em></p><p>Khan Academy offers a comprehensive series of videos covering probability and statistics. Although not specifically targeted at machine learning, these videos will help you build a strong foundation in the essential concepts of probability and statistics.</p><h3>Algorithm Design and Analysis</h3><p>Efficient algorithms are crucial for solving complex AI problems. Studying algorithm design and analysis will provide you with a strong foundation in understanding, designing, and analyzing algorithms for various AI tasks.</p><h4>Key topics to study:</h4><ul><li>Time and space complexity analysis</li><li>Big O, Big Omega, and Big Theta notation</li><li>Basic data structures (arrays, linked lists, trees, and graphs)</li><li>Sorting algorithms (quicksort, mergesort, and heapsort)</li><li>Graph algorithms (breadth-first search, depth-first search, and shortest path algorithms)</li></ul><p><strong>Books:</strong></p><p><em>a. “</em><a href="https://a.co/d/iKwTUoY"><em>Introduction to Algorithms</em></a><em>” by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein</em></p><p>This classic textbook provides a comprehensive introduction to algorithms, data structures, and algorithm analysis. While not specifically focused on machine learning, it covers the essential concepts required to design and analyze algorithms for various AI tasks.</p><p><em>b. “</em><a href="https://www.amazon.com/Algorithms-4th-Robert-Sedgewick/dp/032157351X"><em>Algorithms</em></a><em>” by Robert Sedgewick and Kevin Wayne</em></p><p>This book covers a wide range of algorithms and data structures, along with their analysis and implementation. It serves as an excellent resource for building a strong foundation in algorithm design and analysis, which can then be applied to machine learning and AI.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://www.coursera.org/learn/algorithms-part1"><em>Algorithms, Part I</em></a><em>” and “</em><a href="https://www.coursera.org/learn/algorithms-part2"><em>Algorithms, Part II</em></a><em>” by Princeton University (Coursera)</em></p><p>These two courses, offered by Princeton University on Coursera, cover the essential concepts of algorithm design and analysis, along with their applications. While not specifically focused on machine learning, the courses provide a strong foundation in algorithms and data structures that can be applied to AI tasks.</p><p><em>b. “</em><a href="https://online.stanford.edu/courses/soe-ycsalgorithms1-algorithms-design-and-analysis-part-1"><em>Design and Analysis of Algorithms</em></a><em>” by Stanford University (Stanford Online)</em></p><p>This online course covers the design and analysis of various algorithms and data structures, with a focus on their applications in computer science. Although not specifically tailored for machine learning, the course will help you build a solid foundation in algorithm design and analysis.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. MIT OpenCourseWare’s “</em><a href="https://ocw.mit.edu/courses/6-046j-introduction-to-algorithms-sma-5503-fall-2005/"><em>Introduction to Algorithms (SMA 5503)</em></a><em>” playlist</em></p><p>This YouTube playlist contains video lectures from the MIT course based on the “Introduction to Algorithms” textbook. The lectures cover a wide range of algorithms, data structures, and analysis techniques, which are relevant to AI and machine learning applications.</p><p><em>b. Abdul Bari’s “</em><a href="https://www.youtube.com/@abdul_bari/featured"><em>Algorithms</em></a><em>” playlist</em></p><p>Abdul Bari’s YouTube channel provides a comprehensive series of videos covering various algorithms, data structures, and their analysis. The explanations are intuitive and easy to follow, making it an excellent resource for beginners.</p><h3>Machine Learning</h3><p>Machine learning is a subset of AI that enables computers to learn from data and improve their performance over time. It is widely used in applications such as image and speech recognition, natural language processing, and recommendation systems.</p><h4>Key topics to study:</h4><ul><li>Supervised learning (regression, classification, support vector machines, and decision trees)</li><li>Unsupervised learning (clustering, dimensionality reduction, and association rule learning)</li><li>Neural networks and deep learning (feedforward networks, convolutional neural networks, and recurrent neural networks)</li><li>Reinforcement learning</li><li>Model evaluation and validation</li></ul><p><strong>Books:</strong></p><p><em>a. “</em><a href="https://a.co/d/25nn9rw"><em>Machine Learning</em></a><em>” by Tom M. Mitchell</em></p><p>This classic textbook provides an introduction to the core concepts of machine learning, including various algorithms and techniques. It is suitable for beginners looking to build a strong foundation in machine learning.</p><p><em>b. “</em><a href="https://a.co/d/czeARcQ"><em>Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow</em></a><em>” by Aurélien Géron</em></p><p>This practical book offers a hands-on approach to learning machine learning by using popular Python libraries like Scikit-Learn, Keras, and TensorFlow. It covers a wide range of machine learning techniques, including deep learning and reinforcement learning.</p><p><em>c. “</em><a href="https://www.amazon.com/Pattern-Recognition-Learning-Information-Statistics/dp/0387310738"><em>Pattern Recognition and Machine Learning</em></a><em>” by Christopher M. Bishop</em></p><p>This comprehensive textbook covers various machine learning algorithms and techniques, with a focus on pattern recognition and probabilistic models. It is suitable for those looking to build a deep understanding of machine learning concepts.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://www.coursera.org/specializations/machine-learning-introduction"><em>Machine Learning</em></a><em>” by Andrew Ng (Coursera)</em></p><p>This popular course, offered by Stanford University on Coursera, provides an excellent introduction to machine learning. It covers various algorithms and techniques, including linear regression, logistic regression, neural networks, and support vector machines.</p><p><em>b. “</em><a href="https://www.coursera.org/specializations/deep-learning"><em>Deep Learning Specialization</em></a><em>” by Andrew Ng (Coursera)</em></p><p>This specialization, also offered by Stanford University on Coursera, focuses on deep learning techniques and their applications. It consists of five courses covering neural networks, convolutional neural networks (CNNs), recurrent neural networks (RNNs), and other advanced deep learning topics.</p><p><em>c. “</em><a href="https://www.coursera.org/learn/introduction-to-ai"><em>Introduction to Artificial Intelligence (AI)</em></a><em>” by IBM (Coursera)</em></p><p>This course provides an introduction to AI and covers various machine learning techniques, including supervised learning, unsupervised learning, and reinforcement learning. It also discusses AI applications in natural language processing and computer vision.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. Sentdex’s “</em><a href="https://www.youtube.com/@sentdex/featured"><em>Practical Machine Learning with Python</em></a><em>” playlist</em></p><p>This YouTube playlist provides a practical approach to learning machine learning using Python. It covers various machine learning algorithms and techniques, along with their implementation using popular Python libraries.</p><p><em>b. Google Cloud Platform’s “</em><a href="https://developers.google.com/machine-learning/crash-course"><em>Machine Learning Crash Course</em></a><em>”</em></p><p>This YouTube playlist, based on Google’s Machine Learning Crash Course, offers an introduction to machine learning concepts and TensorFlow, Google’s open-source machine learning library. The videos cover various machine learning techniques and their implementation using TensorFlow.</p><h3>Natural Language Processing</h3><p>Natural Language Processing (NLP) is a subfield of AI that deals with the interaction between computers and human language. NLP techniques are used in applications such as chatbots, sentiment analysis, and machine translation.</p><h4>Key topics to study:</h4><ul><li>Tokenization, stemming, and lemmatization</li><li>Part-of-speech tagging and dependency parsing</li><li>Word embeddings and language models (such as Word2Vec, GloVe, and BERT)</li><li>Sentiment analysis and text classification</li><li>Sequence-to-sequence models and attention mechanisms</li></ul><p><strong>Books:</strong></p><p><em>a. “</em><a href="https://a.co/d/3RATnAI"><em>Natural Language Processing with Python</em></a><em>” by Steven Bird, Ewan Klein, and Edward Loper</em></p><p>This book, also known as the “NLTK book,” provides an introduction to NLP using the Natural Language Toolkit (NLTK) library for Python. It covers various NLP techniques, including tokenization, stemming, part-of-speech tagging, parsing, and sentiment analysis.</p><p><em>b. “</em><a href="https://a.co/d/0HWEd2y"><em>Speech and Language Processing</em></a><em>” by Daniel Jurafsky and James H. Martin</em></p><p>This comprehensive textbook covers a wide range of NLP and speech-processing techniques, including syntax, semantics, pragmatics, dialogue, and information extraction. It provides a strong theoretical foundation for understanding the core concepts of NLP.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://www.coursera.org/learn/python-text-mining"><em>Applied Text Mining in Python</em></a><em>” by the University of Michigan (Coursera)</em></p><p>This course focuses on text mining techniques using Python and covers various NLP tasks, such as text preprocessing, classification, and sentiment analysis. It provides practical examples and exercises using popular Python libraries like NLTK and Scikit-Learn.</p><p><em>b. “</em><a href="https://www.coursera.org/specializations/natural-language-processing#courses"><em>Natural Language Processing Specialization</em></a><em>” by DeepLearning.AI (Coursera)</em></p><p>This specialization consists of four courses and covers various NLP techniques from pre-processing to training advanced models such as Transformers.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. Sentdex’s “</em><a href="https://youtube.com/playlist?list=PLQVvvaa0QuDf2JswnfiGkliBInZnIC4HL"><em>NLTK with Python 3 for Natural Language Processing</em></a><em>” playlist</em></p><p>This YouTube playlist offers a practical approach to learning NLP using Python and the NLTK library. It covers various NLP techniques, including tokenization, stemming, part-of-speech tagging, and sentiment analysis.</p><p><em>b. Siraj Raval’s “</em><a href="https://youtu.be/GazFsfcijXQ"><em>Natural Language Processing</em></a><em>” playlist</em></p><p>This YouTube playlist covers a variety of NLP topics and techniques, often with a focus on deep learning. The videos provide intuitive explanations and demonstrations using popular Python libraries and tools.</p><h3>Computer Vision</h3><p>Computer vision is another crucial subfield of AI that focuses on teaching computers to understand and interpret visual information from the world. It has applications in areas like object detection, facial recognition, and autonomous vehicles.</p><h4>Key topics to study:</h4><ul><li>Image processing techniques (histogram equalization, filtering, and edge detection)</li><li>Feature extraction and representation (SIFT, HOG, and ORB)</li><li>Object detection and recognition (R-CNN, YOLO, and SSD)</li><li>Image segmentation and classification (U-Net, Mask R-CNN, and ResNet)</li><li>Generative models (GANs and Variational Autoencoders)</li></ul><p><strong>Books:</strong></p><p><em>a. “</em><a href="https://a.co/d/cgM9qYz"><em>Computer Vision: Algorithms and Applications</em></a><em>” by Richard Szeliski</em></p><p>This comprehensive textbook covers a wide range of computer vision techniques, including image processing, feature extraction, and object recognition. It provides a strong theoretical foundation for understanding the core concepts of computer vision.</p><p><em>b. “</em><a href="https://pyimagesearch.com/deep-learning-computer-vision-python-book/"><em>Deep Learning for Computer Vision with Python</em></a><em>” by Adrian Rosebrock</em></p><p>This book focuses on computer vision techniques using deep learning and covers various algorithms and models, such as convolutional neural networks (CNNs), object detection, and image segmentation. It also provides hands-on examples using popular Python libraries like TensorFlow and Keras.</p><p><em>c. “</em><a href="https://a.co/d/gFELsHI"><em>Programming Computer Vision with Python</em></a><em>” by Jan Erik Solem</em></p><p>This practical book offers a hands-on approach to learning computer vision using Python. It covers various computer vision techniques, including image processing, feature extraction, and object recognition, along with their implementation using popular Python libraries like OpenCV.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://www.udacity.com/course/introduction-to-computer-vision--ud810"><em>Introduction to Computer Vision</em></a><em>” by Georgia Tech (Udacity)</em></p><p>This course provides an introduction to the essential concepts and techniques of computer vision, including image processing, feature extraction, and object recognition. It also offers hands-on experience using popular Python libraries like OpenCV.</p><p><em>b. “</em><a href="https://www.coursera.org/learn/convolutional-neural-networks?specialization=deep-learning"><em>Convolutional Neural Networks</em></a><em>” by Andrew Ng (Coursera)</em></p><p>This course, part of the Deep Learning Specialization, focuses on deep learning techniques for computer vision. It covers various algorithms and models, such as CNNs, object detection, and image segmentation, along with their applications in computer vision tasks.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. Sentdex’s “</em><a href="https://youtube.com/playlist?list=PLQVvvaa0QuDeETZEOy4VdocT7TOjfSA8a"><em>Python Plays: Grand Theft Auto V</em></a><em>” playlist</em></p><p>This YouTube playlist offers a practical approach to learning computer vision using Python and OpenCV. The videos demonstrate how to use computer vision techniques to automate gameplay in the popular video game Grand Theft Auto V.</p><p><em>b. </em><a href="https://www.youtube.com/@TwoMinutePapers/featured"><em>Two Minute Papers</em></a></p><p>This YouTube channel covers a variety of AI topics, including computer vision and deep learning. The short videos provide intuitive explanations of recent research papers and breakthroughs in the field of computer vision.</p><h3>Ethics and AI Safety</h3><p>As AI becomes more pervasive in our lives, understanding the ethical implications and ensuring the safe development and deployment of AI systems is critical. It is essential to consider the potential biases, privacy concerns, and social impact of AI technologies.</p><h4>Key topics to study:</h4><ul><li>Bias and fairness in AI</li><li>Privacy and data protection</li><li>Explainability and interpretability of AI models</li><li>AI safety and robustness</li><li>Responsible AI development and deployment</li></ul><p><strong>Books:</strong></p><p><em>a. “</em><a href="https://a.co/d/3AGCe1y"><em>Weapons of Math Destruction: How Big Data Increases Inequality and Threatens Democracy</em></a><em>” by Cathy O’Neil</em></p><p>This book discusses the ethical implications of using data-driven algorithms, focusing on how they can exacerbate existing inequalities and biases in society.</p><p><em>b. “</em><a href="https://www.amazon.com/Artificial-Intelligence-Guide-Thinking-Humans/dp/0374257833"><em>Artificial Intelligence: A Guide for Thinking Humans</em></a><em>” by Melanie Mitchell</em></p><p>This book provides an accessible introduction to AI, with an emphasis on the ethical and societal implications of AI technologies.</p><p><em>c. “</em><a href="https://www.amazon.com/Human-Compatible-Artificial-Intelligence-Problem-ebook/dp/B07N5J5FTS"><em>Human Compatible: Artificial Intelligence and the Problem of Control</em></a><em>” by Stuart Russell</em></p><p>This book, written by a prominent AI researcher, addresses the long-term safety concerns of AI systems and proposes a new approach to building AI systems that are inherently safe and beneficial for humanity.</p><p><strong>Online Courses:</strong></p><p><em>a. “</em><a href="https://ethics-of-ai.mooc.fi/"><em>AI Ethics</em></a><em>” by the University of Helsinki (Elements of AI)</em></p><p>This course offers an introduction to the ethical considerations of AI, including transparency, fairness, and privacy. It also discusses potential strategies for ensuring the ethical development and deployment of AI systems.</p><p><em>b. “</em><a href="https://www.coursera.org/learn/ai-for-everyone"><em>AI For Everyone</em></a><em>” by Andrew Ng (Coursera)</em></p><p>While this course covers a broad range of AI topics, it also includes a module on AI ethics, discussing issues such as bias, fairness, and job displacement.</p><p><strong>YouTube Channels and Playlists:</strong></p><p><em>a. </em><a href="https://futureoflife.org/project/future-of-life-institute-podcast/"><em>AI Alignment Podcast</em></a></p><p>This podcast features interviews with leading AI researchers and ethicists, discussing topics such as AI safety, long-term strategy, and ethical considerations.</p><h4>Study Tips</h4><ol><li>Build a strong foundation: Focus on understanding the core concepts of each topic before moving on to advanced material.</li><li>Practice coding: Implement algorithms and models using Python to deepen your understanding and build practical skills.</li><li>Learn by doing: Work on real-world projects and participate in online competitions to apply your knowledge and improve your skills.</li><li>Be consistent: Allocate time regularly for learning and practicing AI concepts.</li><li>Seek help: Join online forums, attend workshops, and connect with peers to discuss and clarify your doubts.</li><li>Stay updated: The field of AI is rapidly evolving. Keep yourself informed about the latest research, breakthroughs, and tools by following AI blogs, podcasts, and conferences.</li><li>Network with professionals: Connect with experts and professionals in the AI community to exchange ideas, gain insights, and learn about job opportunities.</li><li>Collaborate on projects: Team up with like-minded individuals to work on AI projects, which will help you develop teamwork and problem-solving skills.</li><li>Online resources: Utilize free online resources, such as MOOCs, YouTube tutorials, and blog posts, to learn from experts in the field.</li></ol><h3>Conclusion</h3><p>Embarking on the journey to learn AI can be both exciting and challenging. By focusing on these essential topics and adopting effective study habits, you will develop a strong foundation in AI and be well-prepared to tackle more advanced concepts and applications. Remember that the key to success is persistence and a continuous desire to learn and grow. Good luck on your AI journey!</p><p>If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RdraXTBOUakuiEO9.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce2f0c832add" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/a-beginners-guide-to-learning-ai-essential-topics-and-study-tips-ce2f0c832add">A Beginner’s Guide to Learning AI: Essential Topics and Study Tips</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[European Soccer League Results App With Streamlit (Part 1)]]></title>
            <link>https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-1-742891f753dc?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/742891f753dc</guid>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[streamlit-app-deployment]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Sat, 04 Mar 2023 02:17:05 GMT</pubDate>
            <atom:updated>2023-03-23T00:26:58.228Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to setup and run a streamlit app locally</h4><p>Author: Ali Shahed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*SiwTJAmyFG4jQvY01x_RPw.png" /></figure><h3>Summary</h3><p>In this series of articles, we learn how to run a simple <a href="https://streamlit.io/">streamlit</a> data app locally and deploy the app in streamlit community cloud for everybody to use. I divided this article into two installments. In part 1, i.e this article, I describe how to set up your environment to run the European Soccer League Results App locally. In part 2, I will explain the steps that are needed to deploy the European Soccer League Results App to Streamlit Community Cloud for the public. <strong>Make sure to follow me to be notified when I publish part 2 of this article. (</strong><a href="https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-2-29632cce9192"><strong>Part 2 is here</strong></a><strong>)</strong></p><p><strong>Bonus</strong>: Here is <a href="https://alishahed-european-league-analysis-european-league-app-sib244.streamlit.app/">my version of the app</a> that I have already deployed to Streamlit Community Cloud.</p><h3>What do we need?</h3><ul><li><strong>An account in </strong><a href="https://streamlit.io/cloud"><strong>streamlit community cloud</strong></a><strong>: </strong>Streamlit is a popular open-source Python library that allows data scientists and developers to create and deploy web applications for machine learning and data science projects with ease. It provides a simple and intuitive way to create interactive dashboards, data visualizations, and other web-based applications. Streamlit Community Cloud is a platform that provides users with a powerful and scalable infrastructure to host and share Streamlit apps with others. We use Streamlit Community Cloud to host our app. It is not the only way to deploy streamlit app but it is the easiest one.</li><li><strong>A Github account: </strong>We use GitHub repository to host our code. Moreover, Streamlit Community Cloud has integration with GitHub that makes our app deployment straightforward. If you are not familiar with GitHub, check out my article titled “<a href="https://medium.com/ml-hobbyist/essential-git-and-github-for-the-beginners-b61312e59826"><strong>Essential Git and GitHub for Beginners</strong></a>”</li><li><strong>Python 3 and a virtual environment: </strong>We use python 3.6+ for our purpose. It is also highly recommended to use virtual environments especially when you are working on a number of projects with various library requirements. I use Pyenv + Virtualenv for managing python versions and virtualenvs. You can check my article titled “<a href="https://medium.com/ml-hobbyist/setup-your-python-projects-like-a-pro-with-pyenv-and-virtualenv-on-macos-b4048b4d0f20?source=user_profile---------2----------------------------"><strong>Setup your Python projects like a pro with Pyenv and Virtualenv on MacOS</strong></a>”. Of course, if you are using other tools, e.g. Conda, it is perfectly fine.</li><li><strong>Google Cloud Platform (GCP) Account (optional): </strong>I have used GCP bucket for hosting the datasets for the app. However, you can host it in AWS bucket or with the code in GitHub or even as a Google sheet in google drive. Check out all the options which are possible <a href="https://docs.streamlit.io/knowledge-base/tutorials/databases">here</a>.</li></ul><h3><strong>Hosting the datasets in GCP storage</strong></h3><ul><li>The datasets that we are using are the following two datasets. Download them to your computer.</li></ul><ul><li><a href="https://www.kaggle.com/datasets/vivovinco/20212022-football-team-stats">2021-2022 Football Team Stats</a></li><li><a href="https://www.kaggle.com/datasets/vivovinco/20222023-football-team-stats">2022-2023 Football Team Stats</a></li></ul><ul><li>Create a GCP account, create a project and a bucket in the project, and upload the <em>.csv</em> files into the created bucket. If you are new to GCP, check out the tutorial on how to do these steps in <a href="https://docs.streamlit.io/knowledge-base/tutorials/databases/gcs">Streamlit docs</a>.</li><li>Make sure to read the mentioned document and particularly <strong>remember to create the key file in .json format</strong> and save it somewhere on your computer that you can access later.</li></ul><h3>Download the code for the app from GitHub</h3><p>The code that I used to create the app is hosted in a public repository in my GitHub.</p><p><a href="https://github.com/Alishahed/european_league_analysis">GitHub - Alishahed/european_league_analysis</a></p><p>Download the code base to a place where you want to start your development. The file will be downloaded in <em>.zip</em> format and you need to extract it to the location of your choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2C2gJZrmFicN3GWu9T5Nw.gif" /></figure><h3>Set up your development environment</h3><p>I assume that you have already checked my tutorial that I mentioned in the summary and you have already installed pyenv and virtualenv as well as one of the 3.6+ python versions. The first step for us is to create a virtual environment. For that, you can run this line in CLI.</p><pre>pyenv virtualenv 3.8.12 ds_streamlit_3_8_12</pre><p>The above command creates a virtual environment named “ds_streamlit_3_8_12” which is based on the Python 3.8.12 . Then, we activate the virtual environment.</p><pre>pyenv activate ds_streamlit_3_8_12</pre><p>and you will see something like this</p><pre>ali@ali-System-Product-Name:~$ pyenv activate ds_streamlit_3_8_12 <br>pyenv-virtualenv: prompt changing will be removed from future release. <br>configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1&#39; to simulate the behavior.<br>(ds_streamlit_3_8_12) ali@ali-System-Product-Name:~$ <br></pre><p>The next step is to install the packages that are required for the app to run. You can run the following command to install all the required packages from the <em>requirements.txt</em> file that is in the downloaded repository.</p><pre>pip install -r requirements.txt</pre><p>One final step before you need to run the app locally is to add the “secrets file” to the app. This secret file host all the credentials that your app needs to read the datasets from GCP bucket. Create a folder named “<em>.streamlit” </em>in<em> </em>your app’s root directory and inside that directory create a file named “<em>._secrets.toml”. </em>Here, is an example of the <em>.toml </em>file. You need to feel out the “<em>xxx</em>” parts with the contents of your <em>.json</em> file.</p><pre># .streamlit/secrets.toml<br><br>[gcp_service_account]<br>type = &quot;service_account&quot;<br>project_id = &quot;xxx&quot;<br>private_key_id = &quot;xxx&quot;<br>private_key = &quot;xxx&quot;<br>client_email = &quot;xxx&quot;<br>client_id = &quot;xxx&quot;<br>auth_uri = &quot;https://accounts.google.com/o/oauth2/auth&quot;<br>token_uri = &quot;https://oauth2.googleapis.com/token&quot;<br>auth_provider_x509_cert_url = &quot;https://www.googleapis.com/oauth2/v1/certs&quot;<br>client_x509_cert_url = &quot;xxx&quot;</pre><p>Also, pay attention that in the downloaded codebase from GitHub there is a .gitignore file. We listed this .toml file there to make sure your GCP secrets won’t be uploaded to your codebase later.</p><p>After all these steps, your local file structure should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*zVzG70Pusz2kna_k9MJ_nQ.png" /></figure><p>Now you ready to run the app and see the result locally using this command.</p><pre>streamlit run european_league_app.py</pre><p>Congratulation! Your app now is running locally and you can see similar lines in your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gz6duh6ZlKiZ1mto0YawEg.png" /></figure><p>And this in your browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5Pi-dTQqb2SqcXtCBZF0g.png" /></figure><p>In the <a href="https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-2-29632cce9192">second part of this article</a>, I will describe the steps that are needed to deploy this app to Streamlit Community Cloud. Follow me (or even better, subscribe by email) not to miss the second part!</p><p>If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RdraXTBOUakuiEO9.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=742891f753dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/european-soccer-league-results-app-with-streamlit-part-1-742891f753dc">European Soccer League Results App With Streamlit (Part 1)</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential Git and GitHub for Beginners]]></title>
            <link>https://medium.com/ml-hobbyist/essential-git-and-github-for-the-beginners-b61312e59826?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/b61312e59826</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Sun, 26 Feb 2023 23:20:14 GMT</pubDate>
            <atom:updated>2023-03-15T20:43:25.178Z</atom:updated>
            <content:encoded><![CDATA[<h4>Authors: Ali Shahed, ChatGPT</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*niEpu8GBdJNB5DRX5I9m8g.png" /></figure><p>Why do we need yet another Git/GitHub tutorial? Well …for one because it is easy to create a proper one with the help of ChatGPT. Secondly, I wanted to write a Git/GitHub tutorial for whoever wants to follow my later tutorials on various topics and bring them up to speed really fast on this topic. Let me know … sorry!… Let us know how we did.</p><p>Now that we addressed this giant elephant in the room, let’s start the journey.</p><h3>Introduction</h3><p>GitHub is a popular platform for version control and collaboration on software projects. Whether you’re a beginner or an experienced developer, knowing how to use GitHub effectively can help you manage your code and collaborate with others more efficiently. In this article, we’ll go over the basics of how to work with GitHub, including how to clone, commit, push, pull, branch, and merge using the command line interface (CLI). If you are not comfortable using CLI, there are tools like <a href="https://desktop.github.com/">GitHub desktop</a>, <a href="https://www.sourcetreeapp.com/">Source Tree</a> or <a href="https://www.gitkraken.com/">GitKraken</a> that can provide you with smoother entry into Git and GitHub world with their graphical user interface.</p><h3>What is GitHub?</h3><p>GitHub is a web-based platform that provides version control for software development. It allows developers to host and review code, manage projects, and collaborate with other developers. GitHub uses Git, a popular version control system that helps developers keep track of changes to their code over time.</p><h3>Getting Started with GitHub</h3><p>To get started with GitHub, <strong>you’ll need to create an account on the GitHub website</strong>. Once you’ve created an account, you can create new repositories, clone existing repositories, and start collaborating with other developers.</p><p>Setting up GitHub account is fairly straight forward but in case you need help, you can check out one of the numerous tutorial on that subject, e.g. <a href="https://www.codecademy.com/article/how-to-set-up-a-github-account">this one</a>.</p><h3>Clone a Repository</h3><p>To clone a repository from GitHub to your local machine, you can use the “git clone” command. <strong>This command will create a copy of the repository on your local machine, which you can then modify and push changes back to GitHub</strong>.</p><p>For example, let’s say you want to clone the “hello-world” repository from GitHub. Here’s how you can do it:</p><pre>$ git clone https://github.com/username/hello-world.git</pre><h3>Commit Changes</h3><p>Once you’ve cloned a repository, you can start making changes to the code. <strong>When you’re ready to save your changes, you’ll need to commit them to the repository</strong>. To commit changes, you’ll need to stage your changes using the “git add” command, and then commit the changes using the “git commit” command.</p><p>For example, let’s say you’ve made changes to a file called “index.html” in your repository. Here’s how you can stage and commit your changes:</p><pre>$ git add index.html<br>$ git commit -m &quot;Updated index.html file&quot;</pre><h3>Push Changes</h3><p><strong>After you’ve committed your changes, you’ll need to push them back to the GitHub repository</strong>. This will update the code on GitHub with your changes.</p><p>For example, let’s say you’ve made changes to the “index.html” file and you want to push those changes back to the GitHub repository. Here’s how you can do it:</p><pre>$ git pull origin master</pre><p>This command will pull the changes from the “master” branch of the GitHub repository.</p><h3>Branching</h3><p><strong>Sometimes, you’ll want to work on a new feature or fix a bug without affecting the main codebase. In this case, you can create a new branch in the repository</strong>. A branch is a separate version of the codebase that you can modify independently of the main codebase.</p><p>To create a new branch in the repository, you can use the “git branch” command. For example, let’s say you want to create a new branch called “feature-branch” in your repository. Here’s how you can do it:</p><pre>$ git branch feature-branch</pre><p>To switch to the new branch, you can use the “git checkout” command. For example:</p><pre>$ git checkout</pre><p>Finally, you can see all the branches that you have in the repository using “git branch” for local branches,</p><pre>git branch</pre><p>For remote branches,</p><pre>git branch -r</pre><p>And finally, for all branches, local and remote,</p><pre>git branch -a</pre><h3>Merge Branches</h3><p><strong>Once you’ve made changes to a separate branch, you may want to merge those changes back into the main codebase</strong>. To merge branches, you can use the “git merge” command.</p><p>For example, let’s say you’ve made changes to the “feature-branch” branch and you want to merge those changes back into the main “master” branch. Here’s how you can do it:</p><pre>$ git checkout master<br>$ git merge feature-branch</pre><p>This command will switch your local machine back to the “master” branch and merge the changes from the “feature-branch” branch into the “master” branch.</p><h3>Conclusion</h3><p>In this article, we’ve gone over the basics of how to work with GitHub using the command line interface. We’ve covered how to clone repositories, commit changes, push changes back to GitHub, pull changes from GitHub, create and switch between branches, and merge branches. These are the essential Git commands that every developer should know when working with GitHub. By mastering these commands, you can effectively manage your code and collaborate with other developers on GitHub.</p><p>If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RdraXTBOUakuiEO9.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b61312e59826" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/essential-git-and-github-for-the-beginners-b61312e59826">Essential Git and GitHub for Beginners</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kings of Data App Building Tools: Streamlit vs Datapane]]></title>
            <link>https://medium.com/ml-hobbyist/kings-of-data-app-building-tools-streamlit-vs-datapane-f99fde9764f4?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/f99fde9764f4</guid>
            <category><![CDATA[application]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Mon, 20 Feb 2023 17:55:39 GMT</pubDate>
            <atom:updated>2023-03-15T20:42:41.178Z</atom:updated>
            <content:encoded><![CDATA[<p>Authors: Ali Shahed, ChatGPT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*qdfgWvWu0SfwXNxW6uq_vw.png" /></figure><p>Data is at the heart of many modern applications, and building data-driven apps has become a crucial skill for developers and businesses alike. However, building these apps from scratch can be a time-consuming and complicated process. Fortunately, there are many tools available that make it easier to build these apps quickly and efficiently. Two such tools are Streamlit and Datapane.</p><p><a href="https://streamlit.io/">Streamlit</a> and <a href="https://datapane.com/">Datapane</a> are both web-based tools that allow developers to build data-driven applications quickly and easily. However, they have different features, strengths, and weaknesses, and choosing the right tool for your project is essential. In this article, we will compare Streamlit and Datapane and provide examples of how to use these two tools.</p><h3>Streamlit: The Basics</h3><p>Streamlit is a popular open-source framework for building data applications. It allows developers to create interactive applications quickly and easily, with no frontend or backend coding required. With Streamlit, developers can create interactive data visualizations, data dashboards, and machine learning models.</p><p>One of the key strengths of Streamlit is its ease of use. It has a simple and intuitive interface, making it easy for developers to get started quickly. Additionally, Streamlit has a wide range of pre-built components and libraries, making it easy to add functionality to your app without having to write custom code.</p><h4>Examples of Using Streamlit</h4><ol><li>Visualizing Data: With Streamlit, you can quickly create interactive data visualizations. For example, you can create a scatter plot, line chart, or bar chart that updates in real-time as the user interacts with the data.</li><li>Data Dashboards: You can create interactive data dashboards that allow users to explore data and gain insights. For example, you can build a dashboard that shows key metrics for a business, such as revenue, profit, and customer engagement.</li><li>Machine Learning Models: Streamlit makes it easy to build and deploy machine learning models. For example, you can build a model that predicts housing prices based on a range of factors, such as location, square footage, and number of bedrooms.</li></ol><h3>Datapane: The Basics</h3><p>Datapane is a cloud-based data app builder that allows developers to create interactive data applications quickly and easily. With Datapane, developers can create interactive data visualizations, data dashboards, and machine learning models.</p><p>One of the key strengths of Datapane is its ability to handle large datasets. Datapane can handle datasets of up to 1GB, making it ideal for building applications that require large amounts of data. Additionally, Datapane has a wide range of pre-built components and templates, making it easy to create data applications quickly and efficiently.</p><h4>Examples of Using Datapane</h4><ol><li>Visualizing Data: With Datapane, you can create interactive data visualizations that allow users to explore data. For example, you can create a heatmap, scatter plot, or bar chart that updates in real-time as the user interacts with the data.</li><li>Data Dashboards: You can create interactive data dashboards that allow users to explore data and gain insights. For example, you can build a dashboard that shows key metrics for a business, such as revenue, profit, and customer engagement.</li><li>Machine Learning Models: Datapane makes it easy to build and deploy machine learning models. For example, you can build a model that predicts housing prices based on a range of factors, such as location, square footage, and number of bedrooms.</li></ol><h3>Comparing Streamlit and Datapane</h3><p>While both Streamlit and Datapane are great tools for building data-driven applications, they have different strengths and weaknesses. Here are some of the key differences between these two tools:</p><ol><li>Ease of Use: Streamlit has a simple and intuitive interface, making it easy for developers to get started quickly. Datapane, on the other hand, has a steeper learning curve and can be more complex to use.</li><li>Flexibility: Streamlit is more flexible than Datapane, as it allows developers to write their own custom code and create more complex applications. Datapane, on the other hand, is more focused on pre-built components and templates, making it easier to create simple applications quickly.</li><li>Data Handling: Datapane is better equipped to handle large datasets, while Streamlit may struggle with datasets that are too large. This is because Datapane uses cloud-based technology to handle data, while Streamlit relies on the resources of the machine it is running on.</li><li>Deployment: Streamlit is more flexible in terms of deployment, as it can be deployed on a wide range of platforms, including cloud services, virtual machines, and Docker containers. Datapane, on the other hand, is a cloud-based service that requires a subscription to use.</li></ol><p>When it comes to choosing between Streamlit and Datapane, it really depends on the specific needs of your project. If you need to handle large datasets or require a cloud-based solution, Datapane may be the better choice. If you require more flexibility and want to write custom code, Streamlit may be the better option.</p><h3>Conclusion</h3><p>In conclusion, both Streamlit and Datapane are excellent tools for building data-driven applications. They have different strengths and weaknesses, and choosing the right tool for your project is essential. With Streamlit, you can create interactive data visualizations, data dashboards, and machine learning models quickly and easily. With Datapane, you can create large-scale data applications that can handle large datasets. Regardless of which tool you choose, these platforms provide a great way to build powerful data applications with ease.</p><p>If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/700/0*RdraXTBOUakuiEO9.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f99fde9764f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/kings-of-data-app-building-tools-streamlit-vs-datapane-f99fde9764f4">Kings of Data App Building Tools: Streamlit vs Datapane</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup your Python projects like a pro with Pyenv and Virtualenv on MacOS]]></title>
            <link>https://medium.com/ml-hobbyist/setup-your-python-projects-like-a-pro-with-pyenv-and-virtualenv-on-macos-b4048b4d0f20?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/b4048b4d0f20</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Mon, 20 Feb 2023 16:47:54 GMT</pubDate>
            <atom:updated>2023-03-15T20:40:11.360Z</atom:updated>
            <content:encoded><![CDATA[<h4>Authors: Ali Shahed, ChatGPT</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*HdZ4v8oG6UEmLC9vsAy90w.png" /></figure><p><a href="https://www.python.org/">Python</a> is a popular programming language used in many industries such as data science, web development, and automation. As a Python developer, it’s essential to manage your project’s dependencies and virtual environments to avoid version conflicts and ensure a consistent development environment across your team. <a href="https://github.com/pyenv/pyenv">Pyenv</a> and <a href="https://virtualenv.pypa.io/en/latest/">virtualenv</a> are two tools that can help you do just that.</p><h3>Installing Pyenv</h3><p>Before we can start using Pyenv, we need to install it on our machine. We’ll be using <a href="https://brew.sh/">Homebrew</a>, a package manager for MacOS, to install Pyenv. Open your terminal and run the following commands:</p><pre>$ brew update<br>$ brew install pyenv</pre><p>This will install the latest version of Pyenv on your machine.</p><h3>Setup shell environment for Pyenv (from pyenv github)</h3><p>After installing Pyenv you need to setup your shell environment to work with pyenv too. Here, we directly use the steps that are explained in pyenv <a href="https://github.com/pyenv/pyenv#homebrew-in-macos">github instruction page</a>.</p><blockquote>For bash:</blockquote><blockquote>Stock Bash startup files vary widely between distributions in which of them source which, under what circumstances, in what order and what additional configuration they perform. As such, the most reliable way to get Pyenv in all environments is to append Pyenv configuration commands to both .bashrc (for interactive shells) and the profile file that Bash would use (for login shells).</blockquote><blockquote>First, add the commands to ~/.bashrc by running the following in your terminal:</blockquote><pre>echo &#39;export PYENV_ROOT=&quot;$HOME/.pyenv&quot;&#39; &gt;&gt; ~/.bashrc<br>echo &#39;command -v pyenv &gt;/dev/null || export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;&#39; &gt;&gt; ~/.bashrc<br>echo &#39;eval &quot;$(pyenv init -)&quot;&#39; &gt;&gt; ~/.bashrc</pre><blockquote>Then, if you have ~/.profile, ~/.bash_profile or ~/.bash_login, add the commands there as well. If you have none of these, add them to ~/.profile.</blockquote><blockquote>to add to ~/.profile:</blockquote><pre>echo &#39;export PYENV_ROOT=&quot;$HOME/.pyenv&quot;&#39; &gt;&gt; ~/.profile<br>echo &#39;command -v pyenv &gt;/dev/null || export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;&#39; &gt;&gt; ~/.profile<br>echo &#39;eval &quot;$(pyenv init -)&quot;&#39; &gt;&gt; ~/.profile</pre><blockquote>to add to ~/.bash_profile:</blockquote><pre>echo &#39;export PYENV_ROOT=&quot;$HOME/.pyenv&quot;&#39; &gt;&gt; ~/.bash_profile<br>echo &#39;command -v pyenv &gt;/dev/null || export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;&#39; &gt;&gt; ~/.bash_profile<br>echo &#39;eval &quot;$(pyenv init -)&quot;&#39; &gt;&gt; ~/.bash_profile</pre><blockquote>For Zsh:</blockquote><pre>echo &#39;export PYENV_ROOT=&quot;$HOME/.pyenv&quot;&#39; &gt;&gt; ~/.zshrc<br>echo &#39;command -v pyenv &gt;/dev/null || export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;&#39; &gt;&gt; ~/.zshrc<br>echo &#39;eval &quot;$(pyenv init -)&quot;&#39; &gt;&gt; ~/.zshrc</pre><blockquote>If you wish to get Pyenv in noninteractive login shells as well, also add the commands to ~/.zprofile or ~/.zlogin.</blockquote><h3>Using Pyenv to manage Python versions</h3><p>Once we have Pyenv installed, we can start using it to manage our Python versions. Pyenv allows us to install multiple Python versions and switch between them seamlessly. Let’s install Python 3.8.10 using Pyenv.</p><pre>$ pyenv install 3.8.10</pre><p>This will install Python 3.8.10 on your machine. You can verify that it’s installed by running the following command:</p><pre>$ pyenv versions<br>* system (set by /Users/username/.pyenv/version)<br>  3.8.10</pre><p>The * indicates the currently active Python version. You can switch to Python 3.8.10 by running the following command:</p><pre>$ pyenv global 3.8.10</pre><p>This will set Python 3.8.10 as the global version for your machine. You can verify that it’s set by running the following command:</p><pre>$ python --version<br>Python 3.8.10</pre><h3>Creating a virtual environment</h3><p>Virtualenv is a tool that allows users to create isolated Python environments for different projects. We’ll use Pyenv together with Virtualenv to create and manage virtual environments. To install Virtualenv, run the following command:</p><pre>pip install virtualenv</pre><p>This command will install Virtualenv on your machine.</p><p>To create a new virtual environment, run the following command:</p><pre>$ pyenv virtualenv &lt;python_version&gt; &lt;virtual_env_name&gt;</pre><p>For example, to create a virtual environment called “project1” using Python 3.8.10 , run the following command:</p><pre>pyenv virtualenv 3.8.10 project1</pre><p>This command will activate the virtual environment. You can verify that the virtual environment is active by checking the Python version:</p><pre>python --version</pre><p>This command will display the Python version installed in the virtual environment.</p><h3>Using Virtual Environments</h3><p>Once the virtual environment is activated, you can use pip to install packages specific to that environment. For example, to install the Numpy package, run the following command:</p><pre>pip install Numpy</pre><p>This command will install Numpy in the virtual environment.</p><p>To deactivate the virtual environment, run the following command:</p><pre>pyenv deactivate</pre><p>This command will deactivate the virtual environment.</p><h3>Switching between Virtual Environments</h3><p>To switch between virtual environments, you can use the following command:</p><pre>pyenv activate &lt;virtual_env_name&gt;</pre><p>For example, to activate the “project1” virtual environment, run the following command:</p><pre>pyenv activate project1</pre><p>This command will activate the “project1” virtual environment.</p><h3>Conclusion</h3><p>Using Pyenv and Virtualenv together is a powerful combination for managing Python projects. Pyenv allows you to install and switch between different versions of Python, while Virtualenv allows you to create isolated environments for each of your projects. By following these steps, you can easily manage your Python projects on your Mac.</p><p>If you buy me a coffee, I can work longer hours and create more content like this. Thank you!</p><figure><a href="https://www.buymeacoffee.com/drAliShahed"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tEuYZbZRIkPUieOP3nReNg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4048b4d0f20" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/setup-your-python-projects-like-a-pro-with-pyenv-and-virtualenv-on-macos-b4048b4d0f20">Setup your Python projects like a pro with Pyenv and Virtualenv on MacOS</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scraping Hacker News]]></title>
            <link>https://medium.com/ml-hobbyist/scraping-hacker-news-590fe119ef99?source=rss----35f56d839b94---4</link>
            <guid isPermaLink="false">https://medium.com/p/590fe119ef99</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[google-colaboratory]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[hacker-news]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ali Shahed]]></dc:creator>
            <pubDate>Mon, 27 Nov 2017 01:48:15 GMT</pubDate>
            <atom:updated>2017-11-27T01:51:28.216Z</atom:updated>
            <content:encoded><![CDATA[<h4>A simple python program</h4><p>Hacker News (HN) is a one of my major sources of information but it is also a major source of pain, specially if I want to follow a certain topic daily or weekly, e.g. driverless cars, I have to :</p><ul><li>First enter the query in the search box.</li><li>Order the query results by time.</li><li>Click on all links for multiple pages for each result and check the contents one-by-one.</li></ul><p>One rainy afternoon, I thought to myself: “There should be a better way!”. So, I turned on my coffee maker and by that evening, I wrote a notebook that does the following:</p><ol><li>Queries the <a href="https://news.ycombinator.com/">Hacker News</a> (HN) API with your query of choice.</li><li>Gets the links to the latest news on your query.</li><li>Scrapes the content of the links which are returned by HN API.</li><li>De-duplicates the content.</li><li>Saves all this information in an Excel file.</li></ol><p>You can access the Google C<a href="https://research.googleblog.com/2014/08/doing-data-science-with-colaboratory.html">olaboratory</a> * Notebook <a href="https://colab.research.google.com/notebook#fileId=1kXz0bN2CXK71hxvF_GCDs-cmGulBIBsa">here</a> and I’ll walk you through what it does!</p><h4><strong>Requirements</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a67aa20b0eeac2e4d078f47e8602d70c/href">https://medium.com/media/a67aa20b0eeac2e4d078f47e8602d70c/href</a></iframe><ul><li><a href="http://docs.python-requests.org/en/master/">R<em>equests</em></a> package to communicate with the rest API that is used by HN.</li><li><a href="https://pandas.pydata.org/"><em>Pandas</em></a><em> </em>is used to organize the data from HN API in a dataframe.</li><li><a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/"><em>BeautifulSoup</em></a><em> </em>is an awesome package to scrape content from links</li><li><em>files</em> from<a href="https://colab.research.google.com/notebook#fileId=/v2/external/notebooks/basic_features_overview.ipynb"> <em>google.colab</em></a><em> </em>is used to download the final Excel file to your local disc (You can also save the final data in a google sheet).</li><li><strong>Note:</strong> You don’t need the <a href="https://simplejson.readthedocs.io/en/latest/">Simplejson</a> for running the code, but it comes handy if you want to investigate the API response.</li></ul><h4>Query HN’s API</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c43d1506b63fb20c2ef4a2409086a542/href">https://medium.com/media/c43d1506b63fb20c2ef4a2409086a542/href</a></iframe><p>The code will make a request to the api url based on the source specified and return the results from there. Here are a couple pointers about the code:</p><ol><li>You can extend the function to other sources, e.g. reddit, simply by having variable <em>source </em>as a list and extend the if-statement with new sources.</li><li>HN API will return your desired links when you add <em>search_by_date </em>in the HN API call (Handy!)</li></ol><h4>Link Scraper</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe24b72bf373c385e131e3748dd1c86b/href">https://medium.com/media/fe24b72bf373c385e131e3748dd1c86b/href</a></iframe><p>The <em>scraper </em>function input is a dataframe that we generated using <em>api_call. </em>The dataframe includes the URLs of all the links we received from the HN API. In this function, we go through the URLs, scrape them and extract the contents. For that, I found all the text in html that are in &lt;p&gt;&lt;/p&gt; format and concatenated them with newline (\n).</p><h4>Example: “autonomous vehicle”</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23b0b0c47dd53145b36cbbae201c4904/href">https://medium.com/media/23b0b0c47dd53145b36cbbae201c4904/href</a></iframe><p>In this example I demonstrate the steps that I take from API call to download the excel file.</p><ol><li>Using the <em>api_call</em> function we read the first 6 pages of HN. Note that I use the default query in the definition of the function. If you are interested in another query just add <em>query = “&lt;your query&gt;” </em>in the function input.</li><li>The <em>scraper</em> function fills the content column of the dataframe using URLs provided by HN API.</li><li>I then remove the empty rows, de-duplicate the links with contents with the same title and reset the index of the dataframe.</li><li>The next couple of lines generate a string for the date that the function is ran. I use this string in the name of the Excel file.</li><li>We can then download that file from Google Drive / Colaboratory using the following line of Python:</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2be289f2e5dd4a8dddfb46450f0e636/href">https://medium.com/media/c2be289f2e5dd4a8dddfb46450f0e636/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uq3IiuoVJarZr5zeZjzUKg.png" /><figcaption>Example of the resulting Excel file</figcaption></figure><h4>What’s next?</h4><p>There are many ways one can proceed from here, e.g.</p><ol><li>Boolean query capability by having multiple calls and set operation on dataframes.</li><li>Add more sources such as reddit or Quora to the api_call function.</li><li>A nice user interface also doesn’t hurt!</li></ol><h4>* What is Google <strong>Colaboratory</strong>?</h4><p>Collaboratory is basically is a <a href="http://jupyter.org/">Jupyter notebook</a> that you can run in your browser. It is connected to your google drive and …wait for it… behaves like google doc, i.e. you can share the notebook and multiple people can edit the same code at the same time. Also, you can read and write datasets from/to google drive too, even in google sheets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=590fe119ef99" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ml-hobbyist/scraping-hacker-news-590fe119ef99">Scraping Hacker News</a> was originally published in <a href="https://medium.com/ml-hobbyist">ML Hobbyist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>