PowerPoint 簡報CST 5320Design/Analysis of AlgorithmsLecture 7: Machine Learning Algorithms (1)Instructor: Debzani Deb1TextbooksHands-On Machine Learning with Scikit-Learn, Keras, and...

I have quiz .the quiz includes 5 quesions . the question willMultiple choice
the quiz only for 15 min . I need you help me to do it please . the modules of the quiz



PowerPoint 簡報 CST 5320 Design/Analysis of Algorithms Lecture 7: Machine Learning Algorithms (1) Instructor: Debzani Deb 1 Textbooks Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems 2nd Edition By Aurélien Géron Python Machine Learning: Machine Learning and Deep Learning with Python, scikit-learn, and TensorFlow 2, 3rd Edition By by Sebastian Raschka, Vahid Mirjalili  Previous versions are okay. Machine Learning is Everywhere An Overview of Machine Learning Debzani Deb This is very inexpensive because when you write an envelope, algorithms can automatically route envelopes through the post 4 What is Machine Learning? “Learning is any process by which a system improves performance from experience.” - Herbert Simon Definition by Tom Mitchell (1998): Machine Learning is the study of algorithms that • improve their performance P • at some task T • with experience E. A well-defined learning task is given by . Definition of ML Improve on task T, with respect to performance metric P, based on experience E. Example : Chess program T: Playing chess P: Percentage of games won against an arbitrary opponent E: Playing practice games against itself Example: hand-writing Recognition T: Recognizing hand-written words P: Percentage of words correctly classified E: Accessing database of human-labeled images of handwritten words Example: Self Driving Car T: Driving on four-lane highways using vision sensors P: Average distance traveled before a human judged error E: A sequence of images and steering commands recorded while observing a human driver. Example: Spam Filters T: Categorize email messages as spam or legitimate. P: Percentage of email messages correctly classified. E: Access large number of emails, some with human-given labels Slide credit: Ray Mooney The checkers example, E = 10000s games T is playing checkers P if you win or not 6 Traditional Programming Machine Learning Computer Data Program Output Computer Data Output Program Machine Learning is… Machine learning is about predicting the future based on the past. -- Hal Daume III Training Data learn model/ predictor past predict model/ predictor future Testing Data When do we use ML? ML is used when: Human expertise does not exist (navigating on Mars) Humans can’t explain their expertise (speech recognition) Models must be customized (personalized medicine) Models are based on huge amounts of data (genomics) Learning is not always useful: There is no need to “learn” to calculate Payroll, student GPA etc. Examples Recognizing patterns: Facial identities or facial expressions Handwritten or spoken words Medical images Generating patterns: Generating images or motion sequences Recognizing anomalies: Unusual credit card transactions Unusual patterns of sensor readings in a nuclear power plant Prediction: Future stock prices or currency exchange rates Sample Applications Web search Computational biology Finance E-commerce Space exploration Robotics Information extraction Social networks Debugging software Types of Machine Learning Supervised (inductive) learning : Learn with a teacher Given: Training data + desired outputs (labels) Goal: learn mapping that predicts label for test data Unsupervised learning : Learn without a teacher Given: Training data (without desired outputs) Goal: learn some intrinsic structure in inputs Supervised learning Supervised Learning: Regression Regression Evaluation Root Mean Squared Error (RMSE) Model and Cost Estimation We will use x(i) to denote the “input” variables (year, in this example), also called input features, and y(i) to denote the “output” or target variable that we are trying to predict (sea ice extent). A pair (x(i),y(i)) is called a training example, and the dataset that we’ll be using to learn—a list of m training examples (x(i),y(i));i=1,...,m, is called a training set. We could fit many different model (hypotheses), however will be interested in a cost function to choose the best one. We can measure the accuracy of our hypothesis function by using a cost function. This takes an average difference of all the prediction results of the hypothesis with inputs from x's and the actual output y's. Supervised Learning: Example 1 Example problem: "Given this data, a friend has a house 750 square feet - how much can they be expected to get?" What approaches can we use to solve this? Straight line through data Maybe $150 000 Second order polynomial Maybe $200 000 One thing we discuss later - how to chose straight or curved line? Each of these approaches represent a way of doing supervised learning What does this mean?  We gave the algorithm a data set where a "right answer" was provided So we know actual prices for houses The idea is we can learn what makes the price a certain value from the training data The algorithm should then produce more right answers based on new training data where we don't know the price already i.e. predict the price We also call this a regression problem Predict continuous valued output (price) 17 Supervised Learning: Example 2 Supervised Learning: Classification Other features/attributes Clump thickness Uniformity of cell size Uniformity of cell shape 19 Classification x can be multi-dimensional Each dimension corresponds to an attribute Example: Credit scoring Differentiating between low-risk and high-risk customers from their income and savings f(x) : IF income > θ1 AND savings > θ2 THEN low-risk ELSE high-risk Model Supervised, two kinds regression, classification Regression: Given a person’s picture, we have to predict his age Classification: Given a person’s picture we have to predict the class Child or Adult 20 Unsupervised Learning Unsupervised Learning Example of clustering algorithm Google news Groups news stories into cohesive groups Used in any other problems as well Genomics Take a collection of 1,000,000 different genes, and find a way to automatically group these genes into groups that are somehow similar or related by different variables, such as lifespan, location, roles, and so on. 22 Unsupervised Learning Learning “what normally happens” No output Clustering: Grouping similar instances Other applications: Summarization, Association Analysis Example applications Customer segmentation in CRM Image compression: Color quantization Bioinformatics: Learning motifs Can you automatically generate structure Because we don't give it the answer, it's unsupervised learning 23 Unsupervised learning Download Download Python 3.7 version through Anaconda https://www.anaconda.com/distribution/#download-section Use the install document if you need help https://docs.anaconda.com/anaconda/install/ Use Jupyter Notebook to run your first python program https://www.youtube.com/watch?v=DPi6CAkUUPY Your First ML Program Does money make people happier? Better Life Index data from the OECD’s website and stats about gross domestic product (GDP) per capita from the IMF’s website. Does money make people happier? A simple linear model life_satisfaction= θ0+θ1×GDP_per_capita This model has two model parameters,  θ0 and θ1. By tweaking these parameters, you can make your model represent any linear function. Does money make people happier? Before you can use your model, you need to define the parameter values θ0 and θ1. How can you know which values will make your model perform best? To answer this question, you need to specify a performance measure. You can either define a utility function (or fitness function) that measures how good your model is, or you can define a cost function that measures how bad it is. Does money make people happier? Typical ML Steps You studied the data. You selected a model. You trained it on the training data (i.e., the learning algorithm searched for the model parameter values that minimize a cost function). Finally, you applied the model to make predictions on new cases (this is called inference), hoping that this model will generalize well. Main ML challenges Insufficient Quantity of Training Data As the authors put it, “these results suggest that we may want to reconsider the trade-off between spending time and money on algorithm development versus spending it on corpus development.” Nonrepresentative Training Data In order to generalize well, it is crucial that your training data be representative of the new cases you want to generalize to.  Adding a few missing countries significantly alter the model By using a nonrepresentative training set, we trained a model that is unlikely to make accurate predictions, especially for very poor and very rich countries. Poor-Quality Data If some instances are clearly outliers, it may help to simply discard them or try to fix the errors manually. If some instances are missing a few features (e.g., 5% of your customers did not specify their age), you must decide whether you want to ignore this attribute (column) altogether, ignore these instances (few rows), fill in the missing values (e.g., with the mean/median age), or train one model with the feature and one model without it. Irrelevant Features A critical part of the success of a Machine Learning project is coming up with a good set of features to train on. This process, called feature engineering, involves the following steps: Feature selection (selecting the most useful features to train on among existing features) Feature extraction (combining existing features to produce a more useful one, may be with dimensionality reduction algorithms) Creating new features by gathering new data Overfitting the Training Data In ML overfitting means that the model performs well on the training data, but it does not generalize well. A high-degree polynomial life satisfaction model is shown below Overfitting & Regularization Overfitting happens when the model is too complex relative to the amount and noisiness of the training data. Here are possible solutions: Simplify the model by selecting one with fewer parameters (e.g., a linear model rather than a high-degree polynomial model), by reducing the number of attributes in the training data, or by constraining the model. Gather more training data. Reduce the noise in the training data (e.g., fix data errors and remove outliers). Constraining a model to make it simpler and reduce the risk of overfitting is called regularization. Hyperparameter The amount of regularization to apply during learning can be controlled by a hyperparameter. A hyperparameter is a parameter of a learning algorithm (not of the model). As such, it is not affected by the learning algorithm itself; it must be set prior to training and remains constant during training.  Tuning hyperparameters is an important part of building a Machine Learning system shows three models. The dotted line represents the original model that was trained on the countries represented as circles (without the countries represented as squares), the dashed line is our second model trained with all countries (circles and squares), and the solid line is a model trained with the same data as the first model but with a regularization constraint. You can see that regularization forced the model to have a smaller slope: this model does not fit the training data (circles) as well as the first model, but it actually generalizes better to new examples that it did not see during training (squares). 39 Underfitting the Training Data underfitting is the opposite of overfitting: it occurs when your model is too simple to learn the underlying structure of the data. For example, a linear model of life satisfaction is prone to underfit; reality is just more complex than the model, so its predictions are bound to be inaccurate, even on the training examples. Here are the main options for fixing this problem: Select a more powerful model, with more parameters. Feed better features to the learning algorithm (feature engineering). Reduce the constraints on the model (e.g., reduce the regularization hyperparameter). Additional Resources http://www.learnpython.org/ https://www.stavros.io/tutorials/python/ https://docs.python.org/2/tutorial/ 10 minute intro to Pandas http://pandas.pydata.org/pandas-docs/stable/10min.html#min Data Science cheat sheets https://www.kaggle.com/timoboz/data-science-cheat-sheets Andrew Ng’s free ML course https://www.coursera.org/learn/machine-learning Kaggle Data Science free courses https://www.kaggle.com/learn PowerPoint 簡報 CST 5320 Design/Analysis
Nov 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here