tag:blogger.com,1999:blog-36613609323332606892017-11-27T21:08:39.367-08:00Eternal LearnerAshhttp://www.blogger.com/profile/00526603825000049836noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-3661360932333260689.post-16617081060637618612017-07-13T12:03:00.001-07:002017-07-13T12:03:55.871-07:00Logistic RegressionThink of a question "Will it rain today evening?". To answer the question, various inputs need to be considered: temperature, humidity, wind etc. And the answer will be either "It is very likely" or "It is not likely. If you think of the process, and the outcome, the influence of various independent variables was considered and the probability of a discrete outcome was given. The model will not deliver an absolute answer but rather given you the probability of one of the discrete outcome happening.<br /><br />The function used to determine the probability of the outcome is a called a logit function. So Logistic regression is also known as logit regression. The output of a logit function lies between 0 and 1 (probability).Ashhttp://www.blogger.com/profile/00526603825000049836noreply@blogger.com0tag:blogger.com,1999:blog-3661360932333260689.post-89916892486771026642017-07-12T14:56:00.001-07:002017-07-13T12:04:42.128-07:00Some common machine learning algorithmsA few commonly used machine learning algorithms<br /><br /><br /><ul><li><a href="http://www.ashwinparthasarathy.com/2017/07/linear-regression.html">Linear Regression</a></li><li><a href="http://www.ashwinparthasarathy.com/2017/07/logistic-regression.html">Logistic Regression</a></li><li>Decision Tree</li><li>SVM</li><li>Naive Bayes</li><li>KNN</li><li>K-Means</li><li>Random Forest</li><li>Dimensionality Reduction Algorithms</li><li>Gradient Boost and Adaboost</li></ul>Ashhttp://www.blogger.com/profile/00526603825000049836noreply@blogger.com0tag:blogger.com,1999:blog-3661360932333260689.post-75980726317668824072017-07-12T14:53:00.000-07:002017-07-12T14:53:01.522-07:00Linear RegressionLinear regression is one of the simplest algorithms in machine learning. It is used to predict the value of a dependent variable (Y) based on an independent variable (X).<br /><br />Consider the problem of predicting weight of a person based on height. We know that the 2 are not a simple relationship where we can say for every additional inch height, the weight will increase by 0.5 lbs. When we take a sample set of this data, we will see a cluster of points.<br /><br />The model derives the best fit line using these points. Using the best fit line, the slope(a) and intercept(b) are derived. For any new given independent variable (X), the dependent variable (Y) is derived using the equation Y = aX + b.Ashhttp://www.blogger.com/profile/00526603825000049836noreply@blogger.com0tag:blogger.com,1999:blog-3661360932333260689.post-90625308094850699612017-07-12T12:39:00.000-07:002017-07-13T22:12:14.942-07:00Types of Machine LearningBroadly there are 3 types of machine learning:<br /><br /><h2>Supervised Machine Learning</h2><div>Take the example of college admissions. For simplicity, let us assume that the admission board makes a decision based on your school grade, SAT score, and interview outcome. Given this dataset, the algorithm learns and tunes the model to achieve a desired level of accuracy.<br /><br />Supervised learning problems are broadly classified into 2 categories:<br /><br /><ol><li>Regression - The model tries to predict results with a continuous output.</li><li>Categorization - The model tries to predict results in a discrete set of outputs.</li></ol></div><div><br /></div><h2>Unsupervised Machine Learning</h2><div>Think of building the decision control on an unmanned vehicle going to an alien planet. To start with there is insufficient or no data available to train. Secondly the factors that influence the outcome are not yet determined. In such a case you need an algorithm that can take in the increasing data sources, be able to identify the influence and magnitude of influence of each data source and also be able to revise it's learning as the data sets grow. Visually this could be a example of generating a cluster graph of decisions.<br /><br /></div><h2>Reinforcement Machine Learning</h2><div>This can be seen as a step further than unsupervised learning where the algorithm receives a reward or penalty for the outcomes it generates. Based on this feedback, it decides on the next steps for tuning it's model.</div>Ashhttp://www.blogger.com/profile/00526603825000049836noreply@blogger.com0tag:blogger.com,1999:blog-3661360932333260689.post-20098004562036654972017-07-12T10:18:00.000-07:002017-07-12T10:18:28.825-07:00Python - date and time formatting cheatsheetFollowing are the format codes that can be used with strftime() method in datetime library:<br /><br /><table border="1" cellspacing="0"><tbody><tr><th>Format code</th><th>Description</th></tr><tr><td>%a</td><td>Locale’s abbreviated weekday name.</td></tr><tr><td>%A</td><td>Locale’s full weekday name. </td></tr><tr><td>%b</td><td>Locale’s abbreviated month name. </td></tr><tr><td>%B</td><td>Locale’s full month name.</td></tr><tr><td>%c</td><td>Locale’s appropriate date and time representation. </td></tr><tr><td>%d</td><td>Day of the month as a decimal number [01,31]. </td></tr><tr><td>%f</td><td>Microsecond as a decimal number [0,999999], zero-padded on the left</td></tr><tr><td>%H</td><td>Hour (24-hour clock) as a decimal number [00,23]. </td></tr><tr><td>%I</td><td>Hour (12-hour clock) as a decimal number [01,12]. </td></tr><tr><td>%j</td><td>Day of the year as a decimal number [001,366]. </td></tr><tr><td>%m</td><td>Month as a decimal number [01,12]. </td></tr><tr><td>%M</td><td>Minute as a decimal number [00,59]. </td></tr><tr><td>%p </td><td>Locale’s equivalent of either AM or PM.</td></tr><tr><td>%S</td><td>Second as a decimal number [00,61].</td></tr><tr><td>%U</td><td>Week number of the year (Sunday as the first day of the week)</td></tr><tr><td>%w</td><td>Weekday as a decimal number [0(Sunday),6]. </td></tr><tr><td>%W</td><td>Week number of the year (Monday as the first day of the week)</td></tr><tr><td>%x</td><td>Locale’s appropriate date representation. </td></tr><tr><td>%X</td><td>Locale’s appropriate time representation. </td></tr><tr><td>%y</td><td>Year without century as a decimal number [00,99]. </td></tr><tr><td>%</td><td>Year with century as a decimal number. </td></tr><tr><td>%z</td><td>UTC offset in the form +HHMM or -HHMM.</td></tr><tr><td>%Z</td><td>Time zone name (empty string if the object is naive). </td></tr><tr><td>%%</td><td>A literal '%' character.</td></tr></tbody></table><br />Ashhttp://www.blogger.com/profile/00526603825000049836noreply@blogger.com0