<?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 Yang Wang on Medium]]></title>
        <description><![CDATA[Stories by Yang Wang on Medium]]></description>
        <link>https://medium.com/@yangforbig?source=rss-bfdc05745ee7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wH-nYF5PAHs75gb0D6rdAA.jpeg</url>
            <title>Stories by Yang Wang on Medium</title>
            <link>https://medium.com/@yangforbig?source=rss-bfdc05745ee7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 18:32:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yangforbig/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[A/B Testing (Lesson 1)]]></title>
            <link>https://medium.com/@yangforbig/a-b-testing-lesson-1-95393edd9dcd?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/95393edd9dcd</guid>
            <category><![CDATA[a-b-testing]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Fri, 11 Aug 2017 03:06:58 GMT</pubDate>
            <atom:updated>2017-08-11T03:06:58.151Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of A/B Testing in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NaGtnRVnYsji-NTFe5Eusw.png" /></figure><p>A/B Testing is the final course of Data Analyst Nanodegree which is also one of widely used techniques in large IT companies. This A/B testing series will be my takeaway from this course.</p><h3>Structure of lesson 1</h3><p>(1) Overview</p><p>(2) Example</p><ul><li>Choose a metric</li><li>Review Statistics</li><li>Design</li><li>Analyze</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*50ajKdadzpgKZvgohV4kGQ.jpeg" /></figure><p>As always, if you like the content and the beauty of mind-map for learning, please feel free to recommend and repost. Always open to all the questions and improvements, just comment below and enjoy self-leaning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95393edd9dcd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQLite vs MySQL vs PostgreSQL: A Comparison Of Relational Database Management Systems]]></title>
            <link>https://medium.com/@yangforbig/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems-afd5afd6566?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/afd5afd6566</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Thu, 10 Aug 2017 15:17:53 GMT</pubDate>
            <atom:updated>2017-08-10T15:18:32.685Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Originally from </em><a href="https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems"><em>O.S. Tezar’s article on DigitalOcean</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*HH_YApV5EB3vfKD94lkaiw.png" /></figure><p>Often time you might be confused with terms related with SQL, SQLite, MySQL or PostgreSQL and mumble that what on earth the meaning of those similar terms. Here is the article I found online dealing with the comparison between these different database systems. In the end, I put all the key points in a table to see the whole picture of the creatures.</p><h3><strong>Introduction</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*0psKwkkwfOUK_m68qtdleg.png" /></figure><p>Relational databases have been in use for a long time. They became popular thanks to management systems that implement the relational model extremely well, which has proven to be a great way to work with data [especially for mission-critical applications].</p><p>We are going to try to understand the core differences of some of the most commonly used and popular relational database management systems (RDBMS). We will explore their fundamental differences in terms of features and functionality, how they work, and when one excels over the other in order to help developers with choosing a RDBMS.</p><h3>Glossary</h3><h4>1. Database Management Systems</h4><ul><li>Relational Database Management Systems</li><li>Relations And Data Types</li><li>Popular And Important Relational Databases</li></ul><h4>2. SQLite</h4><ul><li>SQLite’s Supported Data Types</li><li>Advantages of SQLite</li><li>Disadvantages of SQLite</li><li>When To Use SQLite</li><li>When Not To Use SQLite</li></ul><h4>3. MySQL</h4><ul><li>MySQL’s Supported Data Types</li><li>Advantages of MySQL</li><li>Disadvantages of MySQL</li><li>When To Use MySQL</li><li>When Not To Use MySQL</li></ul><h4>4. PostgreSQL</h4><ul><li>PostgreSQL’s Supported Data Types</li><li>Advantages of PostgreSQL</li><li>Disadvantages of PostgreSQL</li><li>When To Use PostgreSQL</li><li>When Not To Use PostgreSQL</li></ul><h3>Database Management Systems</h3><p>Databases are logically modelled storage spaces for all kinds of different information (data). Each database, other than schema-less ones, have a model, which provide structure for the data being dealt with. Database management systems are applications (or libraries) which manage databases of various shapes, sizes, and sorts.</p><h3>Relational Database Management Systems</h3><p>Relational Database Systems implement the relational model to work with the data. Relational model shapes whatever information to be stored by defining them as related entities with attributes across tables (i.e. schemas).</p><p>These type of database management systems require structures (e.g. a table) to be defined in order to contain and work with the data. With tables, each column (e.g. attribute) holds a different type (e.g. data type) of information. Each record in the database, uniquely identified with <em>keys</em>, translates to a row that belongs to a table, with each row’s series of attributes being represented as the columns of a table — all related together, as defined within the relational model.</p><h3>Relations And Data Types</h3><p>Relations can be considered as mathematical sets that contain series of attributes which collectively represent the database and information being kept. This type of identification and collection method allow relational databases to work the way they do.</p><p>When defining a table to insert records, each element forming a record (i.e. attribute) must match the defined <em>data type</em> (e.g. an integer, a date etc.). Different relational database management systems implement different data types — which are not always directly interchangeable.</p><p>Working with and through constraints, like the one we have just explained, is common with relational databases. In fact, constraints form the core of the relations.</p><h3>Popular And Important Relational Databases</h3><p>In this article, we are going to introduce three major and important open-source relational database management systems that have helped to shape the world of application development.</p><ul><li>SQLite:</li></ul><p>A very powerful, embedded relational database management system.</p><ul><li>MySQL:</li></ul><p>The most popular and commonly used RDBMS.</p><ul><li>PostgreSQL:</li></ul><p>The most advanced, SQL-compliant and open-source objective-RDBMS.</p><h3>SQLite</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*dWHAgpfaDhohQ7kTcq9pVA.png" /></figure><p>SQLite is an amazing library that gets embedded inside the application that makes use of. As a self-contained, file-based database, SQLite offers an amazing set of tools to handle all sorts of data with much less constraint and ease compared to hosted, process based (server) relational databases.</p><p>When an application uses SQLite, the integration works with functional and direct calls made to a file holding the data (i.e. SQLite database) instead of communicating through an interface of sorts (i.e. ports, sockets). This makes SQLite extremely fast and efficient, and also powerful thanks to the library’s underlying technology.</p><h3>SQLite’s Supported Data Types</h3><ul><li>NULL:</li></ul><p>NULL value.</p><ul><li>INTEGER:</li></ul><p>Signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.</p><ul><li>REAL:</li></ul><p>Floating point value, stored as an 8-byte IEEE floating point number.</p><ul><li>TEXT:</li></ul><p>Text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).</p><ul><li>BLOB:</li></ul><p>A blob of data, stored exactly as it was input.</p><p>Note: To learn more about SQLite’s data types and SQLite type affinity, check out the <a href="http://www.sqlite.org/datatype3.html">official documentation</a> on the subject.</p><h3>Advantages of SQLite</h3><ul><li>File based:</li></ul><p>The entire database consists of a single file on the disk, which makes it extremely portable.</p><ul><li>Standards-aware:</li></ul><p>Although it might appear like a “simple” DB implementation, SQLite uses SQL. It has some features omitted (RIGHT OUTER JOIN or FOR EACH STATEMENT), however, some additional ones are baked in.</p><ul><li>Great for developing and even testing:</li></ul><p>During the development phase of most applications, for a majority of people it is extremely likely to need a solution that can scale for concurrency. SQLite, with its rich feature base, can offer more than what is needed for development with the simplicity of working with a single file and a linked C based library.</p><h3>Disadvantages of SQLite</h3><ul><li>No user management:</li></ul><p>Advanced databases come with the support for users, i.e. managed connections with set access privileges to the database and tables. Given the purpose and nature of SQLite (no higher-levels of multi-client concurrency), this feature does not exist.</p><ul><li>Lack of possibility to tinker with for additional performance:</li></ul><p>Again by design, SQLite is not possible to tinker with to obtain a great deal of additional performance. The library is simple to tune and simple to use. Since it is not complicated, it is technically not possible to make it more performant than it already, amazingly is.</p><h3>When To Use SQLite</h3><ul><li>Embedded applications:</li></ul><p>All applications that need portability, that do not require expansion, e.g. single-user local applications, mobile applications or games.</p><ul><li>Disk access replacement:</li></ul><p>In many cases, applications that need to read/write files to disk directly can benefit from switching to SQLite for additional functionality and simplicity that comes from using the <em>Structured Query Language</em>(SQL).</p><ul><li>Testing:</li></ul><p>It is an overkill for a large portion of applications to use an additional process for testing the business-logic (i.e. the application’s main purpose: functionality).</p><h3>When Not To Use SQLite</h3><ul><li>Multi-user applications:</li></ul><p>If you are working on an application whereby multiple clients need to access and use the same database, a fully-featured RDBM (e.g. MySQL) is probably better to choose over SQLite.</p><ul><li>Applications requiring high write volumes:</li></ul><p>One of the limitations of SQLite is the <em>write</em> operations. This DBMS allows only one single write*operating to take place at any given time, hence allowing a limited throughput.</p><h3>MySQL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*T3BaHqtf8ixkdGMTJzoOLw.png" /></figure><p>MySQL is the most popular one of all the large-scale database servers. It is a feature rich, open-source product that powers a lot of web-sites and applications online. Getting started with MySQL is relatively easy and developers have access to a massive array of information regarding the database on the internet.</p><p>Note: It should be stated that given the popularity of the product, there are a lot of third-party applications, tools and integrated libraries which help greatly with many aspects of working with this RDBMS.</p><p>Despite not trying to implement the full SQL standard, MySQL offers a lot of functionality to the users. As a stand-alone database server, applications talk to MySQL daemon process to access the database itself — unlike SQLite.</p><h3>MySQL’s Supported Data Types</h3><ul><li>TINYINT:</li></ul><p>A very small integer.</p><ul><li>SMALLINT:</li></ul><p>A small integer.</p><ul><li>MEDIUMINT:</li></ul><p>A medium-size integer.</p><ul><li>INT or INTEGER:</li></ul><p>A normal-size integer.</p><ul><li>BIGINT:</li></ul><p>A large integer.</p><ul><li>FLOAT:</li></ul><p>A small (single-precision) floating-point number. Cannot be unsigned.</p><ul><li>DOUBLE, DOUBLE PRECISION, REAL:</li></ul><p>A normal-size (double-precision) floating-point number. Cannot be unsigned.</p><ul><li>DECIMAL, NUMERIC:</li></ul><p>An unpacked floating-point number. Cannot be unsigned.</p><ul><li>DATE:</li></ul><p>A date.</p><ul><li>DATETIME:</li></ul><p>A date and time combination.</p><ul><li>TIMESTAMP:</li></ul><p>A timestamp.</p><ul><li>TIME:</li></ul><p>A time.</p><ul><li>YEAR:</li></ul><p>A year in 2- or 4- digit formats (default is 4-digit).</p><ul><li>CHAR:</li></ul><p>A fixed-length string that is always right-padded with spaces to the specified length when stored.</p><ul><li>VARCHAR:</li></ul><p>A variable-length string.</p><ul><li>TINYBLOB, TINYTEXT:</li></ul><p>A BLOB or TEXT column with a maximum length of 255 (2⁸ — 1) characters.</p><ul><li>BLOB, TEXT:</li></ul><p>A BLOB or TEXT column with a maximum length of 65535 (2¹⁶ — 1) characters.</p><ul><li>MEDIUMBLOB, MEDIUMTEXT:</li></ul><p>A BLOB or TEXT column with a maximum length of 16777215 (2²⁴ — 1) characters.</p><ul><li>LONGBLOB, LONGTEXT:</li></ul><p>A BLOB or TEXT column with a maximum length of 4294967295 (2³² — 1) characters.</p><ul><li>ENUM:</li></ul><p>An enumeration.</p><ul><li>SET:</li></ul><p>A set.</p><h3>Advantages of MySQL</h3><ul><li>Easy to work with:</li></ul><p>MySQL can be installed very easily. Third-party tools, including visual ones (i.e. GUIs) make it extremely simple to get started with the database.</p><ul><li>Feature rich:</li></ul><p>MySQL supports a lot of the SQL functionality that is expected from a RDBMS — either directly or indirectly.</p><ul><li>Secure:</li></ul><p>A lot of security features, some rather advanced, are built in MySQL.</p><ul><li>Scalable and powerful:</li></ul><p>MySQL can handle <em>a lot</em> of data and furthermore it can be used “at scale”, if needed be.</p><ul><li>Speedy:</li></ul><p>Giving up some standards allows MySQL to work very efficiently and cut corners, thus providing speed gains.</p><h3>Disadvantages of MySQL</h3><ul><li>Known limitations:</li></ul><p>By design, MySQL does not intend to do everything and it comes with functional limitations that some state-of-the-art applications might require.</p><ul><li>Reliability issues:</li></ul><p>The way certain functionality gets handled with MySQL (e.g. references, transactions, auditing etc.) renders it a little-less reliable compared to some other RDBMSs.</p><ul><li>Stagnated development:</li></ul><p>Although MySQL is still technical an open-source product, there are complaints regarding the development process since its acquisition. However, it should be noted that there are some MySQL-based, fully-integrated databases that add value on top of the standard MySQL installations (e.g. MariaDB).</p><h3>When To Use MySQL</h3><ul><li>Distributed operations:</li></ul><p>When you need more than what SQLite can offer, including MySQL to your deployment stack, just like any stand-alone database server, brings a lot of operational freedom together with some advanced features.</p><ul><li>High security:</li></ul><p>MySQL’s security features provide reliable protection for data-access (and use) in a simple way.</p><ul><li>Web-sites and web-applications:</li></ul><p>A great majority of web-sites (and web-applications) can simply work on MySQL despite the constraints. This flexible and somewhat scalable tool is easy to use and easy to manage — which proves very helpful in the long run.</p><ul><li>Custom solutions:</li></ul><p>If you are working on a highly specific and extremely custom solution, MySQL can tag along easily and go by your rules thanks to its rich configuration settings and operation modes.</p><h3>When Not To Use MySQL</h3><ul><li>SQL compliance:</li></ul><p>Since MySQL does not [try to] implement the full SQL standard, this tool is not completely SQL compliant. If you might need integration with such RDBMSs, switching from MySQL will not be easy.</p><ul><li>Concurrency:</li></ul><p>Even though MySQL and some storage engines perform really well with <em>read</em> operations, concurrent <em>read-writes</em> can be problematic.</p><ul><li>Lack of features:</li></ul><p>Again, depending on the choice of the database-engine, MySQL can lack certain features, such as the full-text search.</p><h3>PostgreSQL</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*z39Kgn8yzrz8WZEScEyZBw.png" /></figure><p>PostgreSQL is the advanced, open-source [object]-relational database management system which has the main goal of being standards-compliant and extensible. PostgreSQL, or Postgres, tries to adopt the ANSI/ISO SQL standards together with the revisions.</p><p>Compared to other RDBMSs, PostgreSQL differs itself with its support for highly required and integral object-oriented and/or relational database functionality, such as the complete support for reliable transactions, i.e. Atomicity, Consistency, Isolation, Durability (ACID).</p><p>Due to the powerful underlying technology, Postgres is extremely capable of handling many tasks very efficiently. Support for concurrency is achieved without read locks thanks to the implementation of Multiversion Concurrency Control (MVCC), which also ensures the ACID compliance.</p><p>PostgreSQL is highly programmable, and therefore extendible, with custom procedures that are called “stored procedures”. These functions can be created to simplify the execution of repeated, complex and often required database operations.</p><p>Although this DBMS does not have the popularity of MySQL, there are many amazing third-party tools and libraries that are designed to make working with PostgreSQL simple, despite this database’s powerful nature. Nowadays it is possible to get PostgreSQL as an application package through many operating-system’s default package manager with ease.</p><h3>PostgreSQL’s Supported Data Types</h3><ul><li>bigint:</li></ul><p>signed eight-byte integer</p><ul><li>bigserial:</li></ul><p>autoincrementing eight-byte integer</p><ul><li>bit [(n)]:</li></ul><p>fixed-length bit string</p><ul><li>bit varying [(n)]:</li></ul><p>variable-length bit string</p><ul><li>boolean:</li></ul><p>logical Boolean (true/false)</p><ul><li>box:</li></ul><p>rectangular box on a plane</p><ul><li>bytea:</li></ul><p>binary data (“byte array”)</p><ul><li>character varying [(n)]:</li></ul><p>variable-length character string</p><ul><li>character [(n)]:</li></ul><p>fixed-length character string</p><ul><li>cidr:</li></ul><p>IPv4 or IPv6 network address</p><ul><li>circle:</li></ul><p>circle on a plane</p><ul><li>date:</li></ul><p>calendar date (year, month, day)</p><ul><li>double precision:</li></ul><p>double precision floating-point number (8 bytes)</p><ul><li>inet:</li></ul><p>IPv4 or IPv6 host address</p><ul><li>integer:</li></ul><p>signed four-byte integer</p><ul><li>interval [fields] [(p)]:</li></ul><p>time span</p><ul><li>line:</li></ul><p>infinite line on a plane</p><ul><li>lseg:</li></ul><p>line segment on a plane</p><ul><li>macaddr:</li></ul><p>MAC (Media Access Control) address</p><ul><li>money:</li></ul><p>currency amount</p><ul><li>numeric [(p, s)]:</li></ul><p>exact numeric of selectable precision</p><ul><li>path:</li></ul><p>geometric path on a plane</p><ul><li>point:</li></ul><p>geometric point on a plane</p><ul><li>polygon:</li></ul><p>closed geometric path on a plane</p><ul><li>real:</li></ul><p>single precision floating-point number (4 bytes)</p><ul><li>smallint:</li></ul><p>signed two-byte integer</p><ul><li>serial:</li></ul><p>autoincrementing four-byte integer</p><ul><li>text:</li></ul><p>variable-length character string</p><ul><li>time [(p)] [without time zone]:</li></ul><p>time of day (no time zone)</p><ul><li>time [(p)] with time zone:</li></ul><p>time of day, including time zone</p><ul><li>timestamp [(p)] [without time zone]:</li></ul><p>date and time (no time zone)</p><ul><li>timestamp [(p)] with time zone:</li></ul><p>date and time, including time zone</p><ul><li>tsquery:</li></ul><p>text search query</p><ul><li>tsvector:</li></ul><p>text search document</p><ul><li>txid_snapshot:</li></ul><p>user-level transaction ID snapshot</p><ul><li>uuid:</li></ul><p>universally unique identifier</p><ul><li>xml:</li></ul><p>XML data</p><h3>Advantages of PostgreSQL</h3><ul><li>An open-source SQL standard compliant RDBMS:</li></ul><p>PostgreSQL is open-source and free, yet a very powerful relational database management system.</p><ul><li>Strong community:</li></ul><p>PostgreSQL is supported by a devoted and experienced community which can be accessed through knowledge-bases and Q&amp;A sites 24/7 for free.</p><ul><li>Strong third-party support:</li></ul><p>Regardless of the extremely advanced features, PostgreSQL is adorned with many great and open-source third-party tools for designing, managing and using the management system.</p><ul><li>Extensible:</li></ul><p>It is possible to extend PostgreSQL programmatically with stored procedures, like an advanced RDBMS should be.</p><ul><li>Objective:</li></ul><p>PostgreSQL is not just a relational database management system but an objective one — with support for nesting, and more.</p><h3>Disadvantages of PostgreSQL</h3><ul><li>Performance:</li></ul><p>For simple <em>read</em>-heavy operations, PostgreSQL can be an over-kill and might appear less performant than the counterparts, such as MySQL.</p><ul><li>Popularity:</li></ul><p>Given the nature of this tool, it lacks behind in terms of popularity, despite the very large amount of deployments — which might affect how easy it might be possible to get support.</p><ul><li>Hosting:</li></ul><p>Due to above mentioned factors, it is harder to come by hosts or service providers that offer managed PostgreSQL instances.</p><h3>When To Use PostgreSQL</h3><ul><li>Data integrity:</li></ul><p>When reliability and data integrity are an absolute necessity without excuses, PostgreSQL is the better choice.</p><ul><li>Complex, custom procedures:</li></ul><p>If you require your database to perform custom procedures, PostgreSQL, being extensible, is the better choice.</p><ul><li>Integration:</li></ul><p>In the future, if there is a chance of necessity arising for migrating the entire database system to a propriety (e.g. Oracle) solution, PostgreSQL will be the most compliant and easy to handle base for the switch.</p><ul><li>Complex designs:</li></ul><p>Compared to other open-source and free RDBMS implementations, for complex database designs, PostgreSQL offers the most in terms of functionality and possibilities without giving up on other valuable assets.</p><h3>When Not To Use PostgreSQL</h3><ul><li>Speed:</li></ul><p>If all you require is fast <em>read</em> operations, PostgreSQL is not the tool to go for.</p><ul><li>Simple set ups:</li></ul><p>Unless you require absolute data integrity, ACID compliance or complex designs, PostgreSQL can be an over-kill for simple set-ups.</p><ul><li>Replication:</li></ul><p>Unless you are willing to spend the time, energy and resources, achieving replication with MySQL might be simpler for those who lack the database and system administration experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*bgvg7KTFTSKyWjK_o8TNMg.png" /></figure><p>Please kindly <a href="https://www.digitalocean.com/community/tutorials/sqlite-vs-mysql-vs-postgresql-a-comparison-of-relational-database-management-systems">check the original post </a>for more information and enjoy online-learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afd5afd6566" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Machine Learning (Lesson 4 )]]></title>
            <link>https://medium.com/@yangforbig/introduction-to-machine-learning-lesson-4-3c5b801cacd8?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c5b801cacd8</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[adaboost]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[random-forest]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Fri, 28 Jul 2017 21:26:10 GMT</pubDate>
            <atom:updated>2017-07-28T21:26:10.501Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Intro to Machine Learning in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHIoBxcR-CBVbrMsv0DUQQ.png" /></figure><p>The tittle of lesson 4 is Choose Your Own Algorithm, which means we have to explore our own interests in various machine learning algorithms and apply it to the mini-project. The instructor suggested 3 supervising learning algorithms, K-nearest Neighbor, Random Forest and Adaboost to choose from. Since all the provided algorithms are super popular and useful, especially for the Random Forest and Adaboost, I am going to map all the methods in the mind-map as the purpose of giving a quick sense on these topics.</p><p>The instructor has pointed out a good way for a newbie to learn new algorithms. Follow the steps bellow will definitely make a good start!</p><p>(1) Do some research and you are able to explain it to your friend<br>(2) Find Sklearn document<br>(3) Depoly it <br>(4) Use it to make prediction<br>(5) Evaluate it</p><h4>Mind-map</h4><p>Feel free to enlarge the picture to have a clear read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngV3XEvXkHztkmukS2FzsA.jpeg" /></figure><p>The main points in the mind-map are inspired by Sklearn document and well-explained youtube videos bellow.</p><h4>Bagging and Random Forest</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FRm6s6gmLTdg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRm6s6gmLTdg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FRm6s6gmLTdg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/814f56c107e026ecf707f195a20a0f43/href">https://medium.com/media/814f56c107e026ecf707f195a20a0f43/href</a></iframe><h4>AdaBoost</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fix6IvwbVpw0%3Fstart%3D6%26feature%3Doembed%26start%3D6&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dix6IvwbVpw0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fix6IvwbVpw0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1493b45fa537a933c2ed46299bcdf603/href">https://medium.com/media/1493b45fa537a933c2ed46299bcdf603/href</a></iframe><p>As always, if you like the content and the beauty of mind-map for learning, please feel free to recommend and repost. Always open to all the questions and improvements, just comment below and enjoy self-leaning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c5b801cacd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Machine Learning (Lesson 2 and Lesson 3)]]></title>
            <link>https://medium.com/@yangforbig/introduction-to-machine-learning-lesson-2-and-lesson-3-25569d9bafa4?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/25569d9bafa4</guid>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[support-vector-machine]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Thu, 27 Jul 2017 02:36:49 GMT</pubDate>
            <atom:updated>2017-07-27T02:36:49.882Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Intro to Machine Learning in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*C4haayhhwAPCx2rrG2BwiA.png" /><figcaption>SVM</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*WRsU_gREtlkjfLtC4-SK1g.png" /><figcaption>Decision Tree</figcaption></figure><p>The characteristics of this introductory ML course are more extended on the intuition of complexed algorithms rather than focusing on hard equations, which makes the lesson short, sweet, and easy to follow. If you never got a chance to get exposure to machine learning before, this course is definitely a good place to touch the topic and start your journey in machine learning.</p><p>Below is the mind-map for decision trees and support vector machine in lesson 2 and lesson 3.</p><h4>Mind-map for key notes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1YMty-BczFihib4vQtbSLA.jpeg" /></figure><p>As always, If you like the content and the beauty of mind-map for learning, please feel free to recommend and repost. Always open to all the questions and improvements, just comment below and enjoy learning at Udacity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25569d9bafa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Machine Learning (Lesson 1 Naive Bayes)]]></title>
            <link>https://medium.com/@yangforbig/introduction-to-machine-learning-lesson-1-naive-bayes-6a038a4fa46?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a038a4fa46</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[naive-bayes]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 22:07:15 GMT</pubDate>
            <atom:updated>2017-07-25T22:07:15.205Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Intro to Machine Learning in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJaG-VYLRosJr_Y1iPlqOQ.png" /></figure><p>This is the first post of new series on my takeaway for the course Introduction to Machine Learning in Udacity. Like I always do, I will try to include the key notes of each lesson in a<a href="http://www.xmind.net/"> Mind-map</a> as much as possible. I also try to explain the concept using the plain language and examples from the course. If you find some missing points that are important, please feel free to comment below. This post will focus on the introduction of the course and the first lesson on the topic of Naive Bayes.</p><h4>Introduction</h4><p>In terms of the introduction to this course, there is nothing more entertaining than an official one.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fvideoseries%3Flist%3DPLAwxTw4SYaPkQXg8TkVdIvYv4HfLG7SiH&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DICKBWIkfeJ8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FICKBWIkfeJ8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e78d4a707f2c049015846e53a29df35/href">https://medium.com/media/0e78d4a707f2c049015846e53a29df35/href</a></iframe><h4>Mind-Map for notes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMC58_NrQklkATShfFOxDg.jpeg" /></figure><p>That’s all for the introduction and lesson 1. If you like the content and the beauty of mind-map for learning, please feel free to recommend and repost. Always open to all the questions and improvements, just comment below and enjoy self-leaning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a038a4fa46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Wrangling with MongoDB (Lesson 5 Analyzing data)]]></title>
            <link>https://medium.com/@yangforbig/data-wrangling-with-mongodb-lesson-5-analyzing-data-c47049efa8f4?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c47049efa8f4</guid>
            <category><![CDATA[data-wrangling]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 15:30:37 GMT</pubDate>
            <atom:updated>2017-07-25T15:30:37.110Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Data Wrangling with MongoDB in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*20hxoNx_yf3EC90G9odpMQ.png" /></figure><p>In this post, we are going to explore <a href="https://d17h27t6h515a5.cloudfront.net/topher/2017/March/58be1fcf_twitter.json/twitter.json.zip">Twitter Snapshot Data (json, 17 MB .zip)</a> using the MongoDB aggregation framework to do some initial analysis.</p><h4>Get the twitter data into MongoDB</h4><pre>import json<br>import codecs<br><br>def insert_data(data, db):<br>    for line in data:<br>        db.twitter.insert(line)</pre><pre>def get_db(db_name):<br>    from pymongo import MongoClient<br>    client = MongoClient(&#39;localhost:27017&#39;)<br>    db = client[db_name]<br>    data = []<br>    with codecs.open(&#39;twitter.json&#39;, &#39;rU&#39;, &#39;utf-8&#39;) as f:<br>        insert_data(data, db)<br>    return db<br>if __name__ == &#39;__main__&#39;:<br>    db = get_db(&#39;twitter&#39;)<br></pre><h4>Mind-map for aggregation notes</h4><ul><li>Aggregation pipeline</li><li>Using Group</li><li>Filter operation</li><li>Unwind</li><li>Group Accumulation</li><li>Index and Geospatial Indexes</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAWw3NQ3ACS9Lq4j2JgLiw.png" /></figure><p>So far, we have gone through several main topics of this course. In the next, we will gather all the pieces we have learned into the case study, OpenStreetMap data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c47049efa8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Wrangling with MongoDB (Lesson 4 Working with MongoDB)]]></title>
            <link>https://medium.com/@yangforbig/data-wrangling-with-mongodb-lesson-4-working-with-mongodb-6d58b30c10cd?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d58b30c10cd</guid>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-wrangling]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 14:50:57 GMT</pubDate>
            <atom:updated>2017-07-25T15:22:40.085Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Data Wrangling with MongoDB in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NmWIKJy5cJ1K9BcreMyVwg.png" /></figure><p>In this post, we will talk about the mongoDB query language, putting documents into mongoBD, and getting them out using a variety of different operations and operators.</p><h4>What is MongoDB?</h4><p>MongoDB is widely used in big data and leading NOSQL database( document database).</p><h4>Why MongoDB?</h4><ul><li>Flexible schema(easy for csv file or hierarchical data)</li><li>Oriented toward programers (data types found in most popular language)</li><li>Flexible deployment</li><li>Designed for big data (run on your own or multiple servers)</li><li>Aggregation framework (easy for quick data analysis)</li></ul><h4>Get Started with MongoDB</h4><p>You can download MongoDB for your platform from the official <a href="http://www.mongodb.org/downloads">MongoDB page</a>. You can also read specific <a href="http://docs.mongodb.org/manual/installation/">MongoDB installation instructions</a>.</p><p>MongoDB has a lot of <a href="http://docs.mongodb.org/manual/applications/drivers/">drivers and client libraries</a>. The one we will be using in this course is PyMongo. See the official documentation for <a href="http://api.mongodb.org/python/current/installation.html">PyMongo installation instructions</a>.</p><h4>Mind-map for basic queries</h4><p>Bellow is the mind-map of sample code using PyMongo to run queries.</p><ul><li>Getting Data into MongoDB</li><li>Find Document</li><li>Operations and Operators</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWsnVoHc7Q0ksZFfkku3Gg.png" /></figure><p>Above is all my takeaway from this lesson. Feel free to like and repost if you learned some from this post. And please don’t feel any hesitation to ask question and give advice. Enjoy self-learning and have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d58b30c10cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Wrangling with MongoDB (Lesson 3 Data Quality)]]></title>
            <link>https://medium.com/@yangforbig/data-wrangling-with-mongodb-lesson-3-data-quality-bd707f1daa1e?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd707f1daa1e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[data-wrangling]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 13:56:00 GMT</pubDate>
            <atom:updated>2017-07-25T13:56:00.607Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Data Wrangling with MongoDB in Udacity</em></p><p>In lesson 3, we are going to look at a blueprint for auditing our data to access its quality, and we’ll look at a number of different quality measures. We’ll also look at ways of cleaning our data to correct any problem with it. This is the process that it’s very situation specific. But even so, we can identify a number of rules of thumb and best practices that apply in a variety of different contexts.</p><h4>Mind-map</h4><p>Since there are more conceptual ideas than coding involved in this lesson, I put all the key points in the mind-map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUVhloXfyR3AWfnXzXbi-A.jpeg" /></figure><p>As always, feel free to like and repost if you learned some from this post. And please don’t feel any hesitation to ask question and give advice. Enjoy self-learning and have fun! Next time, we will talk about working with MongoDB.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd707f1daa1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Wrangling with MongoDB (Lesson 2)]]></title>
            <link>https://medium.com/@yangforbig/data-wrangling-with-mongodb-lesson-2-2cf9778abd8b?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cf9778abd8b</guid>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-wrangling]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Fri, 21 Jul 2017 15:26:06 GMT</pubDate>
            <atom:updated>2017-07-25T13:43:09.176Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Data Wrangling with MongoDB in Udacity</em></p><p>Hello fellows! Today we will continue to extract data from different sources, move from CSV, Json, to XML and scraping data from HTML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*kjrqQDxxQ8CJU9gIe7u06w.png" /></figure><h4>XML</h4><ul><li>Basics of XML</li></ul><blockquote>Elements are the basic building blocks<br>Elements are composed of opening and closing tags<br>Elements can be nested in an element</blockquote><ul><li>Two types of XML</li></ul><p>(1) Documented oriented Type</p><p>For example, <a href="https://d17h27t6h515a5.cloudfront.net/topher/2017/March/58be1c65_exampleresearcharticle/exampleresearcharticle.xml">research article xml document</a></p><p>(2) Non-documented oriented type: attributes in the elements are <br>heavily used (HTML using this way)</p><p>For example: OpenStreet Map data</p><p>If you’re new to XML and or would like some extra resources, here are a couple useful tutorials:</p><ul><li><a href="https://www.w3schools.com/xml/xml_whatis.asp">XML Introduction</a></li><li><a href="http://www.tizag.com/xmlTutorial/index.php">XML Tutorial - Introduction</a></li></ul><ul><li>Parse XML</li></ul><p>One way to parse XML document is to put entire XML into a tree in memory (good for documented type XML)</p><p>Use <a href="https://d17h27t6h515a5.cloudfront.net/topher/2017/March/58be1c65_exampleresearcharticle/exampleresearcharticle.xml">research article xml document</a> for example</p><pre># iterate child of element <br>import xml.etree.ElementTree as ET<br>tree = ET.parse(filename)<br>root = tree.getroot()</pre><pre>print “Children of root:”<br>for chile in root:<br>    print child.tag # print the tag name</pre><pre># Element tree supports X path expressions <br>tree = ET.parse(filename)<br>title = root.find(&#39;./fm/bibl/title&#39;)<br>title_text = &#39;&#39;</pre><pre># print the title of article<br>for p in title:<br>    title_text += p.text<br>print &quot;\nText\n&quot;, title.text</pre><pre># print the email address<br>print &quot;\nAuthor email Addresses:&quot;<br>for a in root.findall(&quot;./fm/bibl/aug/au&quot;):<br>    email = a.find(&#39;email&#39;)<br>    if email is not None:<br>        print email.text</pre><pre># handle attributes</pre><pre>element.attrib[name] or element.get(name)</pre><h4>HTML (Web Scraping)</h4><p>We are going to use an example to demonstrate this process. We will collect all the carriers and airports data, and then made request for each airport <br>and carrier, finally get the all departure and arrival info for each carrier-airport pair. The module, <a href="https://www.crummy.com/software/BeautifulSoup/bs4/doc/">beautiful soup</a>, we used to parse the html tree, is a similar process to parse xml tree</p><p><em>Web page: </em><a href="http://www.transtats.bts.gov/Data_Elements.aspx?Data=2"><em>AirTrain website</em></a></p><p><strong>Procedure</strong></p><p>1. Build lists of carrier values and airport values</p><pre>import requests<br>from bs4 import BeautifulSoup as bs</pre><pre>carrierList = []<br>with open(&#39;VX_and_BOS.html&#39;, &#39;r&#39;) as html:<br>    sp = bs(html, &#39;lxml&#39;)<br>    carrierLayer = sp.find(id=&#39;CarrierList&#39;)<br>    carriers = carrierLayer.find_all(&#39;option&#39;)<br>    for carrier in carriers:<br>        if &#39;All&#39; in carrier[&#39;value&#39;]:<br>            continue<br>        carrierList.append(carrier[&#39;value&#39;])</pre><pre># Collect airports except for the &#39;All</pre><pre>airportList = []<br>with open(&#39;VX_and_BOS.html&#39;, &#39;r&#39;) as html:<br>    sp = bs(html, &#39;lxml&#39;)<br>    airportLayer = sp.find(id=&#39;AirportList&#39;)<br>    for airport in airportLayer.find_all(&#39;option&#39;):<br>        if &#39;All&#39; in airport[&#39;value&#39;]:<br>            continue<br>        airportList.append(airport[&#39;value&#39;])</pre><p>2. Make http request to download all data (download html page, better for examine bugs in your parser)</p><p>Make correct http request needs:</p><p>(1) What http method has been used (post? or get?) <br>(2) What necessary fields are included in request?</p><p><strong>Best way</strong> to make correct http request (see how web browser make request):</p><blockquote>→ Inspect element in a web page</blockquote><blockquote>→ Network tab</blockquote><blockquote>→ Find method all the fields need be included in the request</blockquote><blockquote>→ Use the fresh made request and check if it is right</blockquote><blockquote>→ If not valid</blockquote><blockquote>→ Use requests.Session() to include all the cookies in your http request</blockquote><pre># Find the cookies and put it into request<br>def parse_web(carrier, airport):</pre><pre>    s = requests.Session()<br>    r = s.get(&#39;<a href="https://www.transtats.bts.gov/Data_Elements.aspx?Data=2&#39;">https://www.transtats.bts.gov/Data_Elements.aspx?Data=2&#39;</a>)</pre><pre>    soup = bs(r.text, &#39;lxml&#39;)<br>    viewstate_element = soup.find(id=&quot;__VIEWSTATE&quot;)<br>    viewstate = viewstate_element[&#39;value&#39;]<br>    eventvalidation_element = soup.find(id=&quot;__EVENTVALIDATION&quot;)<br>    eventvalidation = eventvalidation_element[&#39;value&#39;]<br>    viewstategenerator_element =  soup.find(id=&quot;__VIEWSTATEGENERATOR&quot;)<br>    viewstategenerator = viewstategenerator_element[&quot;value&quot;]</pre><pre>    r = s.post(&#39;<a href="https://www.transtats.bts.gov/Data_Elements.aspx?Data=2&#39;">https://www.transtats.bts.gov/Data_Elements.aspx?Data=2&#39;</a>,<br>           data = (<br>           (&quot;__EVENTTARGET&quot;, &quot;&quot;),<br>           (&quot;__EVENTARGUMENT&quot;, &quot;&quot;),<br>           (&quot;__VIEWSTATE&quot;, viewstate),<br>           (&quot;__VIEWSTATEGENERATOR&quot;,viewstategenerator),<br>           (&quot;__EVENTVALIDATION&quot;, eventvalidation),<br>           (&quot;CarrierList&quot;, carrier),<br>           (&quot;AirportList&quot;, airport),<br>           (&quot;Submit&quot;, &quot;Submit&quot;)<br>          ))</pre><pre>   with open(&quot;{0}_and_{1}.html&quot;.format(carrier, airport), &quot;w&quot;) as f:<br>        f.write(r.text)</pre><p>3. Parse the datafile and collect the data</p><pre>import os<br>def get_files(datadir):<br>    files = os.listdir(datadir)<br>    return files</pre><pre>datafiles = get_files(os.getcwd())<br>data = []<br>for datafile in datafiles:</pre><pre>with open(datafile, &#39;r&#39;) as html:<br>        page = bs(html, &#39;lxml&#39;)<br>        rows = page.find_all(&#39;tr&#39;,&#39;dataTDRight&#39;)<br>        for row in rows:<br>            cells = row.find_all(&#39;td&#39;)<br>            values = [cell.text for cell in cells]<br>            if values[1] == &#39;TOTAL&#39;:<br>                continue<br>            entry = {}<br>            info = re.split(&quot;[_.]&quot;, datafile)<br>            entry[&#39;courier&#39;], entry[&#39;airport&#39;] = info[0], info[2]<br>            entry[&#39;year&#39;] = values[0]<br>            entry[&#39;month&#39;] = values[1]<br>            entry[&#39;flights&#39;] = {&#39;domestic&#39;: values[2],<br>                                &#39;international&#39;: values[3]}<br>            data.append(entry)</pre><h4>Mind-map</h4><p>Structure the key note in the mind-map, we can get the whole picture of the lesson 2. If you want to see the branch in detail, you could go up to check corresponding section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSjOO01Fry3ZMzkeZlXSjA.jpeg" /></figure><p>As always, feel free to like and repost if you learned some from this post. And please don’t feel any hesitation to ask question and give advice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cf9778abd8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Wrangling with MongoDB (Lesson 1 Data Extraction Fundamentals)]]></title>
            <link>https://medium.com/@yangforbig/data-wrangling-with-mongodb-lesson-1-d1df6363f540?source=rss-bfdc05745ee7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1df6363f540</guid>
            <category><![CDATA[data-wrangling]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Yang Wang]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 20:40:57 GMT</pubDate>
            <atom:updated>2017-07-25T22:27:48.720Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Study notes and mind-map for the free course of Data Wrangling with MongoDB in Udacity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Scn4HRbPdRwRlQaG8LYqXg.png" /></figure><p>This series of posts is my takeaway from the study of the course Data Wrangling with MongoDB in Udacity. The main content of each lesson is presented in <a href="http://www.xmind.net/">mind-map</a>. The purpose of using mind-map is to structure the topics in a graphic way where we can get a big picture of the lesson and organize some codes as quick reference for the problems and quizzes in the course.</p><p><strong>This post will include the the introduction of the course and the mind-map for lesson 1.</strong></p><p>This course is really about getting data ready so that any analysis built on a solid foundation of good data. We will work with lots of different type of data, music, energy, wikipedia and twitter. we will also teach you how to work with data in most of the formats you are likely to see, Json, XML, CSV, EXCEL, and HTML. In the last half the course show you how to store data in MongoDB and use it to support analysis. MongoDB is a powerful and scalable tool for big data problems.</p><blockquote>Lesson 1: Data Extraction Fundamentals</blockquote><blockquote>Lesson 2: Data in More Complex Formats</blockquote><blockquote>Lesson 3: Data Quality</blockquote><blockquote>Lesson4 : Working with MongoDB</blockquote><blockquote>Lesson5: Analyzing Data</blockquote><blockquote>Lesson6: Case Study — OpenStreet Map Data</blockquote><h4>What is Data Wrangling ?</h4><p><em>The process of gathering, extracting, cleaning, and storing our data.</em></p><p>Generally we should not trust any data we get. Where it does come from? What methods do we use to collect the data? Everywhere that humans are involved, there is a potential for problems with our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*uT9HSqCZccLaIp08QoyUaA.jpeg" /></figure><p>Before conduct analysis, we should ensure the quality of the data</p><ul><li>Test Assumptions about:</li></ul><p>(1) Test Values</p><p>(2) Data Types</p><p>(3) Shape</p><ul><li>Identify errors or outliers</li><li>Finding Missing Values</li></ul><p><strong>Mind-map (Enlarge for good view)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mbWVEsQSEcBdc2dYCzdKUQ.jpeg" /></figure><p>That’s all for the introduction and lesson 1. Please like the post or repost it if you like the content and the beauty of mind-map for learning. Always open to all the questions and improvements, just reply below and enjoy self-leaning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1df6363f540" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>