!(https://hackernoon.com/hn-images/1*kfTtbiN7TEppfvIDYeMnhw.jpeg)\n\nMachine Learning Practitioners have different personalities. While some of them are “I am an expert in X and X can train on any type of data”, where X = some algorithm, some others are “Right tool for the right job people”. A lot of them also subscribe to “Jack of all trades. Master of one” strategy, where they have one area of deep expertise and know slightly about different fields of Machine Learning. That said, no one can deny the fact that as practicing Data Scientists, we will have to know basics of some common machine learning algorithms, which would help us engage with a new-domain problem we come across. This is a whirlwind tour of common machine learning algorithms and quick resources about them which can help you get started on them.\n\n### 1\\. Principal Component Analysis(PCA)/SVD\n\nPCA is an unsupervised method to understand global properties of a dataset consisting of vectors. Covariance Matrix of data points is analyzed here to understand what dimensions(mostly)/ data points (sometimes) are more important (ie have high variance amongst themselves, but low covariance with others). One way to think of top PCs of a matrix is to think of its eigenvectors with highest eigenvalues. SVD is essentially a way to calculate ordered components too, but you don’t need to get the covariance matrix of points to get it.\n\n!(https://hackernoon.com/hn-images/1*HjYtbYvrP5ko0HC7YBX4cA.png)\n\nThis Algorithm helps one fight curse of dimensionality by getting datapoints with reduced dimensions.\n\n### Libraries:\n\n[https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.svd.html](https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.svd.html)\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html](http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html)\n\n### Introductory Tutorial:\n\n[https://arxiv.org/pdf/1404.1100.pdf](https://arxiv.org/pdf/1404.1100.pdf)\n\n### 2a. Least Squares and Polynomial Fitting\n\nRemember your Numerical Analysis code in college, where you used to fit lines and curves to points to get an equation. You can use them to fit curves in Machine Learning for very small datasets with low dimensions. (For large data or datasets with many dimensions, you might just end up terribly overfitting, so don’t bother). OLS has a closed form solution, so you don’t need to use complex optimization techniques.\n\n!(https://hackernoon.com/hn-images/1*x7hjx5Lk_SvrteIYqAnx5g.jpeg)\n\nAs is obvious, use this algorithm to fit simple curves / regression\n\n### Libraries:\n\n[https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.lstsq.html](https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.lstsq.html)[https://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.polyfit.html](https://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.polyfit.html)\n\n### Introductory Tutorial:\n\n[https://lagunita.stanford.edu/c4x/HumanitiesScience/StatLearning/asset/linear\\_regression.pdf](https://lagunita.stanford.edu/c4x/HumanitiesScience/StatLearning/asset/linear_regression.pdf)\n\n### 2b. Constrained Linear Regression\n\nLeast Squares can get confused with outliers, spurious fields and noise in data. We thus need constraints to decrease the variance of the line we fit on a dataset. The right method to do it is to fit a linear regression model which will ensure that the weights do not misbehave. Models can have L1 norm (LASSO) or L2 (Ridge Regression) or both (elastic regression). Mean Squared Loss is optimized.\n\n!(https://hackernoon.com/hn-images/1*pVbeQKc9qvtYRAIO4F9pdA.jpeg)\n\nUse these algorithms to fit regression lines with constraints, avoiding overfitting and masking noise dimensions from model.\n\n### Libraries:\n\n[http://scikit-learn.org/stable/modules/linear\\_model.html](http://scikit-learn.org/stable/modules/linear_model.html)\n\n### Introductory Tutorial(s):\n\n[https://www.youtube.com/watch?v=5asL5Eq2x0A](https://www.youtube.com/watch?v=5asL5Eq2x0A)\n\n[https://www.youtube.com/watch?v=jbwSCwoT51M](https://www.youtube.com/watch?v=jbwSCwoT51M)\n\n### 3\\. K means Clustering\n\nEveryone’s favorite unsupervised clustering algorithm. Given a set of data points in form of vectors, we can make clusters of points based on distances between them. It’s an Expectation Maximization algorithm that iteratively moves the centers of clusters and then clubs points with each cluster centers. The input the algorithm has taken is the number of clusters which are to be generated and the number of iterations in which it will try to converge clusters.\n\n!(https://hackernoon.com/hn-images/1*ZPx88gYG1DsTwGmjBOc5Aw.png)\n\nAs is obvious from the name, you can use this algorithm to create K clusters in dataset\n\n### Library:\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html](http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html)\n\n### Introductory Tutorial(s):\n\n[https://www.youtube.com/watch?v=hDmNF9JG3lo](https://www.youtube.com/watch?v=hDmNF9JG3lo)\n\n[https://www.datascience.com/blog/k-means-clustering](https://www.datascience.com/blog/k-means-clustering)\n\n### 4\\. Logistic Regression\n\nLogistic Regression is constrained Linear Regression with a nonlinearity (sigmoid function is used mostly or you can use tanh too) application after weights are applied, hence restricting the outputs close to +/- classes (which is 1 and 0 in case of sigmoid). Cross-Entropy Loss functions are optimized using Gradient Descent. A note to beginners: Logistic Regression is used for classification, not regression. You can also think of Logistic regression as a one layered Neural Network. Logistic Regression is trained using optimization methods like Gradient Descent or L-BFGS. NLP people will often use it with the name of Maximum Entropy Classifier.\n\nThis is what a Sigmoid looks like:\n\n!(https://hackernoon.com/hn-images/1*Sb5O5yzsZmfVgiePgGln1Q.jpeg)\n\nUse LR to train simple, but very robust classifiers.\n\n### Library:\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.linear\\_model.LogisticRegression.html](http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html)\n\n### Introductory Tutorial(s):\n\n[https://www.youtube.com/watch?v=-la3q9d7AKQ](https://www.youtube.com/watch?v=-la3q9d7AKQ)\n\n### 5\\. SVM (Support Vector Machines)\n\nSVMs are linear models like Linear/ Logistic Regression, the difference is that they have different margin-based loss function (The derivation of Support Vectors is one of the most beautiful mathematical results I have seen along with eigenvalue calculation). You can optimize the loss function using optimization methods like L-BFGS or even SGD.\n\n!(https://hackernoon.com/hn-images/1*_qnx-GnWBNYlpeEy9Z7aWQ.jpeg)\n\nAnother innovation in SVMs is the usage of kernels on data to feature engineer. If you have good domain insight, you can replace the good-old RBF kernel with smarter ones and profit.\n\nOne unique thing that SVMs can do is learn one class classifiers.\n\nSVMs can used to Train a classifier (even regressors)\n\n### Library:\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html](http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html)\n\n### Introductory Tutorial(s):\n\n[https://www.youtube.com/watch?v=eHsErlPJWUU](https://www.youtube.com/watch?v=eHsErlPJWUU)\n\n**Note:** SGD based training of both Logistic Regression and SVMs are found in SKLearn’s [http://scikit-learn.org/stable/modules/generated/sklearn.linear\\_model.SGDClassifier.html](http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html) , which I often use as it lets me check both LR and SVM with a common interface. You can also train it on >RAM sized datasets using mini batches.\n\n### 6\\. Feedforward Neural Networks\n\nThese are basically multilayered Logistic Regression classifiers. Many layers of weights separated by non-linearities (sigmoid, tanh, relu + softmax and the cool new selu). Another popular name for them is Multi-Layered Perceptrons. FFNNs can be used for classification and unsupervised feature learning as autoencoders.\n\n!(https://hackernoon.com/hn-images/1*Njzm1u6cgWMzJwvgBK1ABg.jpeg)\n\n_Multi-Layered perceptron_\n\n!(https://hackernoon.com/hn-images/1*32eXUEJTlPbfUWPPBxa5CQ.jpeg)\n\n_FFNN as an autoencoder_\n\nFFNNs can be used to train a classifier or extract features as autoencoders\n\n### Libraries:\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.neural\\_network.MLPClassifier.html#sklearn.neural\\_network.MLPClassifier](http://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPClassifier.html#sklearn.neural_network.MLPClassifier)\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.neural\\_network.MLPRegressor.html](http://scikit-learn.org/stable/modules/generated/sklearn.neural_network.MLPRegressor.html)\n\n[https://github.com/keras-team/keras/blob/master/examples/reuters\\_mlp\\_relu\\_vs\\_selu.py](https://github.com/keras-team/keras/blob/master/examples/reuters_mlp_relu_vs_selu.py)\n\n### Introductory Tutorial(s):\n\n[http://www.deeplearningbook.org/contents/mlp.html](http://www.deeplearningbook.org/contents/mlp.html)\n\n[http://www.deeplearningbook.org/contents/autoencoders.html](http://www.deeplearningbook.org/contents/autoencoders.html)\n\n[http://www.deeplearningbook.org/contents/representation.html](http://www.deeplearningbook.org/contents/representation.html)\n\n### 7\\. Convolutional Neural Networks (Convnets)\n\nAlmost any state of the art Vision based Machine Learning result in the world today has been achieved using Convolutional Neural Networks. They can be used for Image classification, Object Detection or even segmentation of images. Invented by Yann Lecun in late 80s-early 90s, Convnets feature convolutional layers which act as hierarchical feature extractors. You can use them in text too (and even graphs).\n\n!(https://hackernoon.com/hn-images/1*Qwlwaeaw8ZoMJlioAw4zGw.png)\n\nUse convnets for state of the art image and text classification, object detection, image segmentation.\n\n### Libraries:\n\n[https://developer.nvidia.com/digits](https://developer.nvidia.com/digits)\n\n[https://github.com/kuangliu/torchcv](https://github.com/kuangliu/torchcv)\n\n[https://github.com/chainer/chainercv](https://github.com/chainer/chainercv)\n\n[https://keras.io/applications/](https://keras.io/applications/)\n\n### Introductory Tutorial(s):\n\n[http://cs231n.github.io/](http://cs231n.github.io/)\n\n[https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/](https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/)\n\n### 8\\. Recurrent Neural Networks (RNNs):\n\nRNNs model sequences by applying the same set of weights recursively on the aggregator state at a time t and input at a time t (Given a sequence has inputs at times 0..t..T, and have a hidden state at each time t which is output from t-1 step of RNN). Pure RNNs are rarely used now but its counterparts like LSTMs and GRUs are state of the art in most sequence modeling tasks.\n\n!(https://hackernoon.com/hn-images/1*QFge9bi7_guc4HLzmdKJag.jpeg)\n\nRNN (If here is a densely connected unit and a nonlinearity, nowadays f is generally LSTMs or GRUs ). LSTM unit which is used instead of a plain dense layer in a pure RNN.\n\n!(https://hackernoon.com/hn-images/1*L6a7zn51aI8H3xRD1iKSDA.jpeg)\n\nUse RNNs for any sequence modelling task specially text classification, machine translation, language modelling\n\n### Library:\n\n[https://github.com/tensorflow/models](https://github.com/tensorflow/models) (Many cool NLP research papers from Google are here)\n\n[https://github.com/wabyking/TextClassificationBenchmark](https://github.com/wabyking/TextClassificationBenchmark)\n\n[http://opennmt.net/](http://opennmt.net/)\n\n### Introductory Tutorial(s):\n\n[http://cs224d.stanford.edu/](http://cs224d.stanford.edu/)\n\n[http://www.wildml.com/category/neural-networks/recurrent-neural-networks/](http://www.wildml.com/category/neural-networks/recurrent-neural-networks/)\n\n[http://colah.github.io/posts/2015-08-Understanding-LSTMs/](http://colah.github.io/posts/2015-08-Understanding-LSTMs/)\n\n### 9\\. Conditional Random Fields (CRFs)\n\nCRFs are probably the most frequently used models from the family of Probabilitic Graphical Models (PGMs). They are used for sequence modeling like RNNs and can be used in combination with RNNs too. Before Neural Machine Translation systems came in CRFs were the state of the art and in many sequence tagging tasks with small datasets, they will still learn better than RNNs which require a larger amount of data to generalize. They can also be used in other structured prediction tasks like Image Segmentation etc. CRF models each element of the sequence (say a sentence) such that neighbors affect a label of a component in a sequence instead of all labels being independent of each other.\n\nUse CRFs to tag sequences (in Text, Image, Time Series, DNA etc.)\n\n### Library:\n\n[https://sklearn-crfsuite.readthedocs.io/en/latest/](https://sklearn-crfsuite.readthedocs.io/en/latest/)\n\n### Introductory Tutorial(s):\n\n[http://blog.echen.me/2012/01/03/introduction-to-conditional-random-fields/](http://blog.echen.me/2012/01/03/introduction-to-conditional-random-fields/)\n\n7 part lecture series by Hugo Larochelle on Youtube: [https://www.youtube.com/watch?v=GF3iSJkgPbA](https://www.youtube.com/watch?v=GF3iSJkgPbA)\n\n### 10\\. Decision Trees\n\nLet’s say I am given an Excel sheet with data about various fruits and I have to tell which look like Apples. What I will do is ask a question “Which fruits are red and round ?” and divide all fruits which answer yes and no to the question. Now, All Red and Round fruits might not be apples and all apples won’t be red and round. So I will ask a question “Which fruits have red or yellow color hints on them? ” on red and round fruits and will ask “Which fruits are green and round ?” on not red and round fruits. Based on these questions I can tell with considerable accuracy which are apples. This cascade of questions is what a decision tree is. However, this is a decision tree based on my intuition. Intuition cannot work on high dimensional and complex data. We have to come up with the cascade of questions automatically by looking at tagged data. That is what Machine Learning based decision trees do. Earlier versions like CART trees were once used for simple data, but with bigger and larger dataset, the bias-variance tradeoff needs to solved with better algorithms. The two common decision trees algorithms used nowadays are Random Forests (which build different classifiers on a random subset of attributes and combine them for output) and Boosting Trees (which train a cascade of trees one on top of others, correcting the mistakes of ones below them).\n\nDecision Trees can be used to classify datapoints (and even regression)\n\n### Libraries\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html)\n\n[http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html](http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingClassifier.html)\n\n[http://xgboost.readthedocs.io/en/latest/](http://xgboost.readthedocs.io/en/latest/)\n\n[https://catboost.yandex/](https://catboost.yandex/)\n\n### Introductory Tutorial:\n\n[http://xgboost.readthedocs.io/en/latest/model.html](http://xgboost.readthedocs.io/en/latest/model.html)\n\n[https://arxiv.org/abs/1511.05741](https://arxiv.org/abs/1511.05741)\n\n[https://arxiv.org/abs/1407.7502](https://arxiv.org/abs/1407.7502)\n\n[http://education.parrotprediction.teachable.com/p/practical-xgboost-in-python](http://education.parrotprediction.teachable.com/p/practical-xgboost-in-python)\n\n### TD Algorithms (Good To Have)\n\nIf you are still wondering how can any of the above methods solve tasks like defeating Go world champion like DeepMind did, they cannot. All the 10 type of algorithms we talked about before this was Pattern Recognition, not strategy learners. To learn strategy to solve a multi-step problem like winning a game of chess or playing Atari console, we need to let an agent-free in the world and learn from the rewards/penalties it faces. This type of Machine Learning is called Reinforcement Learning. A lot (not all) of recent successes in the field is a result of combining perception abilities of a convent or a LSTM to a set of algorithms called Temporal Difference Learning. These include Q-Learning, SARSA and some other variants. These algorithms are a smart play on Bellman’s equations to get a loss function that can be trained with rewards an agent gets from the environment.\n\nThese algorithms are used to automatically play games mostly :D, also other applications in language generation and object detection.\n\n### Libraries:\n\n[https://github.com/keras-rl/keras-rl](https://github.com/keras-rl/keras-rl)\n\n[https://github.com/tensorflow/minigo](https://github.com/tensorflow/minigo)\n\n### Introductory Tutorial(s):\n\nGrab the free Sutton and Barto book: [https://web2.qatar.cmu.edu/~gdicaro/15381/additional/SuttonBarto-RL-5Nov17.pdf](https://web2.qatar.cmu.edu/~gdicaro/15381/additional/SuttonBarto-RL-5Nov17.pdf)\n\nWatch David Silver course: [https://www.youtube.com/watch?v=2pWv7GOvuf0](https://www.youtube.com/watch?v=2pWv7GOvuf0)\n\nThese are the 10 machine learning algorithms which you can learn to become a data scientist.\n\nYou can also read about machine learning libraries [here](https://blog.paralleldots.com/data-science/lesser-known-machine-learning-libraries-part-ii/).\n\nWe hope you liked the article. Please [Sign Up](http://https//user.apis.paralleldots.com/signing-up?utm_source=blog&utm_medium=chat&utm_campaign=paralleldots_blog) for a free ParallelDots account to start your AI journey. You can also check demo’s of our APIs [here](https://www.paralleldots.com/ai-apis).\n\nRead the original article [here](https://blog.paralleldots.com/data-science/machine-learning/ten-machine-learning-algorithms-know-become-data-scientist/).