Wednesday, July 8, 2020

Statistics For Machine Learning

Statistics For Machine Learning Statistics for Machine Learning: A Beginners Guide Back Home Categories Online Courses Mock Interviews Webinars NEW Community Write for Us Categories Artificial Intelligence AI vs Machine Learning vs Deep LearningMachine Learning AlgorithmsArtificial Intelligence TutorialWhat is Deep LearningDeep Learning TutorialInstall TensorFlowDeep Learning with PythonBackpropagationTensorFlow TutorialConvolutional Neural Network TutorialVIEW ALL BI and Visualization What is TableauTableau TutorialTableau Interview QuestionsWhat is InformaticaInformatica Interview QuestionsPower BI TutorialPower BI Interview QuestionsOLTP vs OLAPQlikView TutorialAdvanced Excel Formulas TutorialVIEW ALL Big Data What is HadoopHadoop ArchitectureHadoop TutorialHadoop Interview QuestionsHadoop EcosystemData Science vs Big Data vs Data AnalyticsWhat is Big DataMapReduce TutorialPig TutorialSpark TutorialSpark Interview QuestionsBig Data TutorialHive TutorialVIEW ALL Blockchain Blockchain TutorialWhat is BlockchainHyperledger FabricWhat Is EthereumEthereum TutorialB lockchain ApplicationsSolidity TutorialBlockchain ProgrammingHow Blockchain WorksVIEW ALL Cloud Computing What is AWSAWS TutorialAWS CertificationAzure Interview QuestionsAzure TutorialWhat Is Cloud ComputingWhat Is SalesforceIoT TutorialSalesforce TutorialSalesforce Interview QuestionsVIEW ALL Cyber Security Cloud SecurityWhat is CryptographyNmap TutorialSQL Injection AttacksHow To Install Kali LinuxHow to become an Ethical Hacker?Footprinting in Ethical HackingNetwork Scanning for Ethical HackingARP SpoofingApplication SecurityVIEW ALL Data Science Python Pandas TutorialWhat is Machine LearningMachine Learning TutorialMachine Learning ProjectsMachine Learning Interview QuestionsWhat Is Data ScienceSAS TutorialR TutorialData Science ProjectsHow to become a data scientistData Science Interview QuestionsData Scientist SalaryVIEW ALL Data Warehousing and ETL What is Data WarehouseDimension Table in Data WarehousingData Warehousing Interview QuestionsData warehouse architectureTalend T utorialTalend ETL ToolTalend Interview QuestionsFact Table and its TypesInformatica TransformationsInformatica TutorialVIEW ALL Databases What is MySQLMySQL Data TypesSQL JoinsSQL Data TypesWhat is MongoDBMongoDB Interview QuestionsMySQL TutorialSQL Interview QuestionsSQL CommandsMySQL Interview QuestionsVIEW ALL DevOps What is DevOpsDevOps vs AgileDevOps ToolsDevOps TutorialHow To Become A DevOps EngineerDevOps Interview QuestionsWhat Is DockerDocker TutorialDocker Interview QuestionsWhat Is ChefWhat Is KubernetesKubernetes TutorialVIEW ALL Front End Web Development What is JavaScript รข€" All You Need To Know About JavaScriptJavaScript TutorialJavaScript Interview QuestionsJavaScript FrameworksAngular TutorialAngular Interview QuestionsWhat is REST API?React TutorialReact vs AngularjQuery TutorialNode TutorialReact Interview QuestionsVIEW ALL Mobile Development Android TutorialAndroid Interview QuestionsAndroid ArchitectureAndroid SQLite DatabaseProgramming s Guide Published on A ug 06,2019 500 Views edureka Bookmark Become a Certified Professional Understanding data and being able to create value from it is the skill of the decade. Machine Learning is one such core skill that helps companies fulfill it. However, to get started, you need to build your foundations right. So, in this article, I will cover a few basic concepts and provide you with guidelines to start your journey in Machine Learning. So, in this article on statistics for machine learning, the following topics will be discussed:ProbabilityWhat is Probability?IndependenceBayes Rule Conditional ProbabilityStatisticsCentrality measures and measures of spreadsNormal DistributionLinear AlgebraMatrix Matrix OperationsProbability and Statistics For Machine Learning:What is Probability?Probability quantifies the likelihood of an event occurring. For example, if you roll a fair, unbiased die, then the probability of 1 turning up is 1/6. Now, if you are wondering why? Then the answer is quite simple! This is because there are six possibilities and all are equally likely (fair die). Therefore we can add 1+1+1+1+1+1 = 6. But, since we are interested in the event where 1 turns up. There is only one way the event can occur. Therefore,Probability of 1 turning up = 1/6Similar is the case with all other numbers as all the events are equally likely. Simple, right? Well, a frequentist definition of probability for this example would sound like the probability of 1 turning up is the ratio of the number of times 1 turned up to the total number of times the die was rolled if the die was rolled an infinite number of times. How does this make sense? Lets make it more interesting. Consider the two cases you rolled a fair die 5 times. In one case the sequence of numbers turning up is [1,4,2,6,4,3]. In the other case, we get [2,2,2,2,2,2]. Which one do you think is more likely?Both are equally likely. Seems odd right? Now, consider another case where all the 5 rolls in each case are independ ent. Meaning, one roll doesnt affect the other. In the first case, when 6 turns up, it had no idea that 2 turned up before it. Hence, all 5 rolls are equally likely.Similarly, the straight 2s in the second case can be understood as a sequence of independent events. And all these events are equally likely. Overall, since we have the same dice, the probability of a particular number turning up in case one is the same as case two. Next, in this article on statistics for machine learning, let us understand the term Independence.IndependenceTwo events A and B are said to be independent if the occurrence of A does not affect event B. For example, if you toss a coin and roll a die, the outcome of the die has no effect on whether the coin shows heads or tails. Also, for two independent events A and B, the probability that A and B can occur together. So for example, if you want the probability that coin shows heads and die shows 3. P(A and B) = P(A)*P(B)Therefore P = (probability of heads t urning up) * (probability of 3 turning up) = 1/12In the previous example, for both the cases, P = * * * * * .Now lets talk about events that are not independent. Consider the following table:ObeseNot ObeseHeart Problems4515No heart problems1030A survey of 100 people was taken. 60 had heart problems and 40 didnt. Of the 60 having a heart problem, 45 were obese. Of the 40 having no heart problem, 10 were obese. If someone asks you What is the probability of having a heart problem?What is the probability of having a heart problem and not being obese?The answer to the first questions is easy 60/100. For the second one, it would be 15/100. Now consider the third question A person was picked at random. He was found to have heart disease. What is the probability that he is obese?Now think about the information given to you It is known that he has heart disease. Therefore he cannot be from the 40 who dont have heart disease. There are only 60 possible options (the top row in the table) . Now, among these reduced possibilities, the probability that he is obese is 45/60. Now, that you have known, what are independent events, next in this article on statistics for machine learning, let us understand Conditional Probabilities.Conditional ProbabilitiesTo understand conditional probabilities, lets continue our discussion with the above example. Status of being obese and the status of having suffered from heart problem is not independent. If being obese did not affect heart problems, then the number of obese and non-obese cases for people having heart problems would have been the same.Also, we were given that the person has heart problems and we had to find out the probability that he is obese. So, the probability, in this case, is said to be conditioned on the fact that he has a heart problem. If the probability of event A occurring is conditioned on event B, we represent it asP(A|B)Now, there is a theorem that helps us calculate this conditional probability. It is call ed the Bayes Rule.P(A|B) =P(A and B)/P(B)You can check this theorem by plugging the example we just discussed. If you have understood so far, you can get started with the following Machine Learning Algorithm Naive Bayes. It uses conditional probabilities to classify whether an email is a spam or not. It can perform many other classification tasks. But essentially, conditional probability is at the heart of Naive Bayes.Statistics:Statistics are used to summarize and make inferences about a large number of data points. In Data Science and Machine Learning, you will often come across the following terminologyCentrality measuresDistributions (especially normal)Centrality measures and measures of spreadsMean: Mean is just an average of numbers. To find out mean, you have to sum the numbers and divide it with the number of numbers. For example, the mean of [1,2,3,4,5] is 15/5 = 3.Median: Median is the middle element of a set of numbers when they are arranged in ascending order. For examp le, numbers [1,2,4,3,5] are arranged in an ascending order [1,2,3,4,5]. The middle one of these is 3. Therefore the median is 3. But what if the number of numbers is even and therefore has no middle number? In that case, you take the average of the two middle-most numbers. For a sequence of 2n numbers in ascending order, average the nth and (n+1)th number to get the median. Example [1,2,3,4,5,6] has the median (3+4)/2 = 3.5Mode: Mode is simply the most frequent number in a set of numbers. For example, mode of [1,2,3,3,4,5,5,5] is 5.Variance: Variance is not a centrality measure. It measures how your data is spread around the mean. It is quantified asx is the mean of N numbers. You take a point, subtract the mean, take the square of this difference. Do this for all N numbers and average them. The square root of the variance is called the standard deviation. Next, in this article on statistics for machine learning, let us understand Normal Distribution.Normal DistributionDistribution helps us understand how our data is spread. For example, in a sample of ages, we may have young people more than older adults and hence smaller values of age more than greater values. But how do we define a distribution? Consider the example belowThe y-axis represents the density. The mode of this distribution is 30 since it is the peak and hence most frequent. We can also locate the median. Median lies at the point on the x-axis where half of the area under the curve is covered. The area under any normal distribution is 1 because the sum of probabilities of all events is 1. For example,Median in the above case is around 4. This means that area under the curve before 4 is the same as that after 4. Consider another exampleWe see three normal distributions. The blue and red ones have the same mean. The red one has a greater variance. Hence, it is more spread out than the blue one. But since the area has to be 1, the peak of the red curve is shorter than the blue curve, to keep the ar ea constant.Hope you understood the basic statistics and normal distributions. Now, next in this article on statistics for machine learning, let us learn about Linear Algebra.Linear AlgebraModern AI would not be possible without Linear Algebra. It forms the core of Deep Learning and has been used even in simple algorithms like Linear Regression. Without any further delay, lets get started.You must be familiar with vectors. They are a kind of geometrical representations in space. For example, a vector [3,4] has 3 units along the x-axis and 4 units along the y-axis. Consider the following image Vector d1 has 0.707 units along the x-axis and 0.707 units along the y-axis. A vector has 1 dimension. It necessarily has a magnitude and a direction. For example,The above image has a vector (4,3). Its magnitude is 5 and it makes 36.9 degrees with the x-axis.Now, what is a matrix? Matrix is a multi-dimensional array of numbers. Whats it used for? Well see ahead. But first, lets look at how it is used.MatrixA matrix can have many dimensions. Lets consider a 2-dimensional matrix. It has rows (m) and columns (n). Therefore it has m*n elements.For example,This matrix has 5 rows and 5 columns. Lets call it A. Therefore A(2,3) is the entry at the second row and third column which is 8.Now, that you know what is a matrix, lets us look into the different operations of matrix.Matrix OperationsAddition of MatricesTwo matrices of the same dimensions can be added. The addition happens element-wise.Scalar MultiplicationA matrix can be multiplied by a scalar quantity. Such a multiplication leads to every entry in the matrix getting multiplied by the scalar. A scalar is just a numberMatrix TransposeMatrix transpose is simple. For a matrix A(m,n), let A be its transpose. ThenA'(i,j) = A(j,i)For example,Matrix MultiplicationThis is probably a bit tricky than other operations. Before we dive into it, lets define dot product between two vectors. Consider vector X = [1,4,6,0] and vector Y = [2,3,4,5]. Then dot product between X and Y is defined asX.Y = 1*2 + 4*3 + 6*4 + 0*5 = 38So, it is element-wise multiplication and addition. Now, lets consider two matrices A(m,n) and B(n,k), where m,n,k are dimensions and hence integers. We define matrix multiplication asIn the above example, the first element of the product (44) is obtained by the dot product of the first row of the left matrix with the first column of the right matrix. Similarly, 72 is obtained by the dot product of the first row of the left matrix with the second column of the right matrix.Note that for the left matrix, the number of columns should be equal to the number of rows in the right column. In our case, the product AB exists but not BA since m is not equal to k. For two matrices A(m,n) and B(n,k), the product AB is defined and the dimension of the product is (m,k) (the outer most dimensions of (m,n),(n,k)). But BA is not defined unless m = k.With this, we come to an end to this article on Statistics fo r Machine Learning. I hope you have some understood some of the Machine Learning Jargon. It doesnt end here though. To make sure you are industry-ready, you can check out Edurekas courses on Data Science and AI. They can be found here.Recommended videos for you 3 Scenarios Where Predictive Analytics is a Must Watch Now The Whys and Hows of Predictive Modeling-II Watch Now Python List, Tuple, String, Set And Dictonary Python Sequences Watch Now Machine Learning With Python Python Machine Learning Tutorial Watch Now Python Classes Python Programming Tutorial Watch Now Business Analytics Decision Tree in R Watch Now Mastering Python : An Excellent tool for Web Scraping and Data Analysis Watch Now Introduction to Business Analytics with R Watch Now Know The Science Behind Product Recommendation With R Programming Watch Now Application of Clustering in Data Science Using Real-Time Examples Watch Now Android Development : Using Android 5.0 Lollipop Watch Now Web Scraping And Analytics With Python Watch Now Python Programming Learn Python Programming From Scratch Watch Now Python Numpy Tutorial Arrays In Python Watch Now Sentiment Analysis In Retail Domain Watch Now Linear Regression With R Watch Now The Whys and Hows of Predictive Modelling-I Watch Now Diversity Of Python Programming Watch Now Data Science : Make Smarter Business Decisions Watch Now Python Loops While, For and Nested Loops in Python Programming Watch NowRecommended blogs for you Introduction to Strings in Python Read Article Introduction to Data Science Read Article Different Job Titles for Data Scientists Read Article Everything You Need To Know About Print Exception In Python Read Article A Beginners Guide To Python Functions Read Article Introduction to Functions in R Read Article SAS Programming Learn How To Code In SAS! Read Article How To Use Regularization in Machine Learning? Read Article Machine Learning Engineer vs Data Scientist : Career Comparision Read Article How to Implement De corators in Python? Read Article Python time sleep() One Stop Solution for time.sleep() Method Read Article A Complete Guide To Math And Statistics For Data Science Read Article The Importance of Data Science with Cloud Computing Read Article Everything You Need To Know About Bitwise Operators In Python Read Article Java and Python Podcast: Which Language is the Best? Read Article Frequently Asked Data Science Interview Questions Read Article All You Need To Know About Principal Component Analysis (PCA) Read Article Mastering R Is The First Step For A Top-Class Data Science Career Read Article How to implement Merge Sort in Python? Read Article Top 50 Important OOPs Interview Questions and Answers Read Article Comments 0 Comments Trending Courses in Data Science Python Certification Training for Data Scienc ...66k Enrolled LearnersWeekend/WeekdayLive Class Reviews 5 (26200)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.