<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Princedede on Medium]]></title>
        <description><![CDATA[Stories by Princedede on Medium]]></description>
        <link>https://medium.com/@princedede?source=rss-c2f0378feeae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Rt_TMkc0hDrrzoBQ73ppjw.png</url>
            <title>Stories by Princedede on Medium</title>
            <link>https://medium.com/@princedede?source=rss-c2f0378feeae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:57:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@princedede/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding How AI (LLMs) Really Work — In Simple Terms]]></title>
            <link>https://medium.com/@princedede/understanding-how-ai-llms-really-work-in-simple-terms-c8cf750bbb24?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8cf750bbb24</guid>
            <category><![CDATA[aı]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Wed, 25 Jun 2025 16:43:53 GMT</pubDate>
            <atom:updated>2025-06-25T16:43:53.172Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding How AI (LLMs) Really Work — In Simple Terms</p><p>Let me break down some basic AI knowledge — especially how it works behind the scenes. If you’ve ever wondered how apps like ChatGPT actually come up with answers, this is for you.</p><h3>What Powers AI Apps?</h3><p>At the heart of most AI apps is something called an LLM — short for Large Language Model. Sounds fancy, but here&#39;s the gist:</p><p>An LLM is an algorithm trained with massive amounts of data — from books, articles, CVs, publications, images, to social media posts on Reddit, Quora, and more. But it’s not storing this data like a database. Instead, it&#39;s learning patterns from all of it.</p><p>That’s how it becomes &quot;smart.&quot;</p><h3>How Does It Actually Respond to You?</h3><p>The key idea is this: an LLM doesn’t memorize exact answers. Instead, it predicts and strings words together based on what it learned from training.</p><p>So, when you prompt it with a question, it looks at the patterns in the data it’s seen and generates a response that fits. The answer it gives depends entirely on the kind of data it was trained with.</p><p>That’s why sometimes it sounds brilliant — and other times, it misses the point.</p><h3>Can You Make an AI App Smarter?</h3><p>Yes… to some extent.</p><p>You can’t exactly retrain it on your own, but you can give it more context. This means feeding it with your own data — like documents, notes, links, or images — so that it can respond more accurately based on your input.</p><p>It’s not just about prompting more. It’s about uploading real knowledge and letting the AI work with it.</p><p>That’s what I meant when I said you can &quot;update your app&quot; with your own data. You’re not rewriting the AI itself — you’re just helping it understand your world better. ( This context is based on the post I shared this morning).</p><h3>Real-Life Example</h3><p>Last week, I shared a video about an AI app that lets you upload your own PDF, image, or even links. After uploading, you can ask it questions, and it will respond based on the information in those files. The name of the App is called MyReach, and it&#39;s currently available on Apple store and Google play store.</p><p>That’s a perfect example of how AI can work with your own knowledge, not just the data it was originally trained on.</p><h3>In a Layman’s Language…</h3><p>AI apps like ChatGPT generate answers by predicting what words should come next, based on patterns it has learned from tons of data.</p><p>And when you give it your own files or knowledge, it uses that as extra context to generate better answers.</p><p>That’s the real magic of LLMs.</p><h3>Practical Prompts You Can Use</h3><p>Now that you understand how AI works, here are some actual prompts I’ve used — and a few you can try to help the AI better understand your context or knowledge.</p><p><strong>✅ Prompts I’ve Personally Used</strong></p><p>These are examples of how I interact with my various AI applications to get helpful results:</p><p>&quot;Summarize this document and give me the key points.&quot;<br>&quot;Act like a business consultant and review my business idea.&quot;<br>&quot;Explain blockchain to a 12-year-old.&quot;<br>&quot;Turn this chat into a tweet thread.&quot;<br>&quot;Rewrite this paragraph in a more professional tone.&quot;</p><p><strong>🧠 Prompts to Update AI with Your Own</strong> Knowledge</p><p>You can also use prompts to teach the AI more about your world, your ideas, or your expertise. This is how you build context over time:</p><p>&quot;Here’s some background on my business. Remember this for our future chats.&quot;<br>&quot;This is how I define success — use this perspective when giving me advice.&quot;<br>&quot;Here’s how my process works. If I ask about it later, use this as a reference.&quot;<br>&quot;These are the types of customers I work with. Tailor your responses to match them.&quot;</p><p>The more you write or upload about what you know, the better the AI can assist you.</p><p>Thanks For Reading....</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8cf750bbb24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does Language Diversity Shape AI? Exploring Cultural Perspectives]]></title>
            <link>https://medium.com/@princedede/ai-and-vocabulary-delvegate-5352ef3f33fc?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/5352ef3f33fc</guid>
            <category><![CDATA[english-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 09:22:10 GMT</pubDate>
            <atom:updated>2024-04-25T07:22:06.949Z</atom:updated>
            <content:encoded><![CDATA[<p>In the recent #Delvegate issue on X (Twitter, Inc.), Paul Graham posted, and I quote: &quot;Someone sent me a cold email proposing a novel project. Then I noticed it used the word &#39;delve.&#39;&quot;</p><p>Then he went ahead to comment: &quot;My point here is not that I dislike &#39;delve,&#39; though I do, but that it&#39;s a sign that the text was written by ChatGPT.&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ThJMp3RF94P_mCSWTGGNSA.png" /></figure><p>There were rebuttals from X users, especially from Nigerian, British, and Indian origins, who made it clear about the simplicity of the word &#39;delve&#39; in everyday grammar, especially for people for whom English is their second or third language. Paul Graham still went on to talk about how using words like &#39;delve&#39; isn&#39;t simple for everyday usage. But alas, Paul&#39;s submission was based on his knowledge within the American space. As we know, Americans are not known for a large vocabulary in English speaking, unlike their British counterparts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSERaxadaJPZLtgahpp7IA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kz7ySQ84prfQPhWwpU2BFQ.png" /></figure><p>This prompted me to write about some of the questions that followed throughout the argument on X, which I will be sharing below:</p><p>In the long discussions on this particular issue, one thing stood out, which was the following question: Where was ChatGPT trained, and where was the data obtained from? Let&#39;s &#39;delve&#39; deeper into that.</p><p>A Thread 🧵 👇👇👇👇👇👇</p><p>Firstly, a machine learning model like LLM can be trained anywhere, irrespective of the data’s origin.</p><p>Secondly, the data were gathered from various sources such as texts, books, online and social media platforms, and articles, making it a diverse pool.</p><p>ChatGPT unlike Google&#39;s Gemini, is known for its creative flair and ability to generate text in different styles. It adapts its vocabulary and sentence structure to match the tone and style of the prompt it receives.</p><p>This makes it a great choice for tasks requiring creative writing or generating new ideas.</p><p>Now, where are the rich texts from? Stay with me...</p><p>Out of about ~8 billion people worldwide, only about 1.5 billion speak English as their native or second language. And out of the ,~1.5 billion English speakers worldwide, the majority are second language speakers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*HUXGD2YFD4hqKuqmvkRKIg.png" /></figure><p>In addition to the second language speakers, other minor English speakers had to learn and apply English in creative ways, enriching their grammatical structures and vocabulary. Many learn English in the British way due to colonization, resulting in a richer flair to the language.</p><p>I remember when growing up as a kid in primary school, we were made to read different literature from both British and Nigerian writers. Books like &#39;Things Fall Apart&#39; by Chinua Achebe, &#39;Alice in Wonderland&#39; by Lewis Carroll, and some of the finest literature available. This did not only help in building our grammatical structures in speaking and writing, it also helped in enriching our vocabularies. So what might look like big or fancy words in the mouth of Paul Graham, is just another everyday word to us here in Nigeria. This begs the question, is simplicity in grammar the culture of Silicon Valley folks or is it a deeply rooted cultural thing in the US?</p><p>Several of the comments supporting Paul Graham&#39;s claim seem to be in agreement with simplicity being a style of communication in the US in general. While I find that very comforting and understanding, what PG is not getting is that the world does not revolve around the US. There is a life outside the US that has a completely different culture from Americans. Like where I am from, for example.</p><p>It&#39;s only natural for most texts to come from writers or posters from these regions, as they are more than the native English speakers.</p><p>ChatGPT&#39;s responses may seem superfluous with words to Americans but normal to British, Indians or Africans, who are accustomed to richer language.</p><p>With AI, the response you get depends on the quality of your prompt. ChatGPT is flexible and can adjust its language style to suit any user or region. Even if the response is a bit more creative or vocabulary-rich, it can be toned down to suit any language style or region.</p><p>So when you get a vocabulary-rich response, you can tone it down with a follow-up prompt like &#39;Make the above simpler&#39; or &#39;Make the above more like American writing.&#39; GPT is incredibly flexible and can adapt to suit any use case. You just have to be creative enough to use it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5352ef3f33fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting Cardiovascular Disease Risk using Machine Learning]]></title>
            <link>https://medium.com/@princedede/cardiovascular-diseases-cvds-constitute-a-global-health-crisis-claiming-millions-of-lives-6c9867defe11?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c9867defe11</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[disease]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Thu, 11 Apr 2024 13:20:29 GMT</pubDate>
            <atom:updated>2024-04-25T07:33:32.974Z</atom:updated>
            <content:encoded><![CDATA[<p>Cardiovascular diseases CVDs, constitute a global health crisis, claiming millions of lives annually. Their burden extends beyond mortality, impacting individuals, families, and healthcare systems due to associated morbidity and economic costs.</p><p>Early detection and intervention are critical in managing CVDs effectively. By identifying individuals at risk before the onset of symptoms, preventive measures can be implemented, potentially slowing disease progression, improving patient outcomes, and reducing healthcare costs.</p><p>Machine learning presents a powerful tool for tackling this challenge. These algorithms can analyze vast amounts of health data, including individual characteristics, medical history, and lifestyle factors, to identify patterns and relationships associated with an increased risk of developing CVDs.</p><p>This project digs into the development and evaluation of a machine learning model specifically designed to predict the likelihood of individuals developing cardiovascular disease. We will explore the utilization of a dataset containing diverse health parameters, such as age, sex, cholesterol levels, blood pressure, and other relevant factors. We will navigate through the model development process, encompassing data pre-processing, feature engineering, model selection, training, and rigorous validation.</p><p>Through this exploration, we aim to contribute to the ongoing effort of harnessing the potential of machine learning for early CVD risk assessment and ultimately, fostering better patient care and improved public health outcomes.</p><h3>Dataset Description</h3><p>The dataset used in this project contains various health parameters collected from individuals, along with a target variable indicating the presence or absence of cardiovascular disease. The features included in the dataset are:</p><ul><li>age: Age of the individual</li><li>sex: Gender of the individual (0: female, 1: male)</li><li>cp: Chest pain type (0-3)</li><li>trestbps: Resting blood pressure (mm Hg)</li><li>chol: Serum cholesterol (mg/dl)</li><li>fbs: Fasting blood sugar &gt; 120 mg/dl (0: false, 1: true).</li><li>restecg: Resting electrocardiographic results (0-2).</li><li>thalach: Maximum heart rate achieved.</li><li>exang: Exercise-induced angina (0: no, 1: yes).</li><li>oldpeak: ST depression induced by exercise relative to rest.</li><li>slope: Slope of the peak exercise ST segment.</li><li>ca: Number of major vessels colored by fluoroscopy.</li><li>thal: Thallium stress test result (0-3)</li></ul><p>The target variable (’target’) indicates the presence (1) or absence (0) of cardiovascular disease.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*2d411tIzpfUkgrtcvA7qng.png" /></figure><h3>Model Development</h3><p>We&#39;ll develop a machine learning model to predict the likelihood of cardiovascular disease using the RandomForestClassifier algorithm. Before training the model, we&#39;ll preprocess the dataset to handle missing values using SimpleImputer and split it into training and testing sets. Next, we&#39;ll perform hyperparameter tuning using GridSearchCV to identify the optimal hyperparameters for the RandomForestClassifier model.</p><h3>Model Evaluation</h3><p>Once the model is trained, we’ll evaluate its performance on the testing set using various evaluation metrics, including accuracy, precision, recall, F1-score, and the confusion matrix. These metrics will provide insights into how well the model generalizes to unseen data and its ability to correctly classify individuals with and without cardiovascular disease.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZU7ROOLRyCRfyJdY-uDrg.png" /></figure><p>You can access the complete code <a href="https://github.com/princedede/ZidioGroup33-Cadiovascular-disease-prediction/blob/main/hypertuning.ipynb">here</a>.</p><h3>Results</h3><p>The trained RandomForestClassifier model achieves an accuracy of approximately 86.9% on the testing set. The best hyperparameters identified through hyperparameter tuning are {&#39;n_estimators&#39;: 150, &#39;max_depth&#39;: 20, &#39;min_samples_split&#39;: 10, &#39;min_samples_leaf&#39;: 4}. The classification report provides detailed metrics for each class, including precision, recall, and F1-score. The confusion matrix further illustrates the model&#39;s performance in predicting true positives, true negatives, false positives, and false negatives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXxJw3Z9HSMqiJJP9w0vVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWXejGWX28jNYJmTWD4SJA.png" /></figure><h3>Comparison with Other Classification Algorithms</h3><p>In addition to RandomForestClassifier, there are several other classification algorithms that can be used for predicting cardiovascular disease risk. Some of the commonly used algorithms include:</p><p>1. Logistic Regression<br>2. Support Vector Machines (SVM)<br>3. K-Nearest Neighbors (KNN)<br>4. Gradient Boosting<br>5. Decision Trees</p><p>RandomForestClassifier, as well as the other algorithms listed, have their own advantages and disadvantages. Let&#39;s discuss the advantages of RandomForestClassifier compared to the other algorithms:</p><h3>Advantages of RandomForestClassifier</h3><p>1. High Accuracy: RandomForestClassifier tends to produce highly accurate models, especially when trained on large and diverse datasets.</p><p>2. Reduced Overfitting: By aggregating multiple decision trees, RandomForestClassifier reduces the risk of overfitting compared to individual decision trees. It achieves this by averaging the predictions of multiple trees, thereby providing a more generalized model.</p><p>3. Handle Missing Values: RandomForestClassifier can handle missing values in the dataset. It internally handles missing values by considering other available features during the tree-building process.</p><p>4. Feature Importance: RandomForestClassifier provides a feature importance score, which helps in identifying the most relevant features for prediction. This can aid in feature selection and understanding the underlying patterns in the data.</p><p>5. Efficient for Large Datasets: RandomForestClassifier is computationally efficient and can handle large datasets with a large number of features.</p><h3>Pros and Cons of other Algorithms:</h3><ol><li><strong>Logistic Regression:</strong></li></ol><p>—Pros<br> - Simple and easy to interpret.<br> - Efficient for binary classification tasks.</p><p>— Cons:<br> - Limited to linear decision boundaries.<br> - May not perform well with complex relationships in the data.</p><p>2. <strong>Support Vector Machines (SVM):</strong><br> — Pros:<br> - Effective in high-dimensional spaces.<br> - Versatile due to the different kernel options (linear, polynomial, radial basis function).<br> — Cons:<br> - Computationally intensive, especially with large datasets.<br> - Sensitivity to the choice of kernel parameters.</p><p><strong>3. K-Nearest Neighbors (KNN):</strong><br> — Pros:<br> - Simple and intuitive concept.<br> - Non-parametric approach, suitable for complex decision boundaries.<br> — Cons:<br> - Computationally expensive during prediction, especially with large datasets.<br> - Sensitive to the choice of k (number of neighbors) and distance metric.</p><p><strong>4. Gradient Boosting:</strong><br> — Pros:<br> - Can capture complex patterns in the data.<br> - Typically achieves high accuracy.<br> — Cons:<br> - Prone to overfitting, especially with shallow trees.<br> - More complex to tune compared to RandomForestClassifier.</p><p><strong>5. Decision Trees:</strong><br> — Pros:<br> - Easy to interpret and visualize.<br> - Can handle both numerical and categorical data.<br> — Cons:<br> - Prone to overfitting, especially with deep trees.<br> - Less robust to noise and outliers compared to ensemble methods like RandomForestClassifier.</p><p>In summary, while RandomForestClassifier has its advantages, it&#39;s essential to consider the specific characteristics of the dataset and problem at hand when choosing the most appropriate algorithm. Experimenting with different algorithms and tuning their parameters can help identify the best-performing model for a given task.</p><h3>Conclusion</h3><p>In this project, we developed a machine learning model to predict the likelihood of cardiovascular disease based on various health parameters. We utilized the RandomForestClassifier algorithm and employed advanced techniques such as hyperparameter tuning and model evaluation to optimize the model&#39;s performance.</p><p>After hyperparameter tuning using GridSearchCV, the RandomForestClassifier achieved an impressive accuracy of 86.9% on the testing set. The best hyperparameters identified were {&#39;n_estimators&#39;: 150, &#39;max_depth&#39;: 20, &#39;min_samples_split&#39;: 10, &#39;min_samples_leaf&#39;: 4}. These hyperparameters were crucial in enhancing the model&#39;s predictive capabilities and ensuring optimal performance.</p><p>The model&#39;s performance was further evaluated using various metrics, including precision, recall, and F1-score. The classification report revealed high precision and recall values for both classes, indicating the model&#39;s ability to effectively identify individuals with and without cardiovascular disease. Additionally, the confusion matrix provided insights into the model&#39;s predictive performance, illustrating the distribution of true positives, true negatives, false positives, and false negatives.</p><p>Overall, the developed RandomForestClassifier model demonstrates significant potential for predicting cardiovascular disease risk accurately. By leveraging advanced machine learning techniques and optimizing hyperparameters, we can create robust models that assist healthcare professionals in early detection and intervention, ultimately improving patient outcomes and reducing the burden of cardiovascular diseases worldwide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c9867defe11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GenAI Prompt Design For Developers]]></title>
            <link>https://medium.com/@princedede/genai-prompt-design-for-developers-c8aa14caeefb?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8aa14caeefb</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Tue, 20 Jun 2023 13:36:22 GMT</pubDate>
            <atom:updated>2023-06-21T11:32:22.136Z</atom:updated>
            <content:encoded><![CDATA[<p>GenAI Prompt design is the process of creating prompts that are used to guide Generative AI (GenAI) models to generate text, images, or other creative content such as ChatGPT and Google’s Bard. Prompts are short pieces of text that are given to GenAI models to help them understand what is being requested of them. And this is an important aspect of using a GenAI as a Professional whether in IT or in other professions like law, engineering, content creators etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*pWzf0Qpoey_vpTsLQdPubA.png" /></figure><p>The quality of the prompt is critical to the quality of the output generated by the AI model used. A well-designed prompt will help the model to generate more accurate, relevant, and creative content to suit your requests.</p><p>There are a number of factors to consider when designing GenAI prompts, including:</p><ul><li>The clarity and conciseness of the prompt. The prompt should be easy to understand and should not be too long.</li><li>The specificity of the prompt. The prompt should be as specific as possible, so that the model knows exactly what is being requested.</li><li>The context of the prompt. The prompt should provide the model with enough context to understand the task at hand.</li><li>The tone and style of the prompt. The prompt should be written in a tone and style that is consistent with the desired output.</li></ul><p>By following these guidelines, you can create prompts that will help you to get the most out of your GenAI application such as ChatGPT.</p><p><strong>Some more Prompt design tips for developers:</strong></p><p>1. Be clear and concise. The prompt should be easy to understand and should not be too long.</p><p>2. Use specific language. Avoid using jargon or technical terms that the AI may not understand.</p><p>3. Provide examples. If possible, provide examples of the kind of output you are looking for. This will help the AI to generate more relevant results.</p><p>4. Be specific about the context. What is the purpose of the code? What kind of data will it be used on? Providing this information will help the AI to generate more accurate results.</p><p>5. Use active voice instead of passive voice. This will make the prompt easier to understand and will also help the AI to generate more natural-sounding code.</p><p>6. Use positive language instead of negative language. This will help the AI to focus on generating code that meets your requirements.</p><p>7. Be consistent in your style and formatting. This will help the AI to generate code that is consistent with your expectations.</p><p><strong>Here</strong> <strong>are</strong> <strong>some</strong> <strong>examples</strong> <strong>of</strong> <strong>good</strong> <strong>prompts</strong> <strong>for</strong> <strong>Python</strong> <strong>developers</strong>:</p><p>1. Write a Python function that takes a list of numbers as input and returns the sum of the list.</p><p>2. Generate a Python script that prints the Fibonacci sequence up to the 100th term.</p><p>3. Create a Python class that represents a customer. The class should have properties for the customer’s name, address, and phone number.</p><p><strong>Here</strong> are <strong>some</strong> <strong>interesting</strong> <strong>prompt</strong> <strong>design</strong> <strong>tips</strong> <strong>for</strong> <strong>JavaScript</strong> <strong>developers</strong>:</p><p>1. Generate a JavaScript function that calculates the distance between two points on a map.</p><p>2. Generate a JavaScript function that formats a string to a specific date format.</p><p>3 Generate a JavaScript code snippet that retrieves data from an API.</p><p>4. Generate a JavaScript code snippet that creates a table with alternating row colors.</p><p>5. Generate a JavaScript code snippet that creates a sticky navigation bar.</p><p>6. Write a JavaScript program that checks the information on a form. Name and phone number are required, but email address and age are not.</p><p>7. Develop a JavaScript application that retrieves data from a public API and displays it on a webpage.</p><p>8. Write a JavaScript function that sorts an array of numbers.</p><p>9. Write a JavaScript function that searches an array for a specific value.</p><p>Click the follow button to stay up-to-date on my latest posts on #AI #DataAnalysis #GenAI #Blockchain #Datascience #Bitcoin</p><p>#Nostr #Amethyst</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8aa14caeefb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Analytics — Application Analysis Using Firebase! Part 2]]></title>
            <link>https://medium.com/@princedede/firebase-analytics-part-2-cbe9551ec892?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbe9551ec892</guid>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Wed, 31 May 2023 09:45:50 GMT</pubDate>
            <atom:updated>2023-06-13T07:10:17.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Firebase Analytics — Application Analysis Using Firebase! Part 2</p><p>Firebase Analytics is a powerful tool that can help you understand how users are interacting with your app. With Firebase Analytics, you can track user engagement, identify trends, identify the app versions your users are using most, identify the most beneficial features to your users, and measure the effectiveness of your marketing campaigns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNHh1DtfYU6kEFK9SYVEuw.png" /></figure><p>This powerful tool can help you understand how users are interacting with your app and areas with the most and least usage. With Firebase Analytics, you can track user engagement, identify trends, identify the app versions your users are using most, identify the most active feature beneficial to your users, and measure the effectiveness of your marketing campaigns.</p><p>To get started with Firebase Analytics, you’ll need to create a Firebase project and add the Firebase SDK to your app. Once you’ve done that, you can start collecting data about your users. This is even more easy if you are using firebase as your database tool.</p><p>Firebase Analytics provides a variety of reports that can help you understand how users are using your app. For example, you can see how many users have installed your app, how many sessions they&#39;ve had, and how long they&#39;ve spent in you can also use Firebase Analytics to track user engagement with specific features of your app. For example, you can see how many users have completed a particular project, how many users have watched a particular video, or how many users are currently using your chat feature. This is why at WEquil we use Firebase Analytics as our default tool for data analytics.</p><p>At default, several events in your app will be automatically collected and tracked for analysis, while some other needed features based on your app and user demand can be added and customized. Some of the default features included are:</p><ol><li>App open: This event is triggered when the app is opened.<br>Session start: This event is triggered when a user starts a new session in the app.</li><li>Session end: This event is triggered when a user ends a session in the app.</li><li>Screen view: This event is triggered when a user views a new screen in the app.</li><li>App exit: This event is triggered when the app is closed.</li><li>Error: This event is triggered when an error occurs in the app.</li><li>In-app purchase: This event is triggered when a user makes an in-app purchase.</li><li>Ad impression: This event is triggered when an ad is displayed in the app.</li><li>Ad click: This event is triggered when a user clicks on an ad in the app.</li></ol><p>You can use the Firebase console to view the data that is collected by Firebase Analytics. The Firebase console provides a variety of reports that can help you understand how users are using your app. This is seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZJWDzXG4vxlWKu69hG4hA.png" /><figcaption>Firebase console</figcaption></figure><p>At WEquil we use Firebase analytics to help us improve the app by tracking user engagement and identifying trends to make informed decisions about how to improve the app and reach more users.</p><p>As a data analyst, here are some specific ways that I use Firebase Analytics to improve our project-based learning platform:</p><h4>Track user engagement</h4><p>One of the most useful features of Firebase Analytics is the ability to track user engagement. This information can help you identify features that are popular with users and features that need improvement. This is one of the default features of the tool. And it can be accessed on your Firebase dashboard, as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozfTjz-7FEIeSRSWeaeuKg.png" /></figure><h4>Identify trends</h4><p>Firebase Analytics can help you identify trends in user behavior over time, like user activities and retention. This information can help you make predictions about future user behavior and make changes to your app to keep users engaged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sWBfkDux0Zlo-0brPC66xA.png" /></figure><h4>Measure the effectiveness of marketing campaigns</h4><p>In product marketing, one of the ways to measure success is to know the channels people are using to access your product. Firebase Analytics can help you measure the effectiveness of your marketing campaigns using customized event tracking. This information can help you determine which marketing channels are most effective and which channels need improvement.</p><h4>Application pages tracking</h4><p>Firebase analytics help you track relevant pages and screens provided by your application. In the case of WequilApp, below are some of the app screens we track and report on. This helps us to identify effective app usage and know which particular feature or screens have the most and least events, thereby helping us to improve in areas where we might be falling short.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_k1nQm5zvsmG2rRIkQagAw.png" /></figure><h4>Application Versions Tracking</h4><p>In this part of Firebase Analytics, app developers, owners, and data analysts can get reports and views on the versions of the app that are currently being used by the users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2mLuNKGzFEXTE2uuQtMsQ.png" /></figure><h4>Users by Countries And Devices</h4><p>This is another great feature where Firebase Analytics shines. In this part of the analytics console, the focus is on the user&#39;s location and device model. This report tracks users geographical locations by countries and gives you updates on new and returning users. With this, you will get a better understanding of the users that are using your application and what locations you might need to release future updates to first. Also, another interesting feature is the tracking of the user&#39;s device type. With this, you get a better understanding of users access devices to your platform, which can tell you what device or mobile OS to focus on when releasing new features or fixing bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a6_V0Rm4PSPRZz5kQEYHZg.png" /><figcaption>Users by country and device model</figcaption></figure><h4><strong>Some Common Misconceptions Using Firebase Analytics</strong></h4><ol><li><strong>Firebase Analytics is a replacement for Google Analytics.</strong> Firebase Analytics is a powerful tool, but it is not a replacement for Google Analytics. Google Analytics provides more comprehensive reporting and insights, while Firebase Analytics is better suited for tracking events and user behavior within your app.</li><li><strong>Firebase Analytics is only for mobile apps.</strong> Firebase Analytics can be used to track data from both mobile apps and web apps.</li><li><strong>Firebase Analytics is only for paid apps.</strong> Firebase Analytics is free to use for all apps, regardless of whether they are paid or free.</li><li><strong>Firebase Analytics is not secure.</strong> Firebase Analytics is a secure platform that complies with industry standards. Your data is safe and secure with Firebase Analytics.</li><li><strong>Firebase Analytics is difficult to use.</strong> Firebase Analytics is actually quite easy to use. The Firebase console provides a user-friendly interface that makes it easy to collect, view, and analyze data.</li></ol><p>If you are looking for a powerful and easy-to-use analytics tool for your mobile app or web app, then Firebase Analytics is a great option. It is important to understand the limitations of Firebase Analytics, but it is a valuable tool that can help you to improve your app and better understand your users.</p><h4>Definitions of common terms used on Firebase Analytics</h4><ul><li>Event: An event is an action that a user takes in your app. For example, a user might tap on a button, view a screen, or make a purchase.</li><li>Property: A property is a piece of data associated with an event. For example, you might track the property “screen_name” to see which screens your users are viewing.</li><li>Metric: A metric is a numerical value associated with an event. For example, you might track the metric “user_count” to see how many users have tapped on a button.</li><li>Session: A session is a period of time during which a user is actively using your app.</li><li>User: A user is a person who has installed your app.</li><li>Dimension: A dimension is a characteristic of a user or event. For example, you might track the dimension “country” to see which countries your users are from.</li><li>Filter: A filter is used to limit the data that is collected. For example, you might use a filter to only collect data from users who are from the United States.</li><li>Segment: A segment is a group of users who share a common characteristic. For example, you might create a segment for users who have made a purchase.</li><li>New users: New users are users who have never used your app before.</li><li>Returning users: Returning users are users who have used your app before and have come back to use it again.</li><li>Average engagement time: Average engagement time is the average amount of time that users spend in your app.</li><li>Retention: Retention is the percentage of users who continue to use your app after their first use.</li></ul><p>In conclusion, Firebase Analytics is a helpful tool for product owners to help them understand how users are interacting with their apps. By tracking user engagement and identifying trends, you can make informed decisions about how to improve your app and reach more users.</p><p><strong>Here are some tips for using and understanding Firebase Analytics:</strong></p><ul><li>Start by tracking the default events: Firebase Analytics tracks a variety of events by default. These events can give you a good overview of how users are using your app.</li><li>Track custom events: You can also track custom events in Firebase Analytics. Custom events are events that are specific to your app.</li><li>Use the Firebase console to view your data: The Firebase console provides a variety of reports that can help you understand how users are using your app.</li><li>Create custom reports: You can also use the Firebase console to create custom reports. Custom reports can help you track specific metrics that are important to your app.</li><li>Use Firebase Analytics to improve your app: By tracking user engagement and identifying trends, you can make informed decisions about how to improve your app and reach more users.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbe9551ec892" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Events In Firebase Analytics For User Application Analysis — WEquilAPP.]]></title>
            <link>https://medium.com/@princedede/setting-up-events-in-firebase-analytics-for-user-application-analysis-wequilapp-9c810185e185?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c810185e185</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Sat, 29 Apr 2023 22:29:45 GMT</pubDate>
            <atom:updated>2023-06-14T04:01:08.852Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setting Up Events In Firebase Analytics For User Application Analysis — <a href="https://medium.com/u/955efbb14591">WEquil</a>APP.</h3><h3>Introduction</h3><p>Solving real world problems takes time and careful planning so was my journey to solve a real world challenge facing <a href="https://medium.com/u/955efbb14591">WEquil</a> app — a project based self-directed learning platform. Since the launch of <a href="https://wequil.app/">wequil.app</a> it’s been quite challenging getting people to understand our value proposition and also getting people to sign up and to actually use the app for the intended purpose. For this purpose so many projects have been created by Sumay Lu, CEO of <a href="https://www.wequil.school/">WEquil School</a> and Joe McPhail, the founder of WEquil Group some of which can be found in the following links:</p><ol><li><a href="https://www.wequil.school/post/welcome-to-wequil-school-2">Welcome to WEquil School</a>.</li><li><a href="https://www.wequil.school/post/wequil-school-v2">WEquil School 2.0.</a></li><li><a href="https://www.wequil.school/post/why-do-project-based-learning">Why do project-based learnin</a>g.</li><li><a href="https://www.wequil.school/post/unity-in-the-homeschooling-community-embracing-our-shared-goals">Unity in Homeschooling community: Our shared goals.</a></li><li><a href="https://wequil.app/project/3iRgedLzeRxLHR">Microschools in WEquil App.</a></li></ol><p>Exciting as it may, building a new product in a very competitive market can be quite challenging and adventurous. But our strength at WEquil lies in our resolve to be unique and to bless the world with a better system of learning — this would be a battle we are not going to give up on! In our quest to understand users journey and experience on the app I was tasked to find a solution using Data Analytics. For this purpose Firebase Analytics was set up to collect data points which will be used as our dataset for this analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*ffThAzULzsCWeFZNntyIBw.png" /></figure><h4>User Application Analysis</h4><p>User application data analysis is an essential process for any business or organization that wants to gain insights into its users’ behavior and preferences. By analyzing user application data, companies can identify trends, optimize their products and services, and improve their user experience. In this project, we will explore the process of user application data analysis and its benefits using firebase analytics as our default analytics data collection tool. Lets take a deep dive into the steps to a good application data analysis.</p><p><strong>Step 1: Data Collection</strong></p><p>The first step in user application data analysis is to collect the data. This can be done using various tools such as Google Analytics, Firebase Analytics, Mixpanel, and more. These tools allow you to track user behavior, such as how long they spend on the app, which features they use, and how often they return to the app.</p><p><strong>Step 2: Metrics Definition</strong></p><p>Once you have collected the data, the next step is to define metrics that you want to track. Metrics are key performance indicators that help you measure the success of your application. Common metrics include user retention rate, conversion rate, customer lifetime value, churn rate and engagement rate. Its also important to know that the set metrics must be actionable. These metrics are called actionable because they provide clear and specific guidance on what actions should be taken to improve business outcomes.</p><p><strong>Step 3: Analyze the data</strong></p><p>After defining your metrics, you need to analyze the data to gain insights into user behavior. There are various techniques you can use to analyze user application data, including data visualization, regression analysis, and machine learning. Data visualization tools like Tableau and PowerBI help you visualize the data and identify trends and patterns. Regression analysis helps you identify relationships between variables, while machine learning can help you make predictions and recommendations based on the data.</p><p><strong>Step 4: Identify insights</strong></p><p>Once you have analyzed the data, the next step is to identify insights that can help you improve your application. Insights can be in the form of trends, patterns, or correlations. For example, you might discover that users who use a particular feature of your app are more likely to become paying customers or users signing up on your platform are all coming from a particular app or platform. This insight could lead you to focus on improving that feature to increase revenue and to gain more user base.</p><p><strong>Step 5: Optimize your app</strong></p><p>Finally, once you have identified insights, you can use them to optimize your application. This could involve making changes to the user interface, adding new features, or tweaking your marketing strategy. The goal is to use the insights you have gained from user application data analysis to improve your app’s user experience and drive growth.</p><h4>Using Firebase Analytics</h4><p><strong><em>Firebase Analytics</em></strong> is a powerful google tool for application analysis that allows developers to track user behavior, gain insights, and optimize their app’s performance. Setting up events in Firebase Analytics is an essential step towards achieving these goals. And I will guide you through the process of setting up events in Firebase Analytics for application analysis.</p><h4>Step 1: Create a Firebase project</h4><p>The first step in setting up Firebase Analytics for your application is to create a Firebase project. To do this, go to the Firebase console and sign in with your Google account. Once you are logged in, click on the “Create a project” button and follow the prompts to create a new Firebase project. Once your project is created, you will be taken to the project dashboard. On WEquil App, this wasn’t an issue for me because the team headed by Paras Jain our CTO made sure all these were configured properly to help collect data to be analyzed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*opzBOEgzhKaDBriipam1rQ.png" /></figure><h4>Step 2: Add Firebase to your application</h4><p>After creating your Firebase project, you need to add Firebase to your application. To do this, follow the steps in the Firebase documentation for your platform (Android, iOS, or Web). Once Firebase is added to your application, you can start sending events to Firebase Analytics. Since WEquil App constitute all three platforms, our dataset will be extracted from them all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-FVyYb0bpljRbTAZhEGXQ.png" /></figure><h4>Step 3: Define your events</h4><p>The next step is to define the events that you want to track in your application. An event is an action that a user performs in your application, such as clicking a button or viewing a screen. In our case our target events are but nt limited to: project views, sign in, sign up, room views, project sharing, app sharing etc. These are events particular to the problems we were trying to solve. To define your events, you need to create an event name and add any parameters that you want to track. For example, if you want to track when a user clicks on a button, you could define an event called “button_click” and add a parameter for the button name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LnX1aZrEhApkETtI1QXgCg.png" /><figcaption>Created Events</figcaption></figure><h4>Step 4: Log events in your application</h4><p>After defining your events, you need to log them in your application. To log an event in Firebase Analytics, you need to call the logEvent() method and pass in the event name and any parameters that you want to track. For example, if you want to log a button click event, you could call the logEvent() method like this:</p><p><em>Below code is for [kotlin]. Check your programming language documentation to get event log code snippet.</em></p><pre>#kotlinCopy code<br><br>FirebaseAnalytics.getInstance(this).logEvent(&quot;button_click&quot;, bundle);</pre><p>Where bundle is a Bundle object that contains any parameters that you want to track.</p><h4>Step 5: View your event data</h4><p>Once you have started logging events in your application, you can view your event data in the Firebase console. To do this, go to the Firebase console and select your project. Then, click on the “Analytics” tab and navigate to the “Events” section. Here, you can see a list of all the events that you have logged in your application, as well as their associated parameters and metrics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qkqr_cKcpEkM87ikojvNCA.png" /><figcaption>Firebase Analytics dashboard</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWmpYr_tZiRn4E10pp5ClA.png" /><figcaption>Dashboard showing event logs</figcaption></figure><p>User application data analysis is a critical process that helps companies gain insights into user behavior and preferences. By collecting data, defining metrics, analyzing the data, identifying insights, and optimizing the app, companies can improve the user experience and drive growth. It is important to invest in data analysis tools and techniques to gain a competitive edge in the market and provide the best possible user experience.</p><p>In conclusion, setting up events in Firebase Analytics is an essential step towards gaining insights and optimizing your application’s performance. By following the steps outlined in this article, you can easily set up events in Firebase Analytics and start tracking user behavior in your application.</p><p><em>To be continued… </em><a href="https://medium.com/@princedede/firebase-analytics-part-2-cbe9551ec892"><em>Part 2</em></a></p><p>Thanks for reading, please kindly drop your thoughts using the comment section below and don’t forget to click the follow button.</p><p>To be a member of our growing community of project-based learners and entrepreneurs head to <a href="https://wequil.app/">https://wequil.app/</a> to register your account.</p><p><strong>We are hiring! head to </strong><a href="https://wequil.app/project/rHIjrFenxqxwxn"><strong>https://wequil.app/project/rHIjrFenxqxwxn</strong></a><strong> to be part of this opportunity!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c810185e185" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sentiment Analysis 2' Using Matplotlib, NLTK And Pandas]]></title>
            <link>https://medium.com/@princedede/sentiment-analysis-2-using-matplotlib-nltk-and-pandas-c4c57b8e8742?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4c57b8e8742</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Mon, 03 Apr 2023 23:13:28 GMT</pubDate>
            <atom:updated>2023-04-03T23:13:28.821Z</atom:updated>
            <content:encoded><![CDATA[<p>Sentiment analysis is a technique that uses natural language processing and machine learning algorithms to identify and extract subjective information from textual data. In the case of hotel reviews, sentiment analysis is used to analyze the sentiment of the reviews, which can be positive, negative, or neutral. In this project, our analysis is going to be based on hotel reviews.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UvUnYJQP3tCbQE2vKYce-w.png" /></figure><p>Hotel reviews can make or break a hotel’s reputation in the hospitality industry. With the rise of online travel agencies, such as Expedia and Booking.com, more and more customers are leaving feedback about their hotel stays. These reviews provide valuable insights into the quality of the hotel’s services and facilities, which potential guests can use to make informed decisions. However, reading through thousands of reviews can be a daunting task, which is where sentiment analysis comes into play.</p><p>The first step in conducting sentiment analysis on hotel reviews is to gather the data. This involves collecting reviews from various online sources, such as TripAdvisor, Yelp, and Google Reviews. Once the data is collected, it is preprocessed to remove irrelevant information, such as website URLs and user names. The data is then cleaned by removing any punctuation marks, stop words, and non-English words. In this case, we will be using a downloaded dataset from TripAdvisor.</p><p>After the data is preprocessed and cleaned, the sentiment analysis process begins. There are various algorithms that can be used to conduct sentiment analysis, such as rule-based systems, machine learning models, and deep learning models. Rule-based systems use a set of predefined rules to classify the sentiment of the text, while machine learning models and deep learning models use training data to learn how to classify the sentiment.</p><p>The most commonly used algorithm for sentiment analysis is the Naive Bayes classifier. The Naive Bayes classifier is a probabilistic model that calculates the probability of a given text belonging to a certain sentiment class. The sentiment class with the highest probability is then assigned to the text.</p><p>Another commonly used algorithm for sentiment analysis is the Support Vector Machine (SVM) classifier. The SVM classifier is a machine learning model that finds the best boundary between the positive and negative sentiments in the data. The boundary is then used to classify new reviews as either positive or negative.</p><p>Once the sentiment analysis is conducted, the results are usually visualized using graphs and charts. These visualizations provide a quick and easy way to understand the sentiment of the reviews. For example, a pie chart could be used to show the percentage of reviews that are positive, negative, or neutral.</p><h4>Lets dive in to our dataset and code base!</h4><p>In this analysis we will be using the following python tools:</p><ol><li>Pandas, one of the most widely used python open-source tools for data manipulation and analysis.</li><li><a href="https://matplotlib.org/stable/index.html">matplotlib</a> is an easy-to-use comprehensive Python library for creating visualizations. It supports basic plots such as; line, bar, scatter, etc. It also supports plots of arrays &amp; fields, statistical plots (like histogram, boxplot, violin, etc.).</li><li>NLTK ( Natural language Toolkit). A powerful text processing libraries for typical Natural Language Processing (NLP) tasks like cleaning, parsing, stemming, tagging, tokenization, classification, semantic reasoning, etc.</li></ol><p><strong>The first step is to import your various libraries for this analysis:</strong></p><pre>import re<br>import pandas as pd<br>import matplotlib.pyplot as plt<br>import nltk<br>from nltk.sentiment.vader import SentimentIntensityAnalyzer</pre><p>Lest import our dataset and see how it looks like!</p><pre>data = pd.read_csv(&#39;Datafiniti_Hotel_Reviews.csv&#39;)<br><br>data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZHCiJ0Et76a68YumEdPZg.png" /></figure><p>The next on our action would be to <strong>check for missing values</strong>. In any analysis, its advisable to check for missing values to know if it would affect your final report or not. the less missing values the better. In situations of few missing values its best to ignore and move on with the analysis except when its significant.</p><pre>check_missing_val_total=data.isnull().sum()<br>print(check_missing_val_total)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*wW7JZEazXIGV0dketRCwwA.png" /></figure><p>From the above its evident that the missing values are insignificant and also, the columns with missing values are not what we will be working with.</p><p>Next would be to select the<strong> needed column</strong> for this analysis. For this we will be using the ‘reviews.rating’, ‘reviews.text’ and ‘city ‘columns. These columns have the necessary details to carry out this analysis.</p><pre>#select only the needed columns<br><br>dfa=data[[&quot;reviews.rating&quot;,&quot;reviews.text&quot;, &quot;dateAdded&quot;, &quot;city&quot;]]<br>dfa</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*ZVK8MqpPjvnh-o-sPjEN_A.png" /></figure><p>For the next step, we will be creating a subset row_id and Response fields into a new dataframe, which is the input format required for by the SentimentIntensityAnalyzer class from “NLTK”. This will also clean up the text data by removing all non-alphabet characters and converting them to lower case.</p><p>The code snippet below performs these two tasks and prints the top ten rows of the resulting dataframe. Copy this code snippet into the next cell of your jupyter notebook and run that cell.</p><pre>#create a new data frame with &quot;id&quot; and &quot;comment&quot; fields<br>dfa_subset = dfa[[&quot;row_id&quot;, &quot;reviews.text&quot;, &quot;dateAdded&quot;, &quot;city&quot;]].copy()<br><br>#data clean-up<br>#remove all non-aphabet characters<br>dfa_subset[&quot;reviews.text&quot;] = dfa_subset[&quot;reviews.text&quot;].str.replace(&quot;[^a-zA-Z#]&quot;, &quot; &quot;)<br><br>#covert to lower-case<br>dfa_subset[&quot;reviews.text&quot;] = dfa_subset[&quot;reviews.text&quot;].str.casefold()<br>print (dfa_subset.head(10))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*bYA0lHCMO9YjlPjPBoO8dQ.png" /></figure><p>Next, we are going to change “reviews.text” to “reviews”</p><pre>#change &quot;reviews.text&quot; to &quot;reviews&quot; because it interferes with python class<br><br>dfa_subset = dfa_subset.rename(columns={&#39;reviews.text&#39;: &#39;reviews&#39;})<br>dfa_subset</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*4Qzg5eUYszq0-BhoGroHQA.png" /></figure><p>Change all “reviews” to string..</p><pre>#change the &quot;reviews&quot; column to string - all non strings values are automatically converted.<br>dfa_subset[&#39;reviews&#39;] = dfa_subset[&#39;reviews&#39;].astype(str)<br><br>print(dfa_subset[&#39;reviews&#39;][2])</pre><h4>Generation of sentiment polarity scores</h4><p>For this we will be using the <a href="https://www.nltk.org/api/nltk.sentiment.vader.html#nltk.sentiment.vader.SentimentIntensityAnalyzer">SentimentIntensityAnalyzer</a> from VADER.</p><p><strong>VADER Sentiment Analysis :</strong><br><strong>VADER (Valence Aware Dictionary and sEntiment Reasoner)</strong> is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media. <strong>VADER</strong> uses a combination of A sentiment lexicon is a list of lexical features (e.g., words) which are generally labeled according to their semantic orientation as either positive or negative. <strong>VADER</strong> not only tells about the Positivity and Negativity score but also tells us about how positive or negative a sentiment is.</p><p>VADER also generates a numeric score in the range of negative one (-1) to positive one (+1) to indicate the intensity of how negative or positive the sentiment is. This is called the <a href="https://www.nltk.org/_modules/nltk/sentiment/vader.html#SentimentIntensityAnalyzer.polarity_scores">polarity score</a> and is implemented by the polarity_score method of the SentimentIntensityAnalyzer class.</p><ul><li>Polarity score in the range of -1 to -0.5 typically indicates negative sentiment.</li><li>Polarity score greater than -0.5 and less than +0.5 typically indicates neutral sentiment.</li><li>Polarity score in the range of +0.5 to 1 typically indicates positive sentiment.</li></ul><p>First, we are going to write a code to create a dataframe for staging the output of the SentimentIntensityAnalyzer.polarity_scores method.</p><pre># set up empty dataframe for staging output<br>df1=pd.DataFrame()<br>df1[&#39;row_id&#39;]=[&#39;99999999999&#39;]<br>df1[&#39;sentiment_type&#39;]=&#39;NA999NA&#39;<br>df1[&#39;sentiment_score&#39;]=0</pre><p>The next few steps involve instantiating an object of the class SentimentIntensityAnalyzer and running a for-loop to iterate the polarity_scores method over each row of input text dataframe df_subset. Another for loop is embedded with the earlier loop to write the sentiment polarity score for each <em>sentiment type </em>to an intermediate dataframe. The three sentiment type values are.</p><ul><li><em>neg</em> for negative sentiment</li><li><em>neu</em> for neutral sentiment</li><li><em>pos</em> for positive sentiment</li><li><em>The Compound</em> score is a metric that calculates the sum of all the lexicon ratings which have been normalized between -1(most extreme negative) and +1 (most extreme positive).</li></ul><p>At the end of the for loop, clean the output dataframe by:</p><ul><li>Deleting the dummy row from the output dataframe</li><li>Removing any duplicate rows that could potentially creep into the output dataframe</li><li>Filtering the output dataframe to only keep rows for sentiment type of <em>compound</em></li></ul><p>The code snippet below performs these tasks and prints the top ten rows of the resulting dataframe. Copy this code snippet into the next cell of your jupyter notebook and run that cell. Depending on the size of your input dataset and machine resources, this step may need a few minutes to complete.</p><pre>print(&#39;Processing sentiment analysis...&#39;)<br><br>sid = SentimentIntensityAnalyzer()<br><br><br>t_df = df1<br><br>for index, row in dfa_subset.iterrows():<br>    scores = sid.polarity_scores(row[1])<br><br>    for key, value in scores.items():<br>        temp = [key,value,row[0]]<br>        df1[&#39;row_id&#39;]=row[0]<br>        df1[&#39;sentiment_type&#39;]=key<br>        df1[&#39;sentiment_score&#39;]=value<br>        t_df=pd.concat([t_df, df1])<br>        <br>#remove dummy row with row_id = 99999999999<br>t_df_cleaned = t_df[t_df.row_id != &#39;99999999999&#39;]<br><br>#remove duplicates if any exist<br>t_df_cleaned = t_df_cleaned.drop_duplicates()<br><br># only keep rows where sentiment_type = compound<br>#t_df_cleaned = t_df[t_df.sentiment_type == &#39;compound&#39;]<br><br>print(t_df_cleaned.head(10))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*YZorAQQxL_aAkMQGMWPrpw.png" /></figure><p>Now, merge this output dataframe t_df_cleaned with the input dataframe dfa using the field row_id. This dataframe merge operation in Python is conceptually similar to performing a join on two database tables in SQL.</p><pre>#merge dataframes<br>dfa_output = pd.merge(dfa, t_df_cleaned, on=&#39;row_id&#39;, how=&#39;inner&#39;)<br>print(dfa_output.head(10))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*8emwrrJK7L_siPs-bgZzeQ.png" /></figure><h4>Visualization</h4><p>Firstly, lets use the describe method in pandas to generate statistical summary of values in the Sentiment_score field. These summary aggregates metrics like median, min, max, count, STD etc.</p><p><strong>STATISTICS</strong></p><pre>dfa_output[[&quot;sentiment_score&quot;]].describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*-zwRFnCwzg2N46k3b8QprQ.png" /></figure><p><strong>CHARTS</strong></p><p>Using <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html">matplotlib</a>, we will create the sentiment score charts. This wil be done using the <em>rating.reviews</em> column against the sentiment score. It will give us the sentiment behind each rating.</p><pre>#generate mean of sentiment_score by reviews.rating<br>dfg = dfa_output.groupby([&#39;reviews.rating&#39;])[&#39;sentiment_score&#39;].mean()<br>#create a bar plot<br>dfg.plot(kind=&#39;bar&#39;, title=&#39;Sentiment Score&#39;, ylabel=&#39;Mean Sentiment Score&#39;,<br>         xlabel=&#39;Rating&#39;, figsize=(6, 5))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCDXUwOyuXnYRrcvUwxvdg.png" /></figure><p>The plot reveals that reviewers within 4.75 ‘rating’ has the highest mean sentiment score, while reviews that within 1.45 ‘rating’ has the lowest mean sentiment score.</p><p><strong>Next,</strong> will be mean sentiment score against sentiment type.</p><pre>#generate mean of sentiment_score by sentiment type.<br>dfg = dfa_output.groupby([&#39;sentiment_type&#39;])[&#39;sentiment_score&#39;].mean()<br>#create a bar plot<br>dfg.plot(kind=&#39;bar&#39;, title=&#39;Sentiment Score&#39;, ylabel=&#39;Mean Sentiment Score&#39;,<br>         xlabel=&#39;sentiment.type&#39;, figsize=(6, 5))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HM4wGcqYhayWqq6mZCQ9mQ.png" /></figure><p>The chart reveals that reviewers with neutral views has the highest mean sentiment score.</p><p><strong>Boxplot</strong></p><p>A boxplot, also called a box and whisker plot, is a way to show the <a href="https://www.statisticshowto.com/measures-of-spread/">spread </a>and <a href="https://www.statisticshowto.com/center-of-a-distribution/">centers </a>of a data set. <a href="https://www.statisticshowto.com/measures-of-spread/">Measures of spread</a> include the <a href="https://www.statisticshowto.com/probability-and-statistics/interquartile-range/">interquartile range</a> and the <a href="https://www.statisticshowto.com/probability-and-statistics/statistics-definitions/mean-median-mode/#mean">mean </a>of the data set. Measures of center include the mean or <a href="https://www.statisticshowto.com/arithmetic-mean/">average </a>and <a href="https://www.statisticshowto.com/probability-and-statistics/statistics-definitions/mean-median-mode/#median">median </a>(the middle of a data set). We are going to use seaborn <a href="https://seaborn.pydata.org/"><em>seaborn</em></a> to create the boxplot to get visualization on the sentiment spread across each rating.</p><pre>import seaborn as sns<br>#create seaborn boxplots by group<br>sns.boxplot(x=&#39;reviews.rating&#39;, y=&#39;sentiment_score&#39;, notch = True,<br>            data=dfa_output, showfliers=False).set(title=&#39;Sentiment Score by Rating&#39;)<br>#modify axis labels<br>plt.xlabel(&#39;Rating&#39;)<br>plt.ylabel(&#39;Sentiment Score&#39;)<br>plt.xticks(rotation=90)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*WgCibHn-nQJStJsyjZJiog.png" /></figure><p>This boxplot reveals interesting insights about how reviewers within each rating feel about the hotels in general.</p><ul><li>The box for Rating 4.0 and 5.0 is among the tallest box, which indicates a wider spread in the sentiment scores of responses from this reviews. This spread is a sign of polarization within the rating, which means the reviewers have a balance feeling for both positive and negative sentiments about the hotels.</li><li>While box for rating 1.0, 2.0 and 3.0 has a shift of median to the negative sentiment. this means more reviewers have a strong sentiment feel about the hotels while the others have a negative feel about the hotels.</li></ul><h4>Final Notes</h4><p>Hotel managers can use the results of sentiment analysis to improve their services and facilities. If the majority of the reviews are negative, the hotel management can take steps to address the issues raised in the reviews. For example, if several guests complain about the cleanliness of the rooms, the hotel management can increase the frequency of room cleaning and ensure that the housekeeping staff is properly trained. If the majority of the reviews are positive, the hotel management can use this information to market their hotel to potential guests.</p><p>In addition to helping hotel managers improve their services and facilities, sentiment analysis can also be used by customers to make informed decisions about which hotels to stay at. Customers can use the results of sentiment analysis to compare the sentiment of reviews for different hotels and choose the one that has the highest percentage of positive reviews.</p><p>In conclusion, sentiment analysis is a powerful tool that can be used to analyze the sentiment of hotel reviews. It provides valuable insights into the quality of the hotel’s services and facilities, which hotel managers can use to improve their operations. Additionally, customers can use the results of sentiment analysis to make informed decisions about which hotels to stay at. As the hospitality industry becomes increasingly competitive, sentiment analysis will become even more important in ensuring that hotels provide the best possible experiences for their guests.</p><blockquote>Data set credits goes to Machine learning Repository, <a href="http://author%20%3D%20%7Bkavita%20ganesan%20and%20chengxiang%20zhai/">UCI</a>.</blockquote><blockquote>Author: Kavita Ganesan and ChengXiang Zhai</blockquote><p><em>Inspiration from </em><a href="https://www.red-gate.com/simple-talk/development/data-science-development/sentiment-analysis-python/"><em>Sanil Mahtre</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4c57b8e8742" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analyzing Binance Chain Activities, March 2023]]></title>
            <link>https://medium.com/@princedede/analyzing-binance-chain-activities-march-2023-a59a8e40a57?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/a59a8e40a57</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[binance]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 04:52:07 GMT</pubDate>
            <atom:updated>2023-03-17T04:54:02.181Z</atom:updated>
            <content:encoded><![CDATA[<p>Binance Smart Chain (BSC) is a blockchain that has gained a lot of attention recently due to its low transaction fees and fast processing speed. This blockchain was created by Binance, one of the largest cryptocurrency exchanges in the world, and has quickly become a popular choice for decentralized finance (DeFi) protocols, gameFi protocols, and other applications that require fast and cheap transactions. This project will focus on DeFi and GameFi activities of binance various protocols for the month starting from January to march. But before we dive into that, lets answer some basic blockchain questions.</p><h4>DeFi Protocols</h4><p>Decentralized finance (DeFi) protocols are applications that allow users to access financial services without the need for a central authority. These protocols are built on top of blockchain technology and are designed to be transparent, secure, and accessible to anyone with an internet connection.</p><p>Binance Smart Chain has become a popular choice for DeFi protocols due to its low transaction fees and fast processing speed. Some of the most popular DeFi protocols built on Binance Smart Chain include PancakeSwap, Venus, PinkSale, BiSwap, UniCrypt, BakerySwap etc.</p><p>PancakeSwap is a decentralized exchange (DEX) that allows users to trade various cryptocurrencies with low fees and fast transaction times. Venus is a DeFi protocol that allows users to earn interest on their cryptocurrency holdings by providing liquidity to the platform. BakerySwap is another DEX that allows users to trade various cryptocurrencies and provides liquidity farming incentives for its users.</p><h4>GameFi Protocols</h4><p>GameFi is a new category of blockchain-based applications that combines gaming and finance. These protocols allow users to earn cryptocurrency rewards by playing games or participating in other activities within the platform.</p><p>Binance Smart Chain has become a popular choice for GameFi protocols due to its low transaction fees and fast processing speed. Some of the most popular GameFi protocols built on Binance Smart Chain include Axie Infinity, Era7: Game of truth, Xworld, My DeFi Pet, Age of tanks, Star Atlas etc.</p><p>Era7: Game of Truth is a virtual world, built on Web3.0, that runs parallel to the real one. Functioning as a vast and traversable online world with monetary assets, social methods, and complete spatial perception and physical rules, it’s not only independent of the real world but complementary to it. Axie Infinity is a blockchain-based game that allows players to earn cryptocurrency rewards by breeding and battling virtual creatures called Axies. My DeFi Pet is another blockchain-based game that allows players to collect and trade virtual pets while earning cryptocurrency rewards. Star Atlas is an upcoming GameFi platform that combines space exploration and combat with decentralized finance.</p><h4>Transaction Details</h4><p>Binance Smart Chain provides detailed transaction information that can be accessed through various blockchain explorers. These explorers allow users to view transaction details such as the transaction hash, sender and receiver addresses, gas fees, and transaction status.</p><p>Some of the most popular blockchain explorers for Binance Smart Chain include BscScan, PancakeSwap Info, and BakerySwap Explorer. These explorers provide users with detailed transaction information and are essential tools for anyone looking to analyze Binance Smart Chain transactions.</p><p><strong>Binance Chain Dashboard — Reporting:</strong></p><p>The below dashboard explores the activities of the various protocols on BSC for the month of march. The analysis was done using Footprint protocol, a blockchain analyzing tool with dataset download and upload. Since i discovered this platform it has been my go to app for blockchain analysis. Available tools such as No-code and code based analysis using SQL is also available for data analyst like myself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdAWaoUsGUgK10uDpQ2-KA.png" /></figure><p>From the above charts it can be seen that BNB chain is the top performer for the month of march with a whooping size of 64% volume count among other chains, followed by Avalanche. The top protocol by TVL on BSC is pancakeswap with a 7 day average TVL of about 200 billion followed by Venus.</p><p>On the GameFI chart, Era7: Game of Truth takes the lead with the highest number of active users with 2 million active users. This is followed by X World games. Also, GameFi started seeing an upward trend from january 2021 compared to the previous years. 2021 was actually the breakthrough year for GameFi.</p><p>Era7: Game of Truth is also the leading gaming platform in terms of NFT assets sales followed by Element. But in general NFT has been performing badly since late last year and there is still no sign of improvement in 2023 so far. Hopefully the bull run season would favour NFTs and other digital assets.</p><h4>Conclusion</h4><p>Binance Smart Chain has become a popular choice for DeFi and GameFi protocols due to its low transaction fees and fast processing speed. This blockchain provides users with detailed transaction information that can be accessed through various blockchain explorers. As more applications are built on Binance Smart Chain, it is likely that this blockchain will continue to grow in popularity and become a major player in the world of decentralized finance and gaming.</p><p>Thanks for reading. Catch you on my next blockchain analysis post! Please don’t forget to click the follow button.</p><p><a href="https://www.footprint.network/@Princedede/BNB-Chain-Activities-For-The-Month-March">Footprint Dashboard link</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a59a8e40a57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sentiment Analysis Using Python — Hotel Reviews Case Study.]]></title>
            <link>https://medium.com/@princedede/sentiment-analysis-using-python-hotel-reviews-case-study-c6b81f7cfa96?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6b81f7cfa96</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 00:54:15 GMT</pubDate>
            <atom:updated>2023-04-03T15:58:27.076Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sentiment Analysis Using Python — Hotel Reviews As Case Study.</h3><p>In today’s world, online reviews have become a crucial factor in the decision-making process for individuals looking to book hotels. Potential customers often rely on online reviews to gauge the quality of a hotel before making a choice. However, with the sheer volume of reviews available online, it can be challenging to determine the overall sentiment of the reviews accurately. This is where sentiment analysis comes into play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzX0I82X916EpWbhTPiPJg.png" /></figure><p>Sentiment analysis is a natural language processing technique that enables the extraction of emotions, opinions, and attitudes from text data. By analyzing the text of hotel reviews, sentiment analysis can help hotel managers understand the overall sentiment of their guests and identify areas for improvement.</p><p>Python is a popular programming language used for data science and machine learning. It has many libraries and tools that make it an excellent choice for sentiment analysis projects. In this project, we will be building a sentiment analysis model using Python to analyze hotel reviews. By using machine learning algorithms, we will train a model that can accurately determine the sentiment of hotel reviews. For a more detailed understanding, this project will be split into two parts. The first part will be based on sentiment analysis, while the second part will be based on building a machine learning model for sentiment score prediction.</p><p>This data set contains user reviews of hotels collected from Tripadvisor. <a href="http://archive.ics.uci.edu/ml/datasets/opinrank+review+dataset">Here</a> is the link to the dataset.</p><h4>Step One</h4><p>Importing the Python libraries we will be using for this project.</p><pre>import numpy as np<br>import pandas as pd<br>import seaborn as sns<br>import matplotlib.pyplot as plt<br>import nltk<br>from nltk.sentiment.vader import SentimentIntensityAnalyzer<br>sentiments = SentimentIntensityAnalyzer()<br>from nltk import word_tokenize, sent_tokenize<br>from nltk.corpus import stopwords<br>from nltk.stem import PorterStemmer<br>from wordcloud import WordCloud, STOPWORDS<br>from textblob import TextBlob<br>import string<br>import re<br>import emoji</pre><p>Next we will import and the print the hotel reviews CSV file.</p><pre>data = pd.read_csv(&quot;7282_1.csv&quot;)<br>data</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwsPE4G0Gm4CHDpEDz8BMg.png" /></figure><h4>Step Two</h4><p>Selecting the needed columns: In this analysis, we will be using the “Name”, “reviews.rating”, and “reviews.text” columns. But before we do that, I would like for us to change “the reviews.text” column to just &quot;reviews.&quot;</p><pre>data = data.rename(columns={&quot;reviews.text&quot;: &quot;reviews&quot;})<br><br>df=data[[&quot;name&quot;,&quot;reviews.rating&quot;,&quot;reviews&quot;]]<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_eMNIbhTqRgKBpC3ErX_SQ.png" /></figure><h4>Step Three</h4><p>Check for missing values: On this step, we will be checking for missing values to see if they are significant.</p><pre><br>#check for missing values<br>​<br>check_missing_val_total=df.isnull().sum()<br>print(check_missing_val_total)<br><br>OUTPUT:<br>name                0<br>reviews.rating    862<br>reviews            22<br>dtype: int64</pre><p>From the output, it shows the number of missing values is insignificant. So we can continue with the process.</p><p>Let’s take a quick look at the distribution of customer ratings:</p><pre>ratings = df[&quot;reviews.rating&quot;].value_counts()<br>numbers = ratings.index<br>quantity = ratings.values<br><br>custom_colors = [&quot;skyblue&quot;, &quot;yellowgreen&quot;, &#39;tomato&#39;, &quot;blue&quot;, &quot;red&quot;, &quot;purple&quot;, &quot;blue&quot;, &quot;orange&quot;]<br>plt.figure(figsize=(8, 8))<br>plt.pie(quantity, labels=numbers, colors=custom_colors)<br>central_circle = plt.Circle((0, 0), 0.5, color=&#39;white&#39;)<br>fig = plt.gcf()<br>fig.gca().add_artist(central_circle)<br>plt.rc(&#39;font&#39;, size=14)<br>plt.title(&quot;Hotel Reviews Ratings&quot;, fontsize=20)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*52WKZecg2wwFcyHuJ5mFsg.png" /><figcaption>5.0 is the highest rating occurrence.</figcaption></figure><p>Next, we are going to print the distinct names of all the hotels in the dataset .</p><pre>print(df.name.unique())</pre><p>Find the average of all ratings for each unique hotel name and check which hotel received the highest average rating.</p><pre>x=(df.groupby(&#39;name&#39;)[&#39;reviews.rating&#39;].mean())<br>print(x)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*YnV7zJlYDmi_S7Rf8B5ntQ.png" /></figure><p>From the data above it can be seen that, Hotel name “1900 House” has the highest average rating.</p><h3>Data Pre-processing</h3><p>Next, let’s start with the pre-processing of data and perform some steps that are necessary to convert raw data into more suitable information for analysis.</p><h4>Lowercasing</h4><p>In data science, lowercasing is an important step to maintain consistency of data. Different variations in capitalization of input may sometimes lead to different types of output. For example, Nigeria, nigeriA, and NIGERIA all map to the same lowercase form. Hence, lowercasing is generally considered a standard practice for data consistency.</p><pre># Lower casing<br><br># Change the reviews type to string<br><br>df[&#39;reviews&#39;] = df[&quot;reviews&quot;].astype(str)<br>print(df[&#39;reviews&#39;][2])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5xfWvu6z6E3efkYThGj8Jg.png" /></figure><pre>#Lowercase all reviews<br><br>df[&#39;reviews&#39;]= df[&quot;reviews&quot;].apply(lambda x: x.lower())<br>print(df[&quot;reviews&quot;][2]) <br><br># to see the difference</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tifTqlWpfkI8bwFhVwWEmg.png" /></figure><h4>Emojis</h4><p>It is also critical to remove emojis from data because they can sometimes cause issues with further analysis.</p><pre>#check if there is any special character<br>alphabet = string.ascii_letters+string.punctuation<br>print(df.reviews.str.strip(alphabet).astype(bool).any())<br><br>extracted_emojis=[]<br><br>def extract_emojis(s):<br>    expe = re.compile(&quot;[\U00010000-\U0010ffff]&quot;, flags=re.UNICODE)<br>    #return expe.findall(s)<br>    return expe.sub(r&quot;&quot;,s)<br><br>for y in df[&quot;reviews&quot;]:<br>    print(str(extract_emojis(y)))<br>    extracted_emojis.append(str(extract_emojis(y)))</pre><h4>Stopwords</h4><p>Removing stopwords can improve the performance to a great extent. Words like myself, me, she, he, they, mine, you, and so on. When these words are removed, only meaningful tokens are left. Lets go ahea!</p><pre># stop words<br><br>stop_words=stopwords.words(&#39;english&#39;)<br>df[&#39;extracted_emojis&#39;] = extracted_emojis<br>df[&#39;extracted_emojis&#39;]= df[&#39;extracted_emojis&#39;].apply(lambda x:x if x not in stop_words else None)<br>print(df[&#39;extracted_emojis&#39;][5])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3Gilin2x7amZjHbfyHj4g.png" /></figure><h4>Stemming</h4><p>Stemming is also an important data analysis process; it chops off the end of the word and transforms it into its root form. All suffixes like -s, -es, -ed, -ing are removed. Let&#39;s get to the code!</p><pre># stemming<br><br>def stemming(x):<br>    st = PorterStemmer()<br>    if x is not None:<br>       for word in x.split():<br>           st.stem(word)<br><br>df[&#39;extracted_emojis&#39;].apply(lambda x:stemming(x))<br>print(df[&#39;extracted_emojis&#39;][100])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmsLAmuGj6AAABSSEQxa7g.png" /></figure><h4>Sentiment Score</h4><p>We are getting close to the analysis. In this step, each review will receive a sentiment score, and the results of the analysis can be obtained.</p><pre>def senti_sc(x):<br>    if x is not None:<br>       return TextBlob(x).sentiment<br><br>df[&quot;Sentiment_score&quot;]= df[&quot;extracted_emojis&quot;].apply(senti_sc)<br>print(df.loc[0:19,[&#39;extracted_emojis&#39;,&#39;Sentiment_score&#39;]])<br><br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1FiQglrj8dCMssSdkRYfA.png" /></figure><p>According to the reviews, hotel guests seem satisfied with the services, now let’s take a look at how most people think about hotel services based on the sentiment of their reviews:</p><pre>x = sum(data[&quot;Positive&quot;])<br>y = sum(data[&quot;Negative&quot;])<br>z = sum(data[&quot;Neutral&quot;])<br><br>def sentiment_score(a, b, c):<br>    if (a&gt;b) and (a&gt;c):<br>        print(&quot;Positive 😊 &quot;)<br>    elif (b&gt;a) and (b&gt;c):<br>        print(&quot;Negative 😠 &quot;)<br>    else:<br>        print(&quot;Neutral 🙂 &quot;)<br>sentiment_score(x, y, z)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*ads3W29EdpF6J_NRBUNXOg.png" /></figure><p>Thus, most people feel neutral about the hotel services. Now let’s take a closer look at the sentiment scores:</p><pre>print(&quot;Positive: &quot;, x)<br>print(&quot;Negative: &quot;, y)<br>print(&quot;Neutral: &quot;, z)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*CBtMYRLx4-Y1tlbQjPqjvQ.jpeg" /></figure><p>According to the above results, more than 25,000 reviews are classified as neutral, and about 8,000 reviews are classified as positive. So it can be said that people are really happy with the services of the hotels they have stayed in, as the negative reviews are below 2000.</p><h4>Conclusion</h4><p>The insights gained from this project can help hotel managers improve their service and offerings, ultimately leading to increased customer satisfaction and loyalty. As users, the best way to know if a hotel is right for you or not is to find out what other people are saying about the hotel on various social media sites or news outlets. I hope you liked this project on sentiment analysis of hotel reviews with Python. Feel free to provide suggestions and to ask your valuable questions in the comments section below.</p><p>Stay tuned for <strong>Part Two.</strong></p><blockquote>Data set credits goes to Machine learning Repository, <a href="http://author = {Kavita Ganesan and ChengXiang Zhai">UCI</a>.</blockquote><blockquote>Author: Kavita Ganesan and ChengXiang Zhai</blockquote><p>Link to code — <a href="https://github.com/princedede/Data-Analysis-Projects/blob/main/SentimentAnalysisHotelReviews.ipynb">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6b81f7cfa96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Decentralized Protocols — A Data Analyst point of View.]]></title>
            <link>https://medium.com/@princedede/understanding-decentralized-protocols-a-data-analyst-point-of-view-ffa6d4b17894?source=rss-c2f0378feeae------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffa6d4b17894</guid>
            <category><![CDATA[defi-tvl]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Princedede]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 11:27:48 GMT</pubDate>
            <atom:updated>2023-03-02T11:27:48.198Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding Decentralized Protocols — A Data Analyst point of View.</h3><p>Decentralized protocols have been gaining a lot of attention lately, especially in the realm of decentralized finance (DeFi). One metric that is commonly used to measure the success and growth of DeFi protocols is TVL or Total Value Locked. In this post, we’ll take a deeper dive into what TVL means and why it’s an important metric for decentralized protocols.</p><p>TVL refers to the total value of assets that are currently locked in a protocol. In DeFi, these assets are typically cryptocurrencies, stablecoins, or other tokens. The TVL metric is used to measure the amount of capital that is currently being used in a specific protocol or network. The higher the TVL, the more popular and successful the protocol is considered to be.</p><p>One of the reasons why TVL is such an important metric is that it can provide insight into the overall health and stability of a protocol. A high TVL indicates that users have confidence in the protocol and are willing to invest their assets into it. It also suggests that there is a high demand for the services that the protocol offers, which can translate to more revenue and profits for the protocol’s creators.</p><p>TVL is also a useful metric for comparing different protocols and networks. By comparing the TVL of different DeFi protocols, investors and users can gain insights into which protocols are currently the most popular and which ones are growing the fastest.</p><p>This can help them make informed investment decisions and determine which protocols are worth exploring further.</p><p>Another benefit of using TVL as a metric is that it can provide insights into the overall health of the DeFi ecosystem. As more and more protocols emerge, TVL can be used to track the overall growth and adoption of DeFi as a whole. This can be useful for predicting future trends and identifying potential opportunities for growth and investment.</p><p>However, it’s important to note that TVL is just one metric and should not be used in isolation to make investment decisions. Other factors, such as the security of the protocol, the quality of the team behind it, and the overall market conditions, should also be taken into account.</p><p>Using SQL, I was able to extract data for decentralized Protocols By TVL in the last 30 days using footprint — The feeling, seeing lido, MakerDAO and some of the OG crypto still waxing strong is amazing!</p><p>Here is a link to my chart on TVL in the last 30 days: <a href="https://www.footprint.network/chart/Protocols-By-TVL-in-the-last-30-days-fp-38123">https://www.footprint.network/chart/Protocols-By-TVL-in-the-last-30-days-fp-38123</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vn2eehQb-NJel4Yra0r50w.png" /></figure><p>In conclusion, TVL is an important metric for measuring the success and growth of decentralized protocols. It provides insight into the popularity and demand for a protocol, as well as the overall health of the DeFi ecosystem. While TVL should not be used in isolation to make investment decisions, it is a useful tool for investors and users looking to gain insights into the world of decentralized finance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffa6d4b17894" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>