The document provides an overview of machine learning, defining it as the ability of computers to learn from experience without explicit programming. It discusses various types of machine learning, including supervised, unsupervised, and reinforcement learning, as well as key concepts such as bias, variance, underfitting, and overfitting. Additionally, it outlines the machine learning process and techniques to mitigate underfitting and overfitting in models.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
13 views27 pages
Chapter 1-ML
The document provides an overview of machine learning, defining it as the ability of computers to learn from experience without explicit programming. It discusses various types of machine learning, including supervised, unsupervised, and reinforcement learning, as well as key concepts such as bias, variance, underfitting, and overfitting. Additionally, it outlines the machine learning process and techniques to mitigate underfitting and overfitting in models.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27
Chapter 1
Definition of Machine Learning
• Machine learning – making computers modify or adapt their actions (whether these actions are making predictions, or controlling a robot) – so that these actions get more accurate, where accuracy is measured by how well the chosen actions reflect the correct ones. Arthur Samuel (1959). Machine Learning: Field of – study that gives computers the ability to learn – without being explicitly programmed. Machine Learning tasks • Examples: • - Database mining • Large datasets from growth of automation/web. • E.g., Web click data, medical records, biology, engineering • - Applications can’t program by hand. • E.g., Autonomous helicopter, handwriting recognition, most of • Natural Language Processing (NLP), Computer Vision. Learning • “A computer program is said to learn from experience E with respect to some task T and some performance measure P, if its performance on T, as measured by P, improves with experience E.”
Suppose your email program watches which emails
you do or do not mark as spam, and based on that learns how to better filter spam. What is the task T in this setting? • Classifying emails as spam or not spam. • Watching you label emails as spam or not spam. • The number (or fraction) of emails correctly classified as spam/not spam. • None of the above—this is not a machine learning problem. Learning • We are going to loosely define learning as meaning getting better at some task through practice. Types of machine leaning • Machine learning algorithms: – Supervised learning – Unsupervised learning – Reinforcement learning – Evolutionary learning • Housing price prediction. • Breast cancer (malignant, benign) Problem • You’re running a company, and you want to develop learning algorithms to address each • of two problems.
• Problem 1: You have a large inventory of identical items. You want
to predict how many of these items will sell over the next 3 months. • Problem 2: You’d like software to examine individual customer accounts, and for each account decide if it has been hacked/compromised.
• Should you treat these as classification or as regression problems?
Solution • Treat both as classification problems. • Treat problem 1 as a classification problem, problem 2 as a regression problem. • Treat problem 1 as a regression problem, problem 2 as a classification problem. • Treat both as regression problems. Of the following examples, which would you address using an unsupervised learning algorithm? (Check all that apply.) • Given a database of customer data, automatically discover market segments and group customers into different market segments. • Given email labeled as spam/not spam, learn a spam filter. • Given a set of news articles found on the web, group them into set of articles about the same story. • Given a dataset of patients diagnosed as either having diabetes or not, learn to classify new patients as having diabetes or not. Reinforcement Learning Reinforcement Learning or Not • Designing – Chess game – Electric vehicle – Detection of a disease – Robotics for industrial automation. – Business strategy planning. The machine learning process • Data Collection and Preparation • Feature Selection • Algorithm Choice • Parameter and Model Selection • Training • Evaluation Bias • The bias is known as the – difference between the prediction of the values by the ML model and the correct value. – Being high in biasing gives a large error in training as well as testing data. Its recommended that an algorithm should always be low biased to avoid the problem of underfitting. – By high bias, the data predicted is in a straight line format, thus not fitting accurately in the data in the data set. – Such fitting is known as Underfitting of Data. This happens when the hypothesis is too simple or linear in nature. Variance • The variability of model prediction for a given data point which tells us spread of our data is called the variance of the model. • The model with high variance has a very complex fit to the training data and thus is not able to fit accurately on the data which it hasn’t seen before. As a result, such models perform very well on training data but has high error rates on test data. • When a model is high on variance, it is then said to as Overfitting of Data. • Overfitting is fitting the training set accurately via complex curve and high order hypothesis but is not the solution as the error with unseen data is high. While training a data model variance should be kept low. Bias Variance Trade-off
• If the algorithm is too simple (hypothesis with linear eq.)
then it may be on high bias and low variance condition and thus is error-prone. • If algorithms fit too complex ( hypothesis with high degree eq.) then it may be on high variance and low bias. • In the latter condition, the new entries will not perform well. Well, there is something between both of these conditions, known as Trade-off or Bias Variance Trade-off. • This tradeoff in complexity is why there is a tradeoff between bias and variance. An algorithm can’t be more complex and less complex at the same time. Underfitting • A statistical model or a machine learning algorithm is said to have underfitting when it cannot capture the underlying trend of the data, i.e., it only performs well on training data but performs poorly on testing data. • Underfitting destroys the accuracy of our machine learning model. Its occurrence simply means that our model or the algorithm does not fit the data well enough. • It usually happens when we have fewer data to build an accurate model and also when we try to build a linear model with fewer non-linear data. • In such cases, the rules of the machine learning model are too easy and flexible to be applied to such minimal data and therefore the model will probably make a lot of wrong predictions. • Underfitting can be avoided by using more data and also reducing the features by feature selection. Reasons for Underfitting
• High bias and low variance
• The size of the training dataset used is not enough. • The model is too simple. • Training data is not cleaned and also contains noise in it. Techniques to reduce underfitting • Increase model complexity • Increase the number of features, performing feature engineering • Remove noise from the data. • Increase the number of epochs or increase the duration of training to get better results. Overfitting • A statistical model is said to be over fitted when the model does not make accurate predictions on testing data. • When a model gets trained with so much data, it starts learning from the noise and inaccurate data entries in our data set. And when testing with test data results in High variance. • Then the model does not categorize the data correctly, because of too many details and noise. The causes of overfitting are the non- parametric and non-linear methods because these types of machine learning algorithms have more freedom in building the model based on the dataset and therefore they can really build unrealistic models. • A solution to avoid overfitting is using a linear algorithm if we have linear data or using the parameters like the maximal depth if we are using decision trees. Reasons for Overfitting are as follows:
• High variance and low bias
• The model is too complex • The size of the training data Techniques to reduce overfitting • Increase training data. • Reduce model complexity. • Early stopping during the training phase • Have an eye over the loss over the training period as soon as loss begins to increase stop training). • Use dropout for neural networks to tackle overfitting.