<?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 Mr Farkhod Khushaktov on Medium]]></title>
        <description><![CDATA[Stories by Mr Farkhod Khushaktov on Medium]]></description>
        <link>https://medium.com/@mrmaster907?source=rss-518c724a865c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HwW93ZY7VK_Sbcit-NjUPw.jpeg</url>
            <title>Stories by Mr Farkhod Khushaktov on Medium</title>
            <link>https://medium.com/@mrmaster907?source=rss-518c724a865c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:00:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrmaster907/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[Automatic download any sort of image on google using MechanicalSoup]]></title>
            <link>https://medium.com/@mrmaster907/automatic-download-any-sort-of-image-on-google-using-mechanicalsoup-f4b40c635ffd?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4b40c635ffd</guid>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[mechanicalsoup]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 07:00:51 GMT</pubDate>
            <atom:updated>2024-02-18T07:00:51.851Z</atom:updated>
            <content:encoded><![CDATA[<p>Farkhod Khushvaktov |<a href="https://www.linkedin.com/in/farkhod-khushvaktov/">LinkedIn</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*QLv_0AUmcTFNk7SKDPVk8g.png" /></figure><h3>I have some Cheating text to be Understandable for all level developer</h3><p><strong>Python</strong> is the most popular language for web scraping. The amount of flexibility it offers while extracting data from websites is one of the main reasons it is a preferred choice for data extraction. Also, it has a couple of high-performance libraries like BeautifulSoup, and Selenium, which can be used to make powerful and efficient scrapers.</p><p>Most people reading this article may have heard of the terms <strong>“Data Extraction”</strong> or <strong>“Web Scraping.”</strong> If you have not come across this yet, don’t worry, as this article is planned for all types of developers who have just started with web scraping or want to gain more information about it.</p><p><a href="https://serpdog.io/blog/web-scraping-a-complete-guide/"><strong>Web Scraping</strong></a> is the process of extracting a specific set of information from websites in the form of text, videos, images, and links. In today’s world, web scraping is an important skill to learn, as it can be used for a variety of purposes, such as lead generation, price monitoring, SERP monitoring, etc.</p><h3>Why Python for Web Scraping?</h3><p>There are many reasons why developers choose Python for web scraping over any other language:</p><p><strong>Simple Syntax </strong>— Python is one of the simplest programming languages to understand. Even beginners can understand and write scraping scripts due to the clear and easy-to-read syntax.</p><p><strong>Extreme Performance</strong> — Python provides many powerful libraries for web scraping, such as Requests, Beautiful Soup, Scrapy, Selenium, etc. These libraries can be used for making high-performance and robust scrapers.</p><p><strong>Adaptability — </strong>Python provides a couple of great libraries that can be utilized for various conditions. You can use Requests for making simple HTTP requests and, on the other end, Selenium for scraping dynamically rendered content.</p><h3>Let’s Continue with Mechanical Soup Web Scripting part</h3><h3>1.Installation</h3><p>Download and install the latest released version from <a href="https://pypi.python.org/pypi/MechanicalSoup/">PyPI</a>:</p><pre>pip install MechanicalSoup</pre><p>Download and install the development version from <a href="https://github.com/MechanicalSoup/MechanicalSoup">GitHub</a>:</p><pre>pip install git+https://github.com/MechanicalSoup/MechanicalSoup</pre><p>Installing from source (installs the version in the current working directory):</p><h3>2. open Google page</h3><pre>import mechanicalsoup<br><br>browsers = mechanicalsoup.StatefulBrowser()<br>url = &quot;https://google.com/&quot;<br>browsers.open(url)<br>print(browsers.get_url())</pre><p>we got it response: “<a href="https://www.google.com/">https://www.google.com/</a>”</p><p>so how we enter our keyword which we gonna download image name But How let’s see it</p><h3>3.Put keyword on google search</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKHQhVzLKqcXTbwiIQkz0Q.png" /></figure><p>As you can see on the search field has <strong><em>name=’q’</em></strong></p><pre>keyword = &#39;Bird&#39;<br>browsers[&#39;q&#39;] = keyword<br><br>browsers.launch_browser()<br>response = browsers.submit_selected()<br><br>print(&quot;new Url&quot;, browsers.get_url())<br>browsers.open(browsers.get_url())<br>page = browsers.get_current_page()<br>print(page)</pre><p>and we have enter new value which is bird after that we have launched. and we got new url with get_url() then we have opened new url finally exract HTML code.</p><h3>4.get image src</h3><pre>all_page = page.find_all(&quot;img&quot;)<br><br>image_source = []<br>for image in all_page:<br>    image = image.get(&#39;src&#39;)<br>    image_source.append(image)<br>image_source</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqjTH39ES6gOQ6R_mYHR2w.png" /></figure><p>Output like this</p><h3>5. Filter src</h3><pre>image_source = [image for image in image_source if image.startswith(&quot;https&quot;)]</pre><h3>6.Create Folder</h3><pre>import os<br>cwd = os.getcwd()<br><br>path = os.path.join(cwd, keyword + &quot;s&quot;)<br>path<br>if os.path.exists(path):<br>    print(&#39;there is&#39;)<br>else:<br>    os.mkdir(path)</pre><h3>7.Save Image Itself</h3><pre>import requests<br>counter = 0 <br>for image in image_source:<br>    save_as = os.path.join(path, keyword + str(counter) + &quot;.jpg&quot;)<br>    r = requests.get(image)<br>    with open(save_as, &#39;wb&#39;) as f:<br>        f.write(r.content)<br>    counter +=1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dE2memptP_CSv1wGlB02aA.png" /></figure><h3>Thank you all readers</h3><p>Seeeee You next Post</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4b40c635ffd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conduct a Choice-Based Conjoint Analysis for Netflix with Python]]></title>
            <link>https://medium.com/@mrmaster907/conduct-a-choice-based-conjoint-analysis-for-netflix-with-python-4999d68d42a8?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4999d68d42a8</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[conjoint-analysis]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Sat, 02 Sep 2023 13:26:23 GMT</pubDate>
            <atom:updated>2023-09-02T13:26:23.475Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Farkhod Khushvaktov | 2023 2-September </strong><a href="https://www.linkedin.com/in/farkhod-khushvaktov-465459248/"><strong>LinkedIn</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*pnIbAMUB06De7gbIffXDzQ.png" /></figure><p>As a business owner, you can choose what functionalities you want to include in your products/services. Later, you need to go to the market and gather customer reviews to understand whether the existing features are good to go for the long term or if there is need for improvements. To help you with the analysis of such vast customer data, conjoint analysis is the appropriate analytical method. Save time by reading this ultimate guide on conjoint analysis that helps you understand the concept from the foundation level.</p><h3>What is Conjoint Analysis?</h3><p>Conjoint analysis is a common statistical method of pricing and product research. The method uncovers customers’ choices through market surveys. Then it analyzes survey responses to select and predict the followings:</p><p>Product functionalities and features Assess pricing sensitivity Market share When customers will adopt new services or products</p><p>Different industries frequently use this statistical analysis for all types of consumer goods and services like the ones mentioned below, but the list goes beyond these:</p><p>Consumer durables Smartphones and tablets Smart home devices and wearables Electronics and electrical products Investment products</p><p>The primary goal of conjoint analysis is to predict what features customers want in a new product. Hence, businesses do not need to invest additional budget in market surveys after launching a product that does not align with customers’ needs.</p><h3>Why and When do you need Conjoint Analysis?</h3><p>Developing, testing, and marketing a product or service is a costly affair. A product failure can break the entire business, and trust us this happened a lot. Hence, you need to run a conjoint analysis program around your prototype product before producing it at massive levels. If the result of this quantitative analysis comes positive, you can begin mass production. If the outcome is negative, you need to include the features customers want and release the product to the public. But why conjoint analysis for market survey and not any other methods? That is a valid question that many business managers, leaders, and owners ask. Because usual rating-based surveys are not effective for all the features and functionalities of a product. A consumer good contains many unrelated features, and comparing them all in one survey will become an apple-to-orange comparison. Contrarily, the conjoint analysis filters the survey participants’ responses, like their preferences, dislikes, etc., for different features. Ultimately, it delivers data that can uniformly say what the customers like and which elements will drive sales in the market. Now, here are the business scenarios where you need to apply conjoint analysis:</p><h4>Product Price Discovery</h4><p>When you need to create a new or revised product pricing, conjoint analysis is the most effective tool. You ask customers direct questions to value various features of a product. Then, analyze the survey data and increase or decrease the price according to the weightage of the feature that is most valued.</p><h4>Research and Development (R&amp;D)</h4><p>Since product R&amp;D is a costly affair, you can not just run R&amp;D projects for all the features. By performing a conjoint analysis, you understand which features are most important and develop only those. It helps you to run R&amp;D through a budget.</p><h4>Sales and Marketing</h4><p>If you need to run targeted marketing campaigns for different customer segments, you can use conjoint analysis. It will suggest how to distinguish the marketing materials like brochures, website landing pages, discount offers, online advertising, and more for various customer groups.</p><h3>Examples of Conjoint Analysis</h3><h4>Freemium Plan for Applications</h4><p>Nowadays, software companies launch a freemium plan for their apps. Users can access the application for free and use a few important features. Now, the developers perform conjoint analysis to figure out which features are most popular. Then, they would place those features behind a paywall to earn money through paid subscriptions.</p><h4>Headphone Jacks of iPhone</h4><p>In 2016, Apple removed headphone jacks from all of its iPhone models. It freed up space so that Apple could introduce new functionalities in iPhones. It is fair to conclude that Apple ran a conjoint analysis and discovered that customers preferred other features over the headphone jack.</p><h4>Mobile Carrier Services Offering</h4><p>Mobile network service providers often run conjoint analyses to revise plan features to make more profits without losing the customer base. For example, the carrier sends a combination of Attributes like Price, Calls, Mobile Data, International Minutes, and Texts. They can include different Levels for these Attributes. One combination could be Price: $20; Calls: Unlimited; Texts: Unlimited; International Minutes: Zero; Mobile Data: 10 GB shareable. Now, the carrier will analyze all inputs from all the combinations to figure out which combination will fetch the maximum revenue.</p><h4>Creating a New Ice Cream Menu</h4><p>A restaurant or ice cream brand wants to launch new flavors of ice cream. Instead of setting the flavors on their own, they could go to the public with conjoint analysis surveys. The analyses of such survey data would reveal which flavor the customers will like the most.</p><h3>Pros of Conjoint Analysis</h3><p>The analysis makes it possible for businesses to measure the individual preferences of their customers. You can get insights on hidden drivers and include or implement them in your products and services. This study of consumers and features allows you to create a need-based segmentation of the customer base. It makes you aware of the tradeoffs people are willing to make while comparing multiple functionalities.</p><h3>Cons of Conjoint Analysis</h3><p>The design of this analysis is complex in nature. Hence, not everyone can perform it or analyze the data procured by the surveys. Such analysis has to be done regularly. It will be of no use if companies conduct it once a year. If the surveys are not designed properly, they might end up containing overvalued or undervalued variables. When new or unimportant categories are included, respondents might find it difficult to explain or not feel interested at all.</p><h3>In This Article</h3><h4>We Will look at Choice-Based Type of Conjoint Analysis</h4><p>It is the most basic one, where you send a few combinations of features. The customer selects one product from each combination.</p><h3>Let’s Start</h3><p>first we have some Libraries to Use we will load its</p><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt #For Visualization<br>import statsmodels.api as sm #for Logistics regress  <br>import squarify # For Tree Maps PLot</pre><h3>Load Data</h3><p>we have Netflix Dataset you can use your Own Dataset</p><pre>df = pd.read_csv(&#39;netflix_customer_survey.csv&#39;)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*f_w9ekCx-kzk54_s8LuF_A.png" /></figure><h3>Prepare The Data</h3><p>Ok you can see previous section we loaded data and we should prepare it use in our model and we should transform numberic value to Binary Values</p><pre>#Isolated X and y<br>y = df[&#39;selected&#39;]<br>X = df.drop(columns = [&#39;selected&#39;, &#39;customerid&#39;])<br>#Dummy Variebles<br>X_dummy = pd.get_dummies(X, columns=X.columns)</pre><p>So Logistics Regression Model</p><pre>model = sm.OLS(y, X_dummy, family=sm.families.Binomial()).fit()<br>model.summary()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*XUIRUTaKlgp1cwgn0ARkGg.png" /></figure><p>there are so many information and we should use plot to understand this information what does it say about</p><h3>Conjoint Analysis Visualization Section</h3><p>we have arrived visualization Part in this section we know about many thing which is people who want something example cheaper cost or less advertises so on</p><pre>df_result = pd.DataFrame({&#39;param_name&#39;: model.params.keys(),<br>                          &#39;partworths&#39;: model.params.values,<br>                          &#39;pval&#39;:model.pvalues})<br>df_result.head()</pre><p>in here we collect information which are coefficient , names and p_value in one dataset</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*ArlndyXjFOmsJSEZvKXSyQ.png" /></figure><h3>Let’s Ploting</h3><pre>df_result = df_result.sort_values(by=&#39;partworths&#39;, ascending=True)<br>df_result[&#39;is_significant_95&#39;] = (df_result[&#39;pval&#39;] &lt; 0.05)<br>df_result[&#39;color&#39;] = [&#39;blue&#39; if x else &#39;red&#39; for x in df_result[&#39;is_significant_95&#39;]]<br>df_result.head()</pre><p>in this section we create some column to get understandable plot we sorted our data and know about p value if p value greater than then 0.05 give us False else True and we seperated 2 type of color if value is True color is blue else color is red</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*gLjj2sEaopZWteBBh1Geag.png" /></figure><pre>f, ax = plt.subplots(figsize=(14, 8))<br>plt.title(&#39;partworths of feature&#39;, fontsize=20)<br>values = df_result[&#39;partworths&#39;]<br>xbar = np.arange(len(values))<br>plt.barh(xbar, values, color=df_result[&#39;color&#39;])<br>plt.yticks(xbar, labels=df_result[&#39;param_name&#39;])<br>plt.show();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*aC5v08lUWhguNfTiwvpyew.png" /></figure><p>you can see there are clearly define people what they want from Netflix in this Vizualization</p><h3>Specific Driver plot</h3><p>in this Section we create plot which is specific each type of facility example we can see only price people want expensive one or cheaper which option unnecessary which one can be more efficient how many people use which option so on like this</p><pre>#collecting<br>attr = []<br>coeff = []<br>for i in range(len(df_result)):<br>  if df_result.iloc[i, 0].find(&#39;price&#39;) &gt; -1:<br>    attr.append(df_result.iloc[i,0])<br>    coeff.append(df_result.iloc[i,1])<br><br><br>#Ploting <br>f, ax = plt.subplots(figsize=(10, 4))<br>plt.title(&#39;Partworth for each driver&#39;, fontsize = 20)<br>(markers, stemlines, baselines) = plt.stem(attr, coeff,<br>                                           use_line_collection = True)<br>plt.setp(stemlines, linestyle=&#39;-&#39;, color=&#39;skyblue&#39;, linewidth=4)<br>plt.setp(markers, color=&#39;black&#39;, markersize = 10)<br>plt.ylabel(&#39;partworths&#39;, fontsize = 13)<br>plt.xticks(rotation=20, fontsize=13)<br>plt.yticks(fontsize=20)<br>plt.show();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*rRcYxkVu10rVwKgaaTh_eQ.png" /></figure><p>ok you can see there are 6 type of option to choose and many people chose cheaper option</p><h3>Feature importance Section</h3><p>we will prepare our data to Tree map Plot which is how many percentage people use our option</p><pre><br>feature_part_coeff = dict()<br>for key, coeff in model.params.items():<br>  split_key = key.split(&#39;_&#39;)<br>  feature = split_key[0]<br>  if feature not in feature_part_coeff:<br>    feature_part_coeff[feature] = list()<br>  feature_part_coeff[feature].append(coeff)<br><br># Feature Importance max() - min()<br>importance_per_feature = {k: max(v) - min(v) for k, v in feature_part_coeff.items()}<br><br><br>total_feature_importance = sum(importance_per_feature.values())<br><br>relatives_importance_per_feature = {<br>    k:round(100 * v/total_feature_importance, 1) for k, v in importance_per_feature.items()<br>}<br><br><br>df_importance = pd.DataFrame(list(relatives_importance_per_feature.items()),<br>                             columns = [&#39;features&#39;, &#39;relative_importance&#39;]).sort_values(by=&#39;relative_importance&#39;)</pre><p>Ooo Huuu ok we have finished our preparetion to visualize</p><h3>Tree map Ploting</h3><pre>squarify.plot(sizes=df_importance[&#39;relative_importance&#39;],<br>              label = df_importance[&#39;features&#39;],<br>              alpha=0.8,<br>              color = [&#39;green&#39;,&#39;yellow&#39;,&#39;red&#39;,&#39;pink&#39;],<br>              value = df_importance[&#39;relative_importance&#39;],<br>              pad=0.5)<br>plt.axis(&#39;off&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*KSp65QJ9Zwqqf87noxMIrA.png" /></figure><p>ok we have finished our project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*sD3KGgTa8G3QeGt-gDCg-w.png" /></figure><p>I am going to create Interaction Terms in my next Post</p><h3>Conclusion</h3><p>Good Bye until next post</p><p>Assalamu alaykum</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4999d68d42a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction Random Forest Classification By Example]]></title>
            <link>https://medium.com/@mrmaster907/introduction-random-forest-classification-by-example-6983d95c7b91?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6983d95c7b91</guid>
            <category><![CDATA[random-forest]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[classification]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 12:14:11 GMT</pubDate>
            <atom:updated>2023-08-26T12:14:11.217Z</atom:updated>
            <content:encoded><![CDATA[<p>Farkhod Khushvaktov | 2023 26 August <a href="https://www.linkedin.com/in/farkhod-khushvaktov-465459248/">LinkedIn</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i69vGs4AfhdhDUOlaPVLSA.png" /></figure><p>A random forest is a supervised machine learning algorithm that is constructed from decision tree algorithms. This algorithm is applied in various industries such as banking and e-commerce to predict behavior and outcomes.</p><p>This article provides an overview of the random forest algorithm and how it works. The article will present the algorithm’s features and how it is employed in real-life applications. It also points out the advantages and disadvantages of this algorithm.</p><h3>What is a random forest?</h3><p>A random forest is a machine learning technique that’s used to solve regression and classification problems. It utilizes ensemble learning, which is a technique that combines many classifiers to provide solutions to complex problems.</p><p>A random forest algorithm consists of many decision trees. The ‘forest’ generated by the random forest algorithm is trained through bagging or bootstrap aggregating. Bagging is an ensemble meta-algorithm that improves the accuracy of machine learning algorithms.</p><p>The (random forest) algorithm establishes the outcome based on the predictions of the decision trees. It predicts by taking the average or mean of the output from various trees. Increasing the number of trees increases the precision of the outcome.</p><p>A random forest eradicates the limitations of a decision tree algorithm. It reduces the overfitting of datasets and increases precision. It generates predictions without requiring many configurations in packages (like <a href="https://en.wikipedia.org/wiki/Scikit-learn">scikit-learn</a>).</p><h3>Features of a Random Forest Algorithm</h3><ul><li>It’s more accurate than the decision tree algorithm.</li><li>It provides an effective way of handling missing data.</li><li>It can produce a reasonable prediction without hyper-parameter tuning.</li><li>It solves the issue of overfitting in decision trees.</li><li>In every random forest tree, a subset of features is selected randomly at the node’s splitting point.</li></ul><h3>How random forest algorithm works</h3><h4>Understanding decision trees</h4><p>Decision trees are the building blocks of a random forest algorithm. A decision tree is a decision support technique that forms a tree-like structure. An overview of decision trees will help us understand how random forest algorithms work.</p><p>A decision tree consists of three components: decision nodes, leaf nodes, and a root node. A decision tree algorithm divides a training dataset into branches, which further segregate into other branches. This sequence continues until a leaf node is attained. The leaf node cannot be segregated further.</p><p>The nodes in the decision tree represent attributes that are used for predicting the outcome. Decision nodes provide a link to the leaves. The following diagram shows the three types of nodes in a decision tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*azCK0K67pqgxdl12.png" /></figure><p>The information theory can provide more information on how decision trees work. Entropy and information gain are the building blocks of decision trees. An overview of these fundamental concepts will improve our understanding of how decision trees are built.</p><p>Entropy is a metric for calculating uncertainty. Information gain is a measure of how uncertainty in the target variable is reduced, given a set of independent variables.</p><p>The information gain concept involves using independent variables (features) to gain information about a target variable (class). The entropy of the target variable (Y) and the conditional entropy of Y (given X) are used to estimate the information gain. In this case, the conditional entropy is subtracted from the entropy of Y.</p><p>Information gain is used in the training of decision trees. It helps in reducing uncertainty in these trees. A high information gain means that a high degree of uncertainty (information entropy) has been removed. Entropy and information gain are important in splitting branches, which is an important activity in the construction of decision trees.</p><p>Let’s take a simple example of how a decision tree works. Suppose we want to predict if a customer will purchase a mobile phone or not. The features of the phone form the basis of his decision. This analysis can be presented in a decision tree diagram.</p><p>The root node and decision nodes of the decision represent the features of the phone mentioned above. The leaf node represents the final output, either <em>buying</em> or <em>not buying</em>. The main features that determine the choice include the price, internal storage, and Random Access Memory (RAM). The decision tree will appear as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*0f9DgncIvOfikZes.png" /></figure><h4>Applying decision trees in random forest</h4><p>The main difference between the decision tree algorithm and the random forest algorithm is that establishing root nodes and segregating nodes is done randomly in the latter. The random forest employs the bagging method to generate the required prediction.</p><p>Bagging involves using different samples of data (training data) rather than just one sample. A training dataset comprises observations and features that are used for making predictions. The decision trees produce different outputs, depending on the training data fed to the random forest algorithm. These outputs will be ranked, and the highest will be selected as the final output.</p><p>Our first example can still be used to explain how random forests work. Instead of having a single decision tree, the random forest will have many decision trees. Let’s assume we have only four decision trees. In this case, the training data comprising the phone’s observations and features will be divided into four root nodes.</p><p>The root nodes could represent four features that could influence the customer’s choice (price, internal storage, camera, and RAM). The random forest will split the nodes by selecting features randomly. The final prediction will be selected based on the outcome of the four trees.</p><p>The outcome chosen by most decision trees will be the final choice. If three trees predict <em>buying</em>, and one tree predicts <em>not buying</em>, then the final prediction will be <em>buying</em>. In this case, it’s predicted that the customer will buy the phone.</p><h3>Classification in random forests</h3><p>Classification in random forests employs an ensemble methodology to attain the outcome. The training data is fed to train various decision trees. This dataset consists of observations and features that will be selected randomly during the splitting of nodes.</p><p>A rain forest system relies on various decision trees. Every decision tree consists of decision nodes, leaf nodes, and a root node. The leaf node of each tree is the final output produced by that specific decision tree. The selection of the final output follows the majority-voting system. In this case, the output chosen by the majority of the decision trees becomes the final output of the rain forest system. The diagram below shows a simple random forest classifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BeITn6XS4z_DWMTy.png" /></figure><p>Let’s take an example of a training dataset consisting of various fruits such as bananas, apples, pineapples, and mangoes. The random forest classifier divides this dataset into subsets. These subsets are given to every decision tree in the random forest system. Each decision tree produces its specific output. For example, the prediction for trees 1 and 2 is <em>apple</em>.</p><p>Another decision tree (n) has predicted <em>banana</em> as the outcome. The random forest classifier collects the majority voting to provide the final prediction. The majority of the decision trees have chosen <em>apple</em> as their prediction. This makes the classifier choose <em>apple</em> as the final prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*dRrspv4FJVH2SnOO.png" /></figure><h3>Regression in random forests</h3><p>Regression is the other task performed by a random forest algorithm. A random forest regression follows the concept of simple regression. Values of dependent (features) and independent variables are passed in the random forest model.</p><p>We can run random forest regressions in various programs such as <a href="https://en.wikipedia.org/wiki/SAS_(software)">SAS</a>, R, and python. In a random forest regression, each tree produces a specific prediction. The mean prediction of the individual trees is the output of the regression. This is contrary to random forest classification, whose output is determined by the mode of the decision trees’ class.</p><p>Although random forest regression and linear regression follow the same concept, they differ in terms of functions. The function of linear regression is y=bx + c, where y is the dependent variable, x is the independent variable, b is the estimation parameter, and c is a constant. The function of a complex random forest regression is like a blackbox.</p><h3>Let’s Example</h3><p>First we should load some Library</p><pre>import pandas as pd<br>import numpy as np</pre><p>And We should load Dataset from My <a href="https://drive.google.com/file/d/1LQisSaHr2ftHGHRIHRC36fGgFEEwwytB/view?usp=drive_link">Drive </a>you can load there</p><pre>df = pd.read_csv(&#39;CreditCard.csv&#39;)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*QXWySGWJ-xNWpNOP5jlW8Q.png" /></figure><h3>Transform into Numerical Data and Isolate</h3><pre>df = pd.get_dummies(data=df, drop_first=True)<br>#Isolated X and y<br>y = df.card_yes<br>X = df.drop(columns=[&#39;card_yes&#39;])<br>X.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXEx615Xv1WqlVIqrTKJ2Q.png" /></figure><h3>Split in Train and Test data</h3><pre>from sklearn.model_selection import train_test_split<br>X_train, X_test, y_train, y_test = train_test_split(X, y,<br>                                                    test_size=0.2,<br>                                                    random_state = 42,<br>                                                    stratify = y)<br>len(X_train), len(X_test), len(y_train), len(y_test)</pre><p>OUTPUT&gt;&gt; (1055, 264, 1055, 264)</p><h3>Random Forest Model Created</h3><pre>from sklearn.ensemble import RandomForestClassifier<br><br>model = RandomForestClassifier(n_estimators = 50,<br>                               random_state = 42)<br><br>model.fit(X_train, y_train)</pre><h3>Prediction</h3><pre>model_predict = model.predict(X_test)<br>from sklearn.metrics import classification_report, f1_score<br>print(classification_report(y_test, model_predict))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*ZLNwHSZ1aanVE1uz2j8sEg.png" /></figure><h3>F1 Score</h3><pre>f1_score(y_test, model_predict)</pre><p>OUTPUT&gt;&gt; 0.9800995024875622</p><p>Ploting Our Output</p><pre>importance = pd.Series(model.feature_importances_,<br>                       index = X_train.columns.values)<br>importance.nlargest(5).plot(kind=&#39;barh&#39;,<br>                            figsize = (6,4));</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*BGelTYmFz2NN35g_uI8wow.png" /></figure><h3>Parameter Tuning Section</h3><pre>from sklearn.model_selection import ParameterGrid<br>param_grid = {&#39;n_estimators&#39;: range(50, 500, 50)}<br>grid = ParameterGrid(param_grid)<br><br><br>#list<br>f1score = []<br>for params in grid:<br>  model = RandomForestClassifier(n_estimators = params[&#39;n_estimators&#39;],<br>                                 random_state = 1502)<br>  model.fit(X_train, y_train)<br><br>  predict = model.predict(X_test)<br><br>  f1 = f1_score(y_test, predict)<br><br>  f1score.append(f1)<br><br>grid[np.argmax(f1)]</pre><p>OUTPUT &gt;&gt; {‘n_estimators’: 50}</p><h3>CONCLUSION</h3><p>I hope It can Be Interesting</p><p>Assalamu Alaykum</p><p>Good Bye</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6983d95c7b91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gaussian Mixture Model By Example in Python]]></title>
            <link>https://medium.com/@mrmaster907/gaussian-mixture-model-by-example-in-python-f3891f51eccd?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3891f51eccd</guid>
            <category><![CDATA[segmentation]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[matching]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Fri, 25 Aug 2023 10:29:05 GMT</pubDate>
            <atom:updated>2023-08-25T10:29:05.942Z</atom:updated>
            <content:encoded><![CDATA[<p>Farkhod Khushvaktov | 2023 25 August <a href="https://www.linkedin.com/in/farkhod-khushvaktov-465459248/">LinkedIn</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Y8UdpS_QtRfXGSfWBQPakg.png" /></figure><p>Clustering is one of the popular problems in the field of unsupervised learning. It is majorly used for identifying different groups in a given dataset based on similar characteristics. There are many algorithms available for clustering that can be used according to the requirement. Some of them are specific to data while some of them can work with any kind of data. Gaussian Mixture Model (GMM) is one of the methods used for <a href="https://analyticsindiamag.com/hands-on-guide-to-rock-clustering-algorithm/">clustering.</a> In this article, we will understand in detail mixture models and the Gaussian mixture model that is used for clustering purposes. The major points to be discussed in this article are listed below.</p><h3>What are the Mixture Models?</h3><p>In the field of unsupervised learning, probabilistic models which represent the probability of the presence of clusters within the overall population can be considered as mixture models.</p><p>These are not models since they are similar to the mixture distribution. Mixture distribution is a probability distribution of the data points in the data space. The basic approach of mixture distribution is that they derive the properties of the overall data space while mixture models are used to make inferences about the properties of the clusters presented in the data space.</p><p>A general structure of a finite-dimensional mixture model consists of the following components:</p><ul><li>K components from the similar parametric family of distributions (normal distribution or Zipfian distribution) with different parameters. Where N random variables are distributed according to a mixture of components and random variables are observed.</li><li>N random variables that are not directly observed specify the mixture components of each observation and are distributed in the data space according to categorical distribution.</li><li>K mixture probabilities sets( sum of the probabilities is 1)</li><li>K parameter sets where each parameter can also be a set and each parameter specifies its mixture components.</li></ul><p>A basic mixture model can be represented as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/0*d-g0cmgpVMPJtI-1.png" /></figure><p>In addition, in a Bayesian setting where all the parameters are associated with a random variable (probabilities and parameters are random variables themselves), the structure can be represented as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/0*DKC5rnWRhKKx_Ju3.png" /></figure><p>In this kind of structure, the set of probabilities is similar to the k-dimensional random vector derived from the conjugate prior to the categorical distribution. The parameters are distributed by their respective conjugate prior.</p><p>Common probability distributions used for the distribution of the mixture components are:</p><ul><li>Gaussian or normal distribution</li><li>Binomial Distribution</li><li>Multinomial Distribution</li><li>Negative binomial distribution</li><li>Possession distribution</li><li>Exponential distribution</li><li>Lognormal distribution</li><li>Multivariate normal distribution</li><li>Multivariate t-distribution</li><li>Bernoulli distribution</li></ul><p>Mostly in the basic models, F and H represent the distribution of observation and parameters. Gaussian distribution is used in the case of real-valued observation and categorical distribution is used in the case of discrete observations.</p><p>Different types of mixture models are:</p><ul><li>Gaussian mixture model.</li><li>Multivariate gaussian mixture model</li><li>Categorical mixture model</li></ul><p>Let’s discuss the Gaussian mixture model. Before that, let’s have an understanding of Gaussian distribution.</p><h3>Gaussian Mixture Model Explain</h3><p>In the world of Machine Learning, we can distinguish two main areas: Supervised and unsupervised learning. The main difference between both lies in the nature of the data as well as the approaches used to deal with it. Clustering is an unsupervised learning problem where we intend to find clusters of points in our dataset that share some common characteristics. Let’s suppose we have a dataset that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*hrm837-DiaAJd0sY.png" /></figure><p>Our job is to find sets of points that appear close together. In this case, we can clearly identify two clusters of points which we will colour blue and red, respectively:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*DEhL2muTkZ23ZhOK.png" /></figure><p>Please note that we are now introducing some additional notation. Here, μ1 and μ2 are the centroids of each cluster and are parameters that identify each of these. A popular clustering algorithm is known as K-means, which will follow an iterative approach to update the parameters of each clusters. More specifically, what it will do is to compute the means (or centroids) of each cluster, and then calculate their distance to each of the data points. The latter are then labeled as part of the cluster that is identified by their closest centroid. This process is repeated until some convergence criterion is met, for example when we see no further changes in the cluster assignments.</p><p>One important characteristic of K-means is that it is a <em>hard clustering method</em>, which means that it will associate each point to one and only one cluster. A limitation to this approach is that there is no uncertainty measure or <em>probability</em> that tells us how much a data point is associated with a specific cluster. So what about using a soft clustering instead of a hard one? This is exactly what Gaussian Mixture Models, or simply GMMs, attempt to do. Let’s now discuss this method further.</p><h3>Let’s Some Code Example</h3><p>We Have Some Library we Should load its in our colab</p><pre>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt<br>from sklearn.mixture import GaussianMixture</pre><h3>Load Dataset</h3><p>I have DataSet Which Located on <a href="https://drive.google.com/file/d/1xsij6v0hVJL5Ef16CS6O9C8ZGFjNcdhl/view?usp=drive_link">Drive </a>you can load it from link</p><pre>df = pd.read_csv(&quot;CreditCard.csv&quot;)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YB7gcPgqlSQzb1k9VHUCtQ.png" /></figure><h3>Data Preparation Section</h3><p>We used Dummies function to transform to binary</p><pre>df = pd.get_dummies(df, drop_first = True) # DROP_FIRST arg transform only 1 column 1 or 0<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f0cl0w4RW4Sst62dI4xtjQ.png" /></figure><h3>Gaussian Mixture Model Section</h3><p>First We fitted 10 time in list such as we were going to know BIC And AIC which helps us determining the optimal number of clusters and We should plot our BIC and AIC List of result to Know Clusters Number</p><pre>#Prepare<br>n_conponent = np.arange(1,10)<br><br>#Create GGM Model<br>models = [GaussianMixture(n_components = n,<br>                          random_state=42).fit(df) for n in n_conponent]<br>#Plot<br>plt.plot(n_conponent,<br>         [m.bic(df) for m in models],<br>         label = &#39;BIC&#39;)<br>plt.plot(n_conponent,<br>         [m.aic(df) for m in models],<br>         label = &#39;BIC&#39;)<br>plt.legend()<br>plt.xlabel(&quot;Number Of Component&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*ZEVzXjpEls5YGy5uFq9ghQ.png" /></figure><p>as you can see there are 3 is Optimal Clusters Number</p><h3>Create GM Model And Predict</h3><pre># create GM Models<br>model = GaussianMixture(n_components=3,<br>                        random_state=42).fit(df)<br>cluster = pd.Series(model.predict(df))<br>df[&#39;cluster&#39;] = cluster<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wP45hGtbcm2qNQm6Jwm5ag.png" /></figure><pre>df.cluster.value_counts()</pre><p>1 720</p><p>2 303</p><p>0 296</p><p>Name: cluster, dtype: int64</p><pre>pd.DataFrame(model.means_,<br>             columns = list(df.iloc[:, :-1].columns))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GXNP9dZ4UA1E45gEKZfNeQ.png" /></figure><p>as you can that there are 3 type of cluster I Hope you can read from photo</p><h3>Conclusion</h3><p>Thank you to look my analytics post I hope you interested it</p><p>Assalamu Alaykum</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3891f51eccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RFM Model and Segmentation Analysis in python]]></title>
            <link>https://medium.com/@mrmaster907/rfm-model-and-segmentation-analysis-in-python-5ebb35c1c8af?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ebb35c1c8af</guid>
            <category><![CDATA[segmentation]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[rfm-analysis]]></category>
            <category><![CDATA[rfm]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 03:53:26 GMT</pubDate>
            <atom:updated>2023-08-24T03:53:26.306Z</atom:updated>
            <content:encoded><![CDATA[<p>Farkhod Khushvaktov | 2023 24 August <a href="https://www.linkedin.com/in/farkhod-khushvaktov-465459248/">LinkedIn</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvUvolslZhm3ib51n1ibug.png" /></figure><p>In this article, we are going to see Recency, Frequency, Monetary value analysis using Python. But first, let us understand the RFM analysis briefly.</p><h3>What is RFM analysis?</h3><p>RFM stands for recency, frequency, monetary value. In business analytics, we often use this concept to divide customers into different segments, like high-value customers, medium value customers or low-value customers, and similarly many others.</p><p>Let’s assume we are a company, our company name is geek, let’s perform the RFM analysis on our customers</p><ol><li>Recency: How recently has the customer made a transaction with us</li><li>Frequency: How frequent is the customer in ordering/buying some product from us</li><li>Monetary: How much does the customer spend on purchasing products from us.</li></ol><h3>What is Customer Segmentation?</h3><p>Customer segmentation is the process of dividing customers into groups or clusters based on common characteristics.</p><p>In Business to Business model, the company can segment customers based on various factors like</p><ul><li>Demographic (Age, Gender, Occupation, Marital Status)</li><li>Geographic (Location, Region, Urban/Rural)</li><li>Behavioral (Spending, Consumption, Usage)</li><li>Psychographic (Lifestyle, Social Status, Personality)</li></ul><h3>Need for Customer Segmentation</h3><ul><li>To identify the most potential customers</li><li>To easily communicate with a targeted group of the audience</li><li>To improve the quality of service, loyalty, and retention</li><li>Better understanding needs of the customer in each segment</li><li>For better upselling and cross-selling of products</li><li>To identify new products that customers could be interested in</li></ul><h3>Let’s Start</h3><ul><li>We should Load Some Libraries to use in Our Model</li></ul><pre>import pandas as pd<br>import matplotlib.pyplot as plt<br>import numpy as np<br>from datetime import timedelta</pre><ul><li>I use Online Shopper Csv file from my computer to analysis and Load Our Dataset Download my google Drive <a href="https://drive.google.com/file/d/1pyIwSlvWr6-foR4e-bGkzKoI68uib86l/view?usp=drive_link"><strong>link</strong></a></li></ul><pre>data = pd.read_csv(&quot;online_shoppers.csv&quot;,<br>                   encoding = &#39;ISO-8859-1&#39;).dropna()<br>data.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*9gXrSZ1b3iYDy4hNxUk_SQ.png" /></figure><ul><li>We can Create New Sales Column why because after that we can create Monetory columns for model</li><li>we can tranform invoiceDate to date format from Object</li><li>get Max Value to find last purchase date and add 1 day in max value</li></ul><pre>data[&#39;Sales&#39;] = data[&#39;Quantity&#39;] * data[&#39;UnitPrice&#39;]<br>#date - transform dates format <br>data[&#39;InvoiceDate&#39;] = pd.to_datetime(data[&#39;InvoiceDate&#39;])<br>#get last date for Recently version <br>snapshot_date = data[&#39;InvoiceDate&#39;].max() + timedelta(days = 1)<br>snapshot_date</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*KI1rrZ7DiziG5ZrBquUMDQ.png" /></figure><ul><li>We going to create Aggregate Function which help us to create RFM</li></ul><pre># Aggregate Function<br>df = data.groupby([&#39;CustomerID&#39;]).agg({<br>    &#39;InvoiceDate&#39; : lambda x: (snapshot_date - x.max()).days, # it gets one CustomerID and get that customer&#39;s max date and divide last date result transform to days<br>    &#39;InvoiceNo&#39;: &#39;count&#39;,<br>    &#39;Sales&#39;: &#39;sum&#39;<br>})<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*vVJHOx5Rev9NjsPiu-drIw.png" /></figure><ul><li>Create Moneratory Column</li><li>Remove Sales column after create monetory</li></ul><pre>#create basket / Moneratary <br>df[&#39;Moneratary&#39;] = df.Sales / df.InvoiceNo<br>#Remove Sales Column<br>df = df.drop(columns = &#39;Sales&#39;)</pre><ul><li>Rename of our columns to RFM</li></ul><pre>#Rename Columns<br>df.rename(columns={&#39;InvoiceDate&#39;: &#39;Recency&#39;,<br>                   &#39;InvoiceNo&#39;:&#39;Frequency&#39;}, inplace=True)</pre><ul><li>split 4 type of score of our dataset</li></ul><pre>df[&#39;F&#39;] = pd.qcut(x = df[&#39;Frequency&#39;], q=4, labels=range(1,5,1))<br>df[&#39;M&#39;] = pd.qcut(x = df[&#39;Moneratary&#39;], q=4, labels=range(1,5,1))<br>df[&#39;R&#39;] = pd.qcut(x = df[&#39;Recency&#39;], q=4, labels=range(4, 0, -1))<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*Hm9z3-v30hiNb7TA0LV9FA.png" /></figure><ul><li>RFM Score Preparation Section</li><li>RFM Function to find which one is super, high, future, low customer</li></ul><pre>df[&#39;RFM&#39;] = df[[&#39;R&#39;, &#39;F&#39;, &#39;M&#39;]].sum(axis=1)<br><br>#Create RFM Function to Score<br>def rfm_segment(df):<br>  if df.RFM &gt;= 11:<br>    return &#39;SuperStar&#39;<br>  elif ((df.RFM &gt;= 8) and (df.RFM &lt; 11)):<br>    return &quot;Future Champion&quot;<br>  elif ((df.RFM &gt;=6) and (df.RFM &lt; 8)):<br>    return &quot; High Potential&quot;<br>  else:<br>    return &quot;Low Relevance&quot;</pre><ul><li>Apply Function</li></ul><pre>df[&quot;RFM_level&quot;] = df.apply(rfm_segment, axis=1)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*R3ccRMvJXfuwYDfOkEgpKw.png" /></figure><h3>Summary of our Model</h3><ul><li>Group by RFM_model in aggregate function</li></ul><pre>df.groupby(&#39;RFM_level&#39;).agg({<br>    &#39;Recency&#39;: &#39;mean&#39;,<br>    &#39;Frequency&#39;: &#39;mean&#39;,<br>    &#39;Moneratary&#39;: &#39;mean&#39;<br>})</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*L7dsWc-a_tfIpWy20ge2hA.png" /></figure><h3>Conclusion</h3><p>I hope you it is useful for you to improve your skill and your future problem solve skill</p><p>Assalamu Alaykum Dear My Brothers</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ebb35c1c8af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Matching Analysis in Python ( Example )]]></title>
            <link>https://medium.com/@mrmaster907/data-matching-analysis-in-python-example-7299a241d837?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7299a241d837</guid>
            <category><![CDATA[data-matching]]></category>
            <category><![CDATA[causal-inference]]></category>
            <category><![CDATA[matching]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 12:43:46 GMT</pubDate>
            <atom:updated>2023-08-23T12:43:46.679Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Matching Analysis in Python</h3><p>Farkhod Khushvaktov | 2023 23 August</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*hGpvhnlFNLEQd1NH.jpg" /></figure><p>Data Matching is the task of finding records that refer to the same entity. Normally, these records come from multiple data sets and have no common entity identifiers, but data matching techniques can also be used to detect duplicate records within a single database.</p><p>Identifying and matching records across multiple data sets is a very challenging task for many reasons. First of all, the records usually have no attribute that makes it straightforward to identify the ones that refer to the same entity, so it is necessary to analyze attributes that provide partial identification, such as names and dates of birth (for people) or title and brands (for products). Because of that, data matching algorithms are very sensitive to data quality, which makes it necessary to pre-process the data being linked in order to ensure a minimal quality standard, at least for the key identifier attributes.</p><p>Another fact that introduces additional complexity to this problem is that data can change over time. For example, if two databases of people information are being matched against each other, it is not rare to find cases where the same person has different addresses (since people occasionally move) or even different names (since people can get married or divorced).</p><p>Data matching problems generally have no training data available (a data set with matches that we know are valid across the analyzed databases) and so it is not easy to approach the problem with a supervised learning algorithm, as it would be possible in many machine learning applications.</p><p>The databases that are subject of data matching analysis can be very large. In the worst case, each record of one database has to be compared to all other records on the other one. Tasks like this can be extremely computationally expensive and hard to be accomplished in feasible time, since this approach involves an algorithm with quadratic complexity. To deal with this situation and make the data matching scalable, some kind of indexing technique can be applied to reduce the number of record pairs that will be compared, but it is not always easy to design an index that removes most non-matches and, at the same time, does not affect the quality of the matching pairs.</p><h3>Example</h3><ul><li><strong>E-Commerce</strong>: this area has grown dramatically in the past few years and it is common for many comparison shopping platforms to have to link products from multiple online stores that have different descriptions. For example, Store A can have the product <em>Notebook — X35 8GB RAM 13&quot; LED </em>and Store B can refer the same notebook as <em>13&quot; X35 Notebook 8GB RAM 500GB HD.</em></li></ul><h3>Let’s Start Coding</h3><p>First We Should Download Causal Inference Library</p><pre>!pip install Causalinference</pre><p>And we should Call some Libraries to use into Matching</p><pre>#Libraries<br>import pandas as pd<br>import numpy as np<br>import matplotlib.pyplot as plt<br>import seaborn as sns<br>import scipy.stats as st<br>from causalinference import CausalModel</pre><p>OK you can see there are some new Library which are Scipy stats and Causal inference</p><h3>Load Dataset from Directory</h3><pre>df = pd.read_csv(&#39;school.csv&#39;)<br>df = df.iloc[:, 1 : ]<br>df.head()</pre><p>We drop some unnecessary columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X6coWZurwwaN-C6vT8urfQ.png" /></figure><h3><strong>Let’s T Test with loop</strong></h3><p>we going to T_test by catholic column we will split 0 and 1 / yes or no version in loop of each column</p><pre>columns = [&#39;number_places_lived&#39;,&#39;mom_age&#39;, &#39;dad_age&#39;, &#39;mom_score&#39;, &#39;dad_score&#39;]<br>stat = {}<br>p_value = {}<br><br>for i in columns:<br>  group1 = df.where(df[&quot;catholic&quot;] == 0).dropna()[i]<br>  group2 = df.where(df[&#39;catholic&#39;] == 1).dropna()[i]<br>  stat[i], p_value[i] = st.ttest_ind(group1, group2)<br>p_ttest = pd.DataFrame.from_dict(data = p_value, orient=&quot;Index&quot;)<br>p_ttest.columns = [&quot;P_values&quot;]<br>p_ttest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/211/1*wVWtycbgpjpszr6sEIZpew.png" /><figcaption>Our Result</figcaption></figure><p>if P_value greater than 0.5 it is similar else on similar</p><h3>Let’s Chi Square Analysis</h3><p>in this section we are going to do chi square therefore we use crosstab function to make categorical data I recommend crosstab function to use how does it work for yourself</p><pre>categorical = [&#39;poverty&#39;, &#39;food_stamps&#39;]<br>p = {}<br><br>for i in categorical:<br>  tap = pd.crosstab(index=df[i],<br>                  columns=df[&quot;catholic&quot;])<br>  stat, p[i], dof, exf = st.chi2_contingency(tap)<br>Chisquare = pd.DataFrame.from_dict(p, &#39;Index&#39;)<br>Chisquare.columns = [&#39;p_value&#39;]<br>Chisquare</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*sJhJDLnqBvnyLBWKQ_9n5A.png" /></figure><h3>Let’s Data Preparation Section</h3><p>First we have some text column like Race, mom_education and dad_education we should transform to Binary data therefore we will do</p><pre>df.race.value_counts()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*HGGbcsWjj8Q2_q_bnUbenA.png" /></figure><p>Transform all text column in one code space because there are many code</p><pre>df[&#39;race_white&#39;] =  np.where(df.race == &#39;WHITE, NON-HISPANIC&#39;, 1, 0)<br>df[&#39;race_hispanic&#39;] =  np.where((df.race == &#39;HISPANIC, RACE NOT SPECIFIED&#39;) |<br>                                (df.race == &#39;HISPANIC, RACE NOT SPECIFIED&#39;), 1, 0)<br>df[&#39;race_black&#39;] =  np.where(df.race == &#39;BLACK OR AFRICAN AMERICAN, NON-HISPANIC&#39;, 1, 0)<br>df[&#39;race_asian&#39;] =  np.where(df.race == &#39;ASIAN&#39;, 1, 0)<br><br># Mom_education and Dad_education transform <br>df[&#39;dad_higher_education&#39;] = np.where((df.dad_education == &quot;BACHELOR&#39;S DEGREE&quot;) |<br>                                      (df.dad_education == &quot;MASTER&#39;S DEGREE (MA, MS)&quot;) |<br>                                      (df.dad_education == &quot;DOCTORATE OR PROFESSIONAL DEGREE &quot;), 1, 0)<br>df[&#39;mom_higher_education&#39;] = np.where((df.mom_education == &quot;BACHELOR&#39;S DEGREE&quot;) |<br>                                      (df.mom_education == &quot;MASTER&#39;S DEGREE (MA, MS)&quot;) |<br>                                      (df.mom_education == &quot;DOCTORATE OR PROFESSIONAL DEGREE &quot;), 1, 0)<br><br># data cleaning from text column after transform<br>df = df.drop(columns = [&#39;race&#39;,&#39;dad_education&#39;, &#39;mom_education&#39;])</pre><h3>Isolate treat y confounder data</h3><p>We should isolate data to make model</p><pre>#Isolate Confounder, Treat, y<br>treat = df.catholic.values<br>y = df.score_standardized.values<br>confounder = df.drop(columns = [&#39;catholic&#39;, &#39;score_standardized&#39;]).values</pre><h3>Common Support Region</h3><p>We can use logistic regression to understand better and visualize</p><pre>import statsmodels.api as st<br>confounder_csr = st.add_constant(confounder)<br>csr_model = st.Logit(treat, confounder_csr).fit()<br>print(csr_model.summary())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*_wbTzPk-h3VIpByS8TZbLA.png" /></figure><p>Now We compare to Visualize our model probability result</p><pre>#model Predict <br>probabilities = csr_model.predict(confounder_csr)<br>#add actual value and predicted value into one list each other<br>df_prop = np.vstack([treat, probabilities]) # vstack add 2 list to 1 list<br>df_prop = np.transpose(df_prop) # this transpose function add each if there are 2 list into one list example i[0][0] + i[1][0]<br># split treated values and non_treated values<br>non_treat = df_prop[:, 0] == 0 # get only 0 index have been 0 value<br>non_treat = df_prop[non_treat, 1] #this function get 1 index from the list of each index<br>treated = df_prop[:, 0] == 1<br>treated = df_prop[treated, 1]<br><br><br></pre><p>it is ready to visualize with logistic regression</p><pre>sns.kdeplot(non_treat, shade= True, color = &#39;Red&#39;)<br>sns.kdeplot(treated, shade= True, color = &#39;green&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*EatneAiC15imAyp7c2J_bg.png" /></figure><p>this our predicted value’s plot version</p><h3>Let’s Matching Model</h3><pre>model = CausalModel(y, treat, confounder)<br>model.est_via_matching(bias_adj = True)<br>print(model.estimates)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*LIFb1YjpJ-H7sI-n9trfGg.png" /></figure><p>we need ate values</p><pre>model.estimates[&#39;matching&#39;][&#39;ate&#39;]</pre><p>OUTPUT&gt;&gt; -0.156209947464663</p><p>conclusion We can Robustness</p><pre>ate = {}<br>i = 1<br>while i &lt; 100:<br>  #Sampling<br>  sample = df.sample(1000)<br>  #Isolate y, treat, confounder<br>  treat = sample.catholic.values<br>  y = sample.score_standardized.values<br>  confounder = sample.drop(columns = [&#39;catholic&#39;, &#39;score_standardized&#39;]).values<br>  #Matching Model<br>  model = CausalModel(y, treat, confounder)<br>  model.est_via_matching(bias_adj = True)<br>  #Store Ate<br>  ate[i] = model.estimates[&#39;matching&#39;][&#39;ate&#39;]<br><br>  #Increase number of Loop<br>  i += 1</pre><p>and we can plot its values to understand what happen how relationship eath other</p><pre>ate = pd.Series(ate)<br>print(ate.hist())<br>print(ate.mean())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*2RQ8-JODudTUFWooFSh_5w.png" /></figure><p>OOOHH Yeah we have done it</p><p>have good day Bye</p><p>Assalamu Alaykum</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7299a241d837" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Causal Impact in Python (Example)]]></title>
            <link>https://medium.com/@mrmaster907/how-to-use-causal-impact-in-python-example-18d27623e896?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/18d27623e896</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[causal-impact]]></category>
            <category><![CDATA[google-impact-challenge]]></category>
            <category><![CDATA[causal-inference]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Mon, 21 Aug 2023 15:12:10 GMT</pubDate>
            <atom:updated>2023-08-21T15:12:10.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Q_wuNrUArpIBnx-3iuhp-Q.jpeg" /></figure><p>21 August 2023 | By Farkhod Khushvaktov</p><p><strong>In this tutorial we will learn how to use Causal Impact in Python programing language</strong></p><ul><li>simple using the yfinance library to load data</li><li>using the pycausalimpact</li></ul><blockquote><em>Causal Impact is a package created by Kay H. Brodersen that uses Bayesian statistics to infer the causal effect of an event.</em></blockquote><h3>How to format your data for CausalImpact</h3><p>causalimpact can be used in two way</p><ul><li>simple pre-post experiment</li><li>using control group</li></ul><h3>Simple pre-post experiment</h3><p>Your dataset should be a table with dates and a single y column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/0*0U_JsXn8TrZUrM3-" /></figure><ul><li>The date column</li><li>The y column contains data from a single site.</li></ul><h3>Using control groups</h3><p>When <strong>comparing against control groups</strong>, your dataset should be a table like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*N0-x43g41BjQU7CO" /></figure><ul><li>dates</li><li>y column containing data from the sites which you tested on</li><li>Xn columns containing data from the sites/subfolders which the test was not turned on. Each X column represents a different feature.</li></ul><h3>Defining test and control groups</h3><p>Control groups in causal inference are datasets that are not impacted by an experiment than can used to improve the prediction on your test data.</p><p>Control groups can be different things:</p><ol><li>Independent data such as search trends of a topic in Google Trends</li><li>Different TLD (example1.com, example2.com)</li><li>Different ccTLD (example.com, example.ca)</li><li>Different subdomains (ca.example.com, au.example.com)</li><li>Different subfolders (example.com/ca, example.com/au)</li></ol><p>By convention, the test group is usually labelled as y and the control groups as X.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*EorQzzOAkKQZjC4m" /></figure><h3><strong>Getting Start</strong></h3><p>First install Some Libraries like this</p><pre>#installing Libraries<br><br>!pip install yfinance<br>!pip install pycausalimpact</pre><p>you can see that are two libraries</p><h3>Import modules</h3><p>So We have some Module to use it</p><pre>import yfinance as yf<br>from causalimpact import CausalImpact<br>import pandas as pd<br>import seaborn as sns<br>import matplotlib.pyplot as plt<br></pre><h3>Set Dates to load data</h3><pre>#Dates<br>training_start = &quot;2020-09-01&quot;<br>training_end = &quot;2020-10-19&quot;<br>treatment_start = &quot;2020-10-20&quot;<br>treatment_end = &quot;2020-10-23&quot;<br>end_stock = &quot;2020-10-24&quot;</pre><p>as you can see that there are some dates to load data from yfinance library</p><h3>Load Financial Data</h3><pre>#Bitcoin<br>y = [&quot;BTC-USD&quot;]<br>y = yf.download(tickers=y,<br>                start=training_start,<br>                end=end_stock,<br>                interval=&quot;1d&quot;)<br>y = y[&quot;Adj Close&quot;].rename(&quot;y&quot;)<br>y[:1]</pre><p>this data our Y values as you can see</p><h3>Load More Data</h3><pre>#Load More Data<br>Stock = [&quot;ZAL.DE&quot;, &quot;SQ&quot;, &quot;CRSP&quot;, &quot;TRMB&quot;, &quot;JD&quot;, &quot;KTOS&quot;, &quot;GOOG&quot;]<br>X = yf.download(tickers=Stock,<br>                start = training_start,<br>                end = end_stock,<br>                interval =&quot;1d&quot;)</pre><p>in this code example you can see yf library this library can load data from financial site</p><pre>X.tail()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZSqxsjjsONk2OuIN0koow.png" /></figure><h3>Data Preparation</h3><p>First we can get data only as size as previous list of data</p><pre>X = X.iloc[:,:len(Stock)]<br>X.head(1)<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*YQVr5FgavS3vQ9D8so1XrA.png" /></figure><h3>Remove Adj Close and Set Time Zone</h3><p>Then we can remove <em>Adj Close</em> column from the table</p><pre>#remove droplevel column<br>X.columns = X.columns.droplevel()<br>X.head(1)<br><br>#Time Zones<br>X.index = X.index.tz_localize(None)</pre><h3>Add y column to X column</h3><pre>X = pd.concat([y, X], axis=1).dropna()<br>X.tail()</pre><p>If you do not use dropna() function you will have some error because there will exist some Null Value in top of data</p><h3>Data Analysis Section</h3><p>First Split training data</p><pre>df_training = X.loc[X.index &lt;= training_end]<br>df_training.tail(2)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*395VshlaV_aSZbfNRih8Vg.png" /></figure><h3>Change Percentege of Data</h3><pre>differencing = X.pct_change().dropna()<br>differencing</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*EU4J9RFSRhF5RfJL8NnE6Q.png" /></figure><p>as you can see we use pct_change function to predict better</p><h3>Let’s Correlate</h3><pre>plt.figure(figsize=(10, 6))<br>sns.set(font_scale = 1.2)<br>sns.heatmap(data = differencing.corr(),<br>            annot = True,<br>            fmt = &quot;.2g&quot;,<br>            linewidth = 1,<br>            cmap = &quot;PiYG&quot;,<br>            linecolor = &#39;black&#39;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*WtrzbwQQiR15dGruO6u0vA.png" /></figure><h3>Causal Impact Section</h3><p>We will do some change and split dates</p><pre>df_final = X.drop(columns = [&#39;ZAL.DE&#39;])<br>df_final.tail()<br>pre_period = [training_start, training_end]<br>post_period = [treatment_start, treatment_end]</pre><h3>ready to start to use causal impact</h3><pre>impact = CausalImpact(df_final, pre_period, post_period)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*L1Dd-A2truxz7VGfHqgvWg.png" /></figure><h3>Summary</h3><pre>print(impact.summary(&#39;report&#39;))</pre><p>OUTPUT&gt;&gt;</p><p>Analysis report {CausalImpact}</p><p>During the post-intervention period, the response variable had an average value of approx. 12659.36. By contrast, in the absence of an intervention, we would have expected an average response of 11189.03. The 95% interval of this counterfactual prediction is [10935.4, 11453.53]. Subtracting this prediction from the observed response yields an estimate of the causal effect the intervention had on the response variable. This effect is 1470.33 with a 95% interval of [1205.83, 1723.97]. For a discussion of the significance of this effect, see below.</p><p>Summing up the individual data points during the post-intervention period (which can only sometimes be meaningfully interpreted), the response variable had an overall value of 50637.46. By contrast, had the intervention not taken place, we would have expected a sum of 44756.14. The 95% interval of this prediction is [43741.58, 45814.14].</p><p>The above results are given in terms of absolute numbers. In relative terms, the response variable showed an increase of +13.14%. The 95% interval of this percentage is [10.78%, 15.41%]. This means that the positive effect observed during the intervention period is statistically significant and unlikely to be due to random fluctuations. It should be noted, however, that the question of whether this increase also bears substantive significance can only be answered by comparing the absolute effect (1470.33) to the original goal of the underlying intervention.</p><p>The probability of obtaining this effect by chance is very small (Bayesian one-sided tail-area probability p = 0.0). This means the causal effect can be considered statistically significant.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18d27623e896" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bigfoot Sighting Data Analysis With Power BI]]></title>
            <link>https://medium.com/@mrmaster907/bigfoot-sighting-data-analysis-with-power-bi-fdbfcd633c74?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdbfcd633c74</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 10:26:56 GMT</pubDate>
            <atom:updated>2023-08-11T13:17:21.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*t51p-zupWBuPt-igkE77ZQ.png" /></figure><h3>Reports</h3><p>The most useful file in the dataset is probably bfro_reports_geocoded.csv.<br>It contains the most relevant fields in the full reports joined against the report locations, and also now contains the weather conditions the day of the sighting.<br>The weather conditions were obtained using the Dark Sky API<br>There&#39;s also a little data cleaning applied to this dataset around the timestamps and lat/lon values.<br>Not all of the full text reports have a corresponding geocoded report - in that case the geo information is null.</p><p>Each geocoded report obviously contains a latitude and longitude value.<br>It also contains a report title, report number, and report classification.<br>Report classifications are explained on the BFRO website <a href="http://www.bfro.net/GDB/classify.asp">here</a>, but basically the classification determines the nature of the incident — direct sighting, noises, tracks, etc.<br>There are also timestamps.<br>Aside from the titles, the data in this file is structured.</p><p>The full text reports contain a variety of information about the sighting such as the nearest town, other witnesses, environmental conditions, and a full, multi-paragraph description of the incident.<br>Not all fields are present in all reports, which is why I chose line delimited JSON.<br>The data in this file is unstructured for the most part.</p><h3>Let’s Visualize</h3><figure><img alt="Sorted by sighting in bigfoot dataset" src="https://cdn-images-1.medium.com/max/382/1*yZoEf9wxSWb2wHj40VEk9w.png" /></figure><p>So you can see this which sorted by Sighting this data illustrate that there are Almost all of state Located in US</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/1*uLrzCdkreAkC-bUDWlZm_w.png" /></figure><p>Ok as you can see that which is Line and I splitted seasons between 2000 and 2020 sighting was peaked with over 200 in spring</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*9CRI1qoqfXfB_dYz5yLpfA.png" /></figure><p>This is Sighting in pie chart each season the most quantity of sighting was summer with 37.9%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*1InAfDe9hSlQwC3KrwgLYQ.png" /></figure><p>This is More priority figure is this because you can see that where was happened in the map</p><h3>We’ve Reached Last step Which is DashBoard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*zQrd7sQUdB7UDIGdIaAnfg.png" /><figcaption>bigfoot dashboard analysis</figcaption></figure><p>So there are some facility which are slicer if you want to see specific year or Season you can Choose that and so on</p><p>Good BYE</p><h3>Assalamu Alaykum</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdbfcd633c74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UFO Sighting Analysis With Power BI]]></title>
            <link>https://medium.com/@mrmaster907/ufo-sighting-analysis-with-power-bi-24eafe0dd0d1?source=rss-518c724a865c------2</link>
            <guid isPermaLink="false">https://medium.com/p/24eafe0dd0d1</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[power-bi]]></category>
            <category><![CDATA[ufo]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Mr Farkhod Khushaktov]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 10:37:43 GMT</pubDate>
            <atom:updated>2023-08-10T10:37:43.554Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*4i-LHFWTp8GO4Z55FP5lZg.jpeg" /></figure><h4>This dataset contains over 80,000 reports of UFO sightings over the last century.</h4><p>To answer our question we will use the UFO Sightings dataset [2]. This dataset contains the sighting report content itself including the time, location, duration, and other attributes in both the raw form as it is recorded on the National UFO Research Center (NUFORC) site as well as a refined, thanks to Tim Renner, standardized form that also contains latitude/longitude coordinates which has cleaned state and city names, standardized dates and latitude/longitude values of the cities in which the sightings occurred. Few things to note:</p><ol><li>All of the sighting reports are present — this is a complete scrape.</li><li>The entire sighting report contents are present, including the full text of the sighting report.</li><li>The sighting reports are geocoded at the city level. It isn’t a complete geocoding, but about 90k / 110k reports have an associated lat/lon.</li><li>The “cleaned” version of the dataset has a few key standardizations applied like date times, city names, state codes, etc that make it easier to work with.</li></ol><p>Columns information:</p><ol><li>city: The city of the sighting.</li><li>state: The 2 character state code of the sighting.</li><li>date time: The date and time of the sighting in ISO 8601 (local time).</li><li>shape: The shape of the sighting.</li><li>duration: The duration of the sighting in no particular format.</li><li>stats: Summary stats about the sighting (when it occurred, when it was posted, etc.).</li></ol><h3>Let’s Visualize</h3><figure><img alt="UFO Datasets, visualiz" src="https://cdn-images-1.medium.com/max/324/1*yFjukV4oEBb7Y8a8eOQQxQ.png" /></figure><p>As you can See that which is Sighting you will see Shape which was and Countries Name By Sorted Year</p><figure><img alt="UFO Datasets" src="https://cdn-images-1.medium.com/max/936/1*T7qHdDxcMTQHX5POsImoFg.png" /></figure><p>OK So here you can see Sighting line visualization and We used Legend Function to Split Countries a number of sighting was United State than number of other countries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*mJ6c9ne720zHELpNrC_Mrw.png" /></figure><p>this is the same previous Photo But some Difference in this below Figure we have Splited By Month</p><h3>Finally Business DashBoard</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*6kkvTKgKU_aJGB_vr9LFVw.png" /></figure><p>Huuuh Yeah this is my UFO Dashboard in here some making changes which add some New charts which are slicer, Photo and Map to improve understandable</p><p>Thanks to see</p><p>Assalamu Alaykum</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24eafe0dd0d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>