<?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[Machine Learning Study Notes - Medium]]></title>
        <description><![CDATA[Study notes on ML/DL and related topics - Medium]]></description>
        <link>https://medium.com/machine-learning-study-notes?source=rss----5e30a0a0c9f7---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Machine Learning Study Notes - Medium</title>
            <link>https://medium.com/machine-learning-study-notes?source=rss----5e30a0a0c9f7---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 09:44:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/machine-learning-study-notes" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Book note: Linear Algebra for Machine Learning (Jason Brownlee)]]></title>
            <link>https://medium.com/machine-learning-study-notes/book-note-linear-algebra-for-machine-learning-jason-brownlee-eaeb76854c71?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/eaeb76854c71</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[linear-algebra]]></category>
            <category><![CDATA[notebook]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:24:58 GMT</pubDate>
            <atom:updated>2019-01-08T23:24:58.684Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>“Linear algebra is a pillar of machine learning.” — Jason</em></blockquote><p>Check <a href="https://www.scribd.com/document/371769141/Jason-Brownlee-Basics-for-Linear-Algebra-for-Machine-Learning-Discover-the-Mathematical-Language-of-Data-in-Python-2018">THIS LINK</a> for reading book: <em>Jason-Brownlee-Basics-for-Linear-Algebra-for-Machine-Learning-Discover-the-Mathematical-Language-of-Data-in-Python-2018</em></p><h3>Linear Algebra Is Important in Machine Learning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D771OKYtmTPOgqAF.png" /></figure><h3>Study Linear Algebra Too Early</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VbNCgNREkvSiApeE.png" /></figure><h3>Study Too Much Linear Algebra</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*epLMHhsdMs4_urqr.png" /></figure><h3>Study Linear Algebra Wrong</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GcV4fix7CM0y3NXG.png" /></figure><h3>A Bette Way To Study Linear Algebra</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5K6TTTk7mmdOKave.png" /></figure><h3>What will be learnt in this book</h3><ul><li>Vector norms</li><li>Matrix multiplication</li><li>Matrix properties</li><li>Tensor &amp; its operations</li><li>Matrix factorization: Eigendecomposition &amp; Singular Value Decomposition (SVD)</li><li>Principal Component Analysis (PCA)</li><li>Linear Least Squares Regression</li></ul><h3>Types of Matrices</h3><ol><li>Square Matrix</li><li>Symmetric Matrix</li><li>Triangular Matrix</li><li>Diagonal Matrix</li><li>Identity Matrix</li><li>Orthogonal Matrix</li></ol><h3>Matrix Operations</h3><ol><li>Transpose</li><li>Inverse</li><li>Trace: Gives the sum of all of the diagonal entries of a matrix</li><li>Determinant</li><li>Rank: To estimate of the number of linearly independent rows or columns in a matrix.</li></ol><h3>Sparse Matrix</h3><p>Matrices that contain mostly zero values are called sparse, distinct from matrices where most of the values are non-zero, called dense.</p><blockquote><em>Very large matrices require a lot of memory, and some very large matrices that we wish to work<br>with are sparse.<br>In practice, most large matrices are sparse — almost all entries are zeros.</em></blockquote><h3>Matrix Decompositions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ab84K2DdlrakRNJa.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*nv7iVE_-lIWN-F_P.png" /></figure><p>Most common types of matrix decomposition:</p><ul><li>LU Decomposition</li><li>QR Decomposition</li><li>Cholesky Decomposition</li></ul><h3>LU Decomposition</h3><blockquote><em>The factors L and U are triangular matrices. The factorization that comes from </em><em>elimination.</em></blockquote><h4>LUP Decomposition</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fUwkAY_3EcmZID_W.png" /></figure><h3>QR Decomposition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/0*O-E-EOYqWP9CA1kM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/110/0*NryxPfnPxIwS9lLW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9qdkHBfXIpKvoT-2.png" /></figure><h3>Cholesky Decomposition</h3><p>The Cholesky decomposition is for square symmetric matrices where all values are greater than zero, so-called positive deﬁnite matrices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/118/0*eEHDlEH1LPMNDmUf.png" /></figure><p>Where L is the Lower triangular matrix, and Lᵀ is its transpose.<br>Or</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/141/0*xqSOZgEpbBzTO6bP.png" /></figure><p>Where U is the Upper Triangular matrix, and Uᵀ is its tranpose.</p><h3>Eigendecomposition</h3><blockquote><em>Eigendecomposition of a matrix is a type of decomposition that involves decomposing a square<br>matrix into a set of eigenvectors and eigenvalues.<br>One of the most widely used kinds of matrix decomposition is called eigendecomposition, in which we decompose a matrix into a set of eigenvectors and eigenvalues.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PXikEjcJ-HsPiu5m.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Jbp7L5WSByaWtzK.png" /></figure><blockquote><em>Not all square matrices can be decomposed into eigenvectors and eigenvalues</em></blockquote><p>The parent matrix can be shown to be a product of the eigenvectors and eigenvalues:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/173/0*qjyQjBksQGfkUwF4.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*eL14SS5LD8eYqL__.png" /></figure><blockquote><em>Almost all vectors change direction, when they are multiplied by A. <br>Certain exceptional vectors x are in the same direction as Ax. <br>Those are the “eigenvectors”.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3TX66GLuMCM-PU1X.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2ql_UV6R_eOqovbT.png" /></figure><h3>Singular Value Decomposition (SVD)</h3><blockquote><em>The Singular Value Decomposition is a highlight of linear algebra.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_koGvu1PbAGZza0r.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KGB-eNWUdHFdITK8.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X6BAOxdxRDZ7DzAZ.png" /></figure><blockquote><em>The singular value decomposition (SVD) provides another way to factorize a matrix, into singular vectors and singular values. The SVD allows us to discover some of the same kind of information as the eigendecomposition. However, the SVD is more generally applicable.</em></blockquote><h3>Pseudoinverse</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EclNr1Q6PPYCglQq.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*rM7nemQD53Y_kxOI.png" /></figure><h3>Dimensionality Reduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sifKL7tl7YdDYrCY.png" /></figure><p>-</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eaeb76854c71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/book-note-linear-algebra-for-machine-learning-jason-brownlee-eaeb76854c71">Book note: Linear Algebra for Machine Learning (Jason Brownlee)</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book note: Math for Machine Learning chapter 2]]></title>
            <link>https://medium.com/machine-learning-study-notes/book-note-math-for-machine-learning-chapter-2-92c39f860778?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/92c39f860778</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:24:25 GMT</pubDate>
            <atom:updated>2019-01-08T23:24:25.075Z</atom:updated>
            <content:encoded><![CDATA[<h3>Types of Vectors:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*f6-H92107RKswC6v.png" /></figure><h3>Mathematical “closure”:</h3><ul><li>Vector Space: Use small set of vectors, to represent a &quot;full closure&quot; of all vectors I expect in an operation.</li><li>Matrix: A collection of vectors.</li></ul><h3>Mind map of some concepts:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5gTcZw_cEmuEITCj.png" /></figure><h3>Properties for Matrix Multiplication:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/0*seXDsbbt8NrQEvib.png" /></figure><h3>Analytic geometry</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*sbOk4xHYRk3rYmpB.png" /></figure><p>-</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92c39f860778" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/book-note-math-for-machine-learning-chapter-2-92c39f860778">Book note: Math for Machine Learning chapter 2</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notes on Andrew Ng’s lecture: Types of learning (ML)]]></title>
            <link>https://medium.com/machine-learning-study-notes/notes-on-andrew-ngs-lecture-types-of-learning-ml-5b91c656c16c?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/5b91c656c16c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[lecture-notes]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:23:51 GMT</pubDate>
            <atom:updated>2019-01-08T23:23:50.969Z</atom:updated>
            <content:encoded><![CDATA[<h3>Supervised learning</h3><p>feeding algorithm data with right answers, so it can predict more accurately.</p><p>To be more terminology, it’s also called REGRESSION: Predict continues value output.</p><h3>CLASSIFICATION</h3><p>Depends on each result of the features comparison. A classification could have infinite features for comparing.</p><h3>FEATURES</h3><p>A simple question for the data, like is it red or blue? Is its size ranged in large or small? It always falls into a simple output, 0 or 1, or 2,3,4 etc.</p><h3>REGRESSION problem VS. CLASSIFICATION problem?</h3><p>?</p><h3>UNSUPERVISED LEARNING</h3><p>giving an unsupervised algorithm a bunch of data without any label, for instance it don’t know it’s right answer or wrong, but let the machine itself to decide what’s the pattern in it. Simple one is, a CLUSTERING ALGORITHM can help to seperate data set to different clusters, group them, label them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/0*jVP_oSfUCvenZQAb.png" /></figure><h3>Example of Clustering Algorithm</h3><p>Google News page, it recognises all similar news and gather to a story board.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/0*fCtevnAv_CRZGrzs.png" /></figure><p>Other examples like genes, marketing, social networks etc., also could be having high demands on CLUSTERING ALGORITHM, aka UNSUPERVISED LEARNING ALGORITHM.</p><h3>Octave</h3><p>a programming language, an alternative to Matlab. Aiming to build a Machine Learning prototype in a few lines of code. Highly recommended by Andrew Ng.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b91c656c16c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/notes-on-andrew-ngs-lecture-types-of-learning-ml-5b91c656c16c">Notes on Andrew Ng’s lecture: Types of learning (ML)</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free Hardwares for Deep Learning]]></title>
            <link>https://medium.com/machine-learning-study-notes/free-hardwares-for-deep-learning-9572fc7cc046?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/9572fc7cc046</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:23:32 GMT</pubDate>
            <atom:updated>2019-01-08T23:23:32.520Z</atom:updated>
            <content:encoded><![CDATA[<h3>Commands</h3><ul><li>Check OS: cat /etc/os-release</li><li>Check Storage: df -h</li><li>Check CPU: cat /proc/cpuinfo</li><li>Check RAM: cat /proc/meminfo</li><li>Check GPU:</li></ul><pre><strong>$</strong> sudo apt-get install nvidia-smi<br><strong>$</strong> nvidia-smi -stats</pre><h3>Google Colab (Jupyter Notebook)</h3><p>Link: <a href="https://colab.research.google.com/notebooks/welcome.ipynb">https://colab.research.google.com/notebooks/welcome.ipynb</a></p><ul><li>OS: Ubuntu 17.10 Artful Aardvark</li><li>GPU: (12hrs) NVIDIA Tesla K80 GPU × 1</li><li>CPU: Intel(R) Xeon(R) CPU @ 2.30GHz × 1 Core</li><li>RAM: 13GB</li><li>Disk: 40GB</li></ul><h3>Kaggle Kernel (Jupyter Notebook)</h3><p><a href="https://www.kaggle.com/docs/kernels">Refer to Kaggle: How to use Kaggle — Kenels</a><br>Link: <a href="https://www.kaggle.com/kernels">https://www.kaggle.com/kernels</a></p><ul><li>OS: Debian GNU/Linux 8 (jessie)</li><li>GPU: (Queue needed) NVidia Tesla K80 GPU × 1</li><li>CPU: Intel(R) Xeon(R) CPU @ 2.30GHz × 2 Cores</li><li>RAM: 25.5GB</li><li>Disk: 5.2GB</li></ul><h3>Azure Notebooks (Jupyter Notebook)</h3><p>Link: <a href="https://notebooks.azure.com/Microsoft/libraries/samples">https://notebooks.azure.com/Microsoft/libraries/samples</a></p><ul><li>OS: Ubuntu 16.04.5 LTS</li><li>GPU: N/A</li><li>CPU: Intel(R) Xeon(R) CPU E5–2673 v4 @ 2.30GHz × 2 Cores</li><li>RAM: 4GB</li><li>Disk: 20GB</li></ul><h3>AWS p2</h3><p><a href="https://aws.amazon.com/ec2/instance-types/p2/">Refer to AWS: Amazon EC2 P2 Instances</a></p><ul><li>GPU: NVIDIA Tesla K80 GPU × (1 to 16)</li><li>CPU: Intel Xeon® E5–2686 v4 × (4 to 64)</li><li>RAM: 61G or 488G or 732G</li></ul><blockquote><em>P2 instances provide up to 16 </em><strong><em>NVIDIA K80 GPUs</em></strong><em>, 64 vCPUs and 732 GiB of host memory, with a combined 192 GB of GPU memory, 40 thousand parallel processing cores, 70 teraflops of single precision floating point performance, and over 23 teraflops of double precision floating point performance. <br>P2 instances also offer GPUDirect™ (peer-to-peer GPU communication) capabilities for up to 16 GPUs, so that multiple GPUs can work together within a single host.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*YU7FGk6cCm2k-BGg.png" /></figure><h3>DIY</h3><h3>GPU</h3><ul><li><a href="https://www.amazon.com/Nvidia-Tesla-GDDR5-Cores-Graphic/dp/B00Q7O7PQA">NVIDIA Tesla K80 GPU</a>: RMB 30,000, VRAM 24GB (GDDR5), 256 Bit</li></ul><h3>CPU</h3><ul><li><a href="https://www.ebay.com/itm/Intel-Xeon-E5-2686-v4-SR2K8-2-30GHz-18-Core-LGA2011-3/323405561085?epid=20005107689&amp;hash=item4b4c793cfd%3Ag%3A6cQAAOSwlQ5baCxE&amp;LH_ItemCondition=3">Intel Xeon® E5-2686 v4</a>: RMB 12,000, 8 Cores, 1.7GHz</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9572fc7cc046" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/free-hardwares-for-deep-learning-9572fc7cc046">Free Hardwares for Deep Learning</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Simple Model for ML (Decision Tree)]]></title>
            <link>https://medium.com/machine-learning-study-notes/build-simple-model-for-ml-decision-tree-30dd5b4dc1c?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/30dd5b4dc1c</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[kaggle]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:22:35 GMT</pubDate>
            <atom:updated>2019-01-08T23:22:35.024Z</atom:updated>
            <content:encoded><![CDATA[<h3>Steps of building a model</h3><p>[Refer to Kaggle: Your First Machine Learning Model<br>](<a href="https://www.kaggle.com/dansbecker/your-first-machine-learning-model)">https://www.kaggle.com/dansbecker/your-first-machine-learning-model)</a></p><p>The steps to building and using a model are:</p><ul><li><strong>Define:</strong> What type of model will it be? A decision tree? Some other type of model? Some other parameters of the model type are specified too.</li><li><strong>Fit:</strong> Capture patterns from provided data. This is the heart of modeling.</li><li><strong>Predict:</strong> Just what it sounds like</li><li><strong>Evaluate</strong>: Determine how accurate the model’s predictions are.</li></ul><h3>Underfitting and Overfitting</h3><p><a href="https://www.kaggle.com/dansbecker/underfitting-and-overfitting">Refer to Kaggle: Underfitting and Overfitting</a></p><ul><li>Overfitting: The model matches the <strong>training data</strong> almost perfectly, but does poorly in predicting <strong>new data</strong>.</li><li>Underfitting: The model fails to capture important patterns &amp; distinctions in the data, so it performs poorly even in <strong>training data</strong>.</li></ul><p>As the Decision Tree Model&#39;s depth goes deeper, the Underfitting goes lesser, but there is <strong>&quot;turn&quot;</strong> at which it starts Overfitting and the error goes larger.</p><p>For finding out the <strong>“turning point”</strong>, we need to test out some depths , namely the max_leaf_nodes. At which the error start to turn descending to ascending, we will choose that depth as the best depth for training data in Decision Tree Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*yLakYNAVKPkgJqvk.png" /></figure><p>-</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30dd5b4dc1c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/build-simple-model-for-ml-decision-tree-30dd5b4dc1c">Build Simple Model for ML (Decision Tree)</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deal with Missing Data]]></title>
            <link>https://medium.com/machine-learning-study-notes/deal-with-missing-data-33e9e232f2fd?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/33e9e232f2fd</guid>
            <category><![CDATA[ml-engineering]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:21:56 GMT</pubDate>
            <atom:updated>2019-01-08T23:21:56.795Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Most libraries (including scikit-learn) will give you an error if you try to build a model using data with missing values.</em></blockquote><p><a href="https://www.kaggle.com/dansbecker/handling-missing-values">Refer to Kaggle: Handling Missing Values</a></p><h3>Solution 1: Drop Columns with Missing Values</h3><p>In many cases, you’ll have both a training dataset and a test dataset. You will want to drop the same columns in both DataFrames.</p><p>So, it’s somewhat usually not the best solution. However, it can be useful when most values in a column are missing.</p><h3>Solution 2: Imputation</h3><blockquote><em>Imputation fills in the missing value with some number. Imputation is the standard approach, and it usually works well.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33e9e232f2fd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/deal-with-missing-data-33e9e232f2fd">Deal with Missing Data</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notes on Andrew Ng’s lecture on Coursera (ML)]]></title>
            <link>https://medium.com/machine-learning-study-notes/notes-on-andrew-ngs-lecture-on-coursera-ml-58c12a2ca52e?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/58c12a2ca52e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[lecture-notes]]></category>
            <category><![CDATA[andrew-ng]]></category>
            <category><![CDATA[coursera]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:21:31 GMT</pubDate>
            <atom:updated>2019-01-08T23:21:31.156Z</atom:updated>
            <content:encoded><![CDATA[<p>In general, any machine learning problem can be assigned to one of two broad classifications:<br>Supervised learning and Unsupervised learning.</p><blockquote><em>Tom Mitchell provides a more modern definition: “A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E.”</em></blockquote><h3>Supervised learning: “Right answers” given.</h3><ul><li>It can be a <strong>Regression problem</strong>, which predict continuous valued output,</li><li>also can be a <strong>Classification</strong> problem, which predict discrete valued output.</li></ul><h3>Unsupervised learning:</h3><p>is to find out some <strong>structure</strong> in a dataset, and find out <strong>clusters</strong> is a big part of the work. <br><strong>With unsupervised learning there is NO feedback based on the prediction results.</strong></p><h3>There’s also Non-clustering problem for unsupervised learning</h3><p>like the “cocktail party algorithm”.</p><h3>Octave</h3><p>Octave is much more faster to implement a prototype than other languages. We can first use Octave to test our ideas, models, and transfer it into other languages when it’s success.</p><h3>Linear regression model</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*0XA5-pkas7-MP2RM.png" /></figure><h3>Cost function</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/0*LK2iAXVvpBaEBW9p.png" /></figure><h3>Contour Plot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*ethJ7ZpvBedNlGii.png" /></figure><h3>Gradient Descent intuition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/0*RxuoLWcttvJarOIi.png" /></figure><h3>Gradient descent algorithm</h3><p>The gradient descent algorithm is: <strong>repeat until convergence:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/0*uhRlwPqLtMotapgO.png" /></figure><p>where j=0,1 represents the feature index number.</p><p>simultaneously update the parameters θ1, θ2…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/0*v3qp95_oKm9dmIlt.png" /></figure><h3>“Batch” Gradient descent</h3><p><strong>“Batch”: Each step of gradient descent computes ALL the training data.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58c12a2ca52e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/notes-on-andrew-ngs-lecture-on-coursera-ml-58c12a2ca52e">Notes on Andrew Ng’s lecture on Coursera (ML)</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-hot Encoding]]></title>
            <link>https://medium.com/machine-learning-study-notes/one-hot-encoding-38f0e4e2ef54?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/38f0e4e2ef54</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ml-engineering]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:20:32 GMT</pubDate>
            <atom:updated>2019-01-08T23:20:32.624Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.quora.com/What-is-one-hot-encoding-and-when-is-it-used-in-data-science">Refer to Quora: What is one-hot encoding and when is it used in data science?</a><br><a href="https://www.youtube.com/watch?v=BecEHOVmx9o">Refer to youtube: A demo of One Hot Encoding (TensorFlow Tip of the Week)</a></p><blockquote><em>“Encoding” is to take a number to represent a categorical value.</em></blockquote><p>Lable encoding:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/0*njeRhglD9Cgu-t_n.png" /></figure><p>But the problem is, those values would rather be <strong>nominal values</strong> instead of <strong>ordinal values</strong>, because we can’t say one is greater or smaller than another.<br>And there it comes One-hot encoding, which we only take numbers 1 &amp; 0 to represent the categorical value, but in a <strong>TABLE</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/0*z1KrZqBsLOgPrl9z.png" /></figure><p>Note that, the the result of encoding will be as a <strong>VECTOR</strong>.</p><blockquote><em>In this case, the value for </em>sample-1<em> is encoded to a </em><strong><em>vector</em></strong><em> </em><em>[1,0,0,0], and value of </em>sample-5<em> is encoded to </em><strong><em>vector</em></strong><em> </em><em>[0,0,0,1].</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*mIAmQDWcCB_-dyiu.png" /></figure><p>-</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38f0e4e2ef54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/one-hot-encoding-38f0e4e2ef54">One-hot Encoding</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book note: Intro to Statistical Learning (ISL)]]></title>
            <link>https://medium.com/machine-learning-study-notes/book-note-intro-to-statistical-learning-isl-ce14467ec5dc?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/ce14467ec5dc</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:20:04 GMT</pubDate>
            <atom:updated>2019-01-08T23:20:03.910Z</atom:updated>
            <content:encoded><![CDATA[<h3>Model selection: Prediction vs. Inference</h3><ul><li>If our goal is to <strong>understand</strong> the data, namely the inference, then it&#39;s better to choose the model with more <strong>interpretability</strong>.</li><li>if our goal is to <strong>predict</strong>, then it’s good to go with models that have more <strong>flexibility</strong> but less understandable, sometime it may refer to “non-linear” models.</li></ul><h3>Model selection: Flexibility vs. Interpretability</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/0*YYOwOeASkdt5KGBS.png" /></figure><h3>Clustering</h3><p>Cluster Analysis is NOT to compare input and output(x &amp; y), but to compare two variables (x1 &amp; x2),<br>because in the case there&#39;s no clear associate for x &amp; y, we have left no choice but to analyze variables themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*Jqabbb0vjI_Akoen.png" /></figure><h3>Model selection: Quantitative vs. Qualitative</h3><ul><li>Numerical: Linear Regression</li><li>Categorical: Logistic Regression, boosting, KNN</li></ul><h3>Model selection: Train MAE vs. Test MAE</h3><blockquote><em>In general, we do not really care how well the method works training on the </em><em>Training data.<br>Rather, we are interested in the accuracy of the predictions that we obtain when we apply our method to previously </em><em>Unseen Test data.</em></blockquote><p><strong>We’d like to select the model for which the average of this quantity — the </strong><strong>test MSE—is as small as possible.</strong></p><blockquote><em>There is no guarantee that the method with the lowest training MSE will also have the lowest test MSE.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/0*wSSFTBJjKdKigyW3.png" /></figure><blockquote><em>Regardless of whether overfitting has occurred, we almost always want the </em><em>Training MSE to be SMALLER than the </em><em>Test MSE, <br>because most statistical learning methods either directly or indirectly seek to </em><strong><em>minimize</em></strong><em> the training MSE. Overfitting refers specifically to the case in which a less flexible model would have yielded a smaller test MSE.</em></blockquote><h3>Bias-Variance Trade-off</h3><p>The relationship between bias, Variance and Test MSE</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*NOIk0iiVckDkYWo2.png" /></figure><h3>Evaluate Classification: Training Error Ratevs. Test error</h3><p>Training Error Rate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/0*KQiX6TLRwmhHl3bZ.png" /></figure><p>Test Error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/0*qowXqy6bmylOTTvc.png" /></figure><h3>Bayes Classifier</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/0*Gj_b1QYQYsUiZ0ed.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/0*gAM_qZoDcXe2pnov.png" /></figure><p><strong>Bayes decision boundary</strong>: The Bayes classifier’s prediction is determined by the Bayes decision boundary; an observation that falls on the orange side of the boundary will be assigned to the orange class, and similarly an observation on the blue side of the boundary will be assigned to the blue class.</p><p>Bayes Error Rate: The Bayes classifier produces the lowest possible test error rate, called the Bayes error rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/0*ldFs-wMgURw5aZb4.png" /></figure><blockquote><em>Note that: In theory we would always like to predict qualitative responses using the </em><em>Bayes classifier. But for real data, we do not know the conditional distribution of Y given X, and so computing the </em><em>Bayes classifier is </em><strong><em>impossible</em></strong><em>. Therefore, the Bayes classifier serves as an </em><strong><em>unattainable gold standard</em></strong><em> against which to compare other methods.</em></blockquote><h3>K-Nearest Neighbors (KNN Classifier)</h3><blockquote><em>Many approaches attempt to estimate the conditional distribution of Y given X, and then classify a given observation to the class with highest estimated probability. One such method is the K-nearest neighbors (KNN) classifier.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/0*91wEVuHjqT9vJcD9.png" /></figure><p>KNN applies Bayes rule and classifies the test observation x0 to the class with the largest probability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/0*eo1KfT-mF3NGgbgz.png" /></figure><blockquote><em>In the left-hand panel, we have plotted a small training data set consisting of six blue and six orange observations. Our goal is to make a prediction for the point labeled by the black cross. Suppose that we choose K = 3. Then KNN will first identify the three observations that are closest to the cross. This neighborhood is shown as a circle. It consists of two blue points and one orange point, resulting in estimated probabilities of 2/3 for the blue class and 1/3 for the orange class. Hence KNN will predict that the black cross belongs to the blue class. In the right-hand panel of Figure 2.14 we have applied the KNN approach with K = 3 at all of the possible values for X1 and X2, and have drawn in the corresponding KNN decision boundary.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce14467ec5dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/book-note-intro-to-statistical-learning-isl-ce14467ec5dc">Book note: Intro to Statistical Learning (ISL)</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stochastic Gradient Descent]]></title>
            <link>https://medium.com/machine-learning-study-notes/stochastic-gradient-descent-aaaa6d101f98?source=rss----5e30a0a0c9f7---4</link>
            <guid isPermaLink="false">https://medium.com/p/aaaa6d101f98</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[statistical-learning]]></category>
            <dc:creator><![CDATA[Solomon Xie]]></dc:creator>
            <pubDate>Tue, 08 Jan 2019 23:19:11 GMT</pubDate>
            <atom:updated>2019-01-08T23:19:11.758Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://machinelearningmastery.com/linear-regression-tutorial-using-gradient-descent-for-machine-learning/">Refer to: Linear Regression Tutorial Using Gradient Descent for Machine Learning</a></p><p>Gradient Descent is the process of <strong>minimizing</strong> a function by following the gradients of the cost function.</p><p>In Machine learning we can use a similar technique called stochastic gradient descent to minimize the error of a model on our training data.</p><p>Iteration:<br>The way this works is that each training instance is shown to the model one at a time. The model makes a prediction for a training instance, the error is calculated and the model is updated in order to reduce the error for the next prediction.</p><p>This procedure can be used <strong>to find the set of coefficients</strong> in a model that result in the smallest error for the model on the training data. <br>Each iteration the coefficients, called weights (w) in machine learning language are updated using the equation:</p><pre>w = w – alpha * delta</pre><p>Where w is the <strong>coefficient or weight</strong> being optimized, <br>alpha is a <strong>learning rate</strong> that you must configure (e.g. 0.1) and <br>gradient is the error for the model on the training data attributed to the weight.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaaa6d101f98" width="1" height="1" alt=""><hr><p><a href="https://medium.com/machine-learning-study-notes/stochastic-gradient-descent-aaaa6d101f98">Stochastic Gradient Descent</a> was originally published in <a href="https://medium.com/machine-learning-study-notes">Machine Learning Study Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>