1 of 26

Introduction to Artificial Intelligence

By:

Dr. Mohammad Shoab

Week 9 & 10

2 of 26

Forms of Learning

Any component of an agent can be improved by learning from data. The improvements, and the techniques used to make them, depend on four major factors:

  • Which component is to be improved.
  • What prior knowledge the agent already has.
  • What representation is used for the data and the component.
  • What feedback is available to learn from.

Introduction to Artificial Intelligence

Department of Computer Science

3 of 26

Machine Learning

  • Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed. 
  • Machine learning focuses on the development of computer programs that can access data and use it learn for themselves.
  • The primary aim is to allow the computers learn automatically without human intervention or assistance and adjust actions accordingly.

Introduction to Artificial Intelligence

Department of Computer Science

4 of 26

Machine Learning is Used When

  • expertise does not exist (Curiosity Rover)

  • we cannot explain our expertise (Speech Recognition)

  • data is too large for us to analyze (Data Mining)

  • Prediction of new data (Stock Market Prediction)
  • Tasks that are learnt by practicing (Robot Path Planning)

Introduction to Artificial Intelligence

Department of Computer Science

5 of 26

What is Meant by Learning?

  • Writing algorithms that can learn patterns from data.
  • The algorithms create a statistical model that is a good approximation of the data.

Data from Past

Experiences

Calculating a model

Estimating the output

for new input values

Introduction to Artificial Intelligence

Department of Computer Science

6 of 26

Challenges of Machine Learning

High Dimensionality

    • Complexity of the data requires bigger models.
    • Requires bigger of memory and more time to process.
    • Might cause over-fitting.

Choice of Statistical Model

    • Choosing the correct model and parameters that satisfy the data
    • Can cause under-fitting or over-fitting

Introduction to Artificial Intelligence

Department of Computer Science

7 of 26

Cont…

Noise and Errors

  • Gaussian Noise: Statistical Noise that has its probability density function equal to normal distribution.
  • Outlier: an observation that is distant from the rest of the data.
  • Inlier: a local outlier. (see: 2-sigma rule).
  • Human Error causing incorrect measurements

Introduction to Artificial Intelligence

Department of Computer Science

8 of 26

Cont…

Insufficient Training Data: The amount of data is not sufficient to build a good approximation of the process that generated the data.

Feature Extraction in Patterns: Feature extraction is the process of converting the data to a reduced representation of a set of features.

Image Reference:

Face Verification

Introduction to Artificial Intelligence

Department of Computer Science

9 of 26

Learning Types

  • Supervised Learning (Regression, Classification, Artificial Neural Network)
  • Unsupervised Learning (Clustering)
  • Reinforcement Learning
  • Other Learning Paradigms

Introduction to Artificial Intelligence

Department of Computer Science

10 of 26

Supervised Learning

  • Supervised learning is the most common subbranch of machine learning.
  • Supervised machine learning algorithms are designed to learn by example. The name “supervised” learning originates from the idea that training this type of algorithm is like having a teacher supervise the whole process.
  • Supervised learning is good at classification and regression problems, such as determining what category a news article belongs to or predicting the volume of sales for a given future date.
  • In supervised learning, the aim is to make sense of data toward specific measurements. 

Introduction to Artificial Intelligence

Department of Computer Science

11 of 26

Linear Regression

  • Regression is a predictive statistical process where the model attempts to find the important relationship between dependent and independent variables.
  • The goal of a regression algorithm is to predict a continuous number such as sales, income, and test scores. 

Input: {x1, x2,…, xn} numeric values, called features

Output: y numeric values, called Target Value

Introduction to Artificial Intelligence

Department of Computer Science

12 of 26

Cont…

The equation for basic linear regression can be written as so:

Where x[i] is the feature(s) for the data and where w[i] and b are parameters which are developed during training.

For simple linear regression models with only one feature in the data, the formula looks like this:

Where w is the slope, x is the single feature and b is the y-intercept.

Introduction to Artificial Intelligence

Department of Computer Science

13 of 26

Classification

  • Classification is a process of categorizing a given set of data into classes, It can be performed on both structured or unstructured data.
  • The process starts with predicting the class of given data points.

Input: {x1, x2,…, xn} categorical values, called features

Output: y categorical values, called Target Value

Introduction to Artificial Intelligence

Department of Computer Science

14 of 26

Types of Classification

  • Lazy Learners – Lazy learners simply store the training data and wait until a testing data appears. The classification is done using the most related data in the stored training data. They have more predicting time compared to eager learners. Eg – k-nearest neighbor, case-based reasoning.

  • Eager Learners – Eager learners construct a classification model based on the given training data before getting data for predictions. It must be able to commit to a single hypothesis that will work for the entire space. Due to this, they take a lot of time in training and less time for a prediction. Eg – Decision Tree, Naive Bayes, Artificial Neural Networks.

Introduction to Artificial Intelligence

Department of Computer Science

15 of 26

Decision Tree

  • Decision Trees are a type of Supervised Machine Learning (that is you explain what the input is and what the corresponding output is in the training data) where the data is continuously split according to a certain parameter.

  • The tree can be explained by two entities, namely decision nodes and leaves.

  • The leaves are the decisions or the final outcomes.

  • And the decision nodes are where the data is split.

Introduction to Artificial Intelligence

Department of Computer Science

16 of 26

Cont…

Introduction to Artificial Intelligence

Department of Computer Science

17 of 26

Cont…

Example:

Introduction to Artificial Intelligence

Department of Computer Science

18 of 26

Types of Decision Tree

  • If the input is a categorical variable like whether the loan contender will defaulter or not, that is either yes/no. This type of decision tree is called a Categorical variable decision tree. 

  • If the input is numeric types and or is continuous in nature like when we have to predict a house price. Then the used decision tree is called a Continuous variable decision tree.

Introduction to Artificial Intelligence

Department of Computer Science

19 of 26

Artificial Neural Network

  • Artificial neural networks (ANNs), usually simply called neural networks (NNs), are computing systems vaguely inspired by the biological neural networks that constitute animal brains.
  • Neural networks consist of input and output layers, as well as (in most cases) a hidden layer consisting of units that transform the input into something that the output layer can use. 
  • There can be multiple hidden layers in the model depending on the complexity of the function which is going to be mapped by the model.
  • Having more hidden layers will enable to model complex relationships such as deep neural networks.

Introduction to Artificial Intelligence

Department of Computer Science

20 of 26

Cont…

Introduction to Artificial Intelligence

Department of Computer Science

21 of 26

Examples of Machine Learning in Real-World

  • Spam Filter
  • Signature Recognition
  • Credit Card Fraud Detection
  • Face Recognition
  • Text Recognition
  • Speech Recognition
  • Speaker Recognition
  • Weather Prediction

  • Stock Market Analysis
  • Advertisement Targeting
  • Language Translation
  • Recommendation Systems
  • Classifying DNA Sequences
  • Automatic vehicle Navigation
  • Object Detection
  • Medical Diagnosis

Introduction to Artificial Intelligence

Department of Computer Science

22 of 26

The End

22

Introduction to Artificial Intelligence

Department of Computer Science

23 of 26

Exercise

Q1. Explain forms of learning.

Q2. What is machine learning?

Q3. Write some situations when we use machine learning.

Q4. Explain challenges of machine learning.

Q5. What is supervised learning?

Q6. Explain linear regression.

Q7. What is classification? Explain it’s types.

Q8. Explain decision tree with it’s types.

Q9. What is artificial neural network? Draw it’s diagram.

Q10. Write some examples of machine learning in real world.

23

Introduction to Artificial Intelligence

Department of Computer Science

24 of 26

Q11. Any component of an agent can be improved by learning from

  1. Data
  2. Table
  3. Logic
  4. Interpretation

Q12. Machine learning focuses on the development of

  1. Machines
  2. Computer programs
  3. Analytics
  4. None of the above

24

Introduction to Artificial Intelligence

Department of Computer Science

25 of 26

Q13. Supervised machine learning algorithms are designed to learn by

  1. Acknowledgement
  2. Unique value
  3. Example
  4. None of the above

Q14. The goal of a regression algorithm is to predict a

  1. Contiguous number
  2. Continuous number
  3. Special number
  4. None of the above

25

Introduction to Artificial Intelligence

Department of Computer Science

26 of 26

Q15. Decision Trees are a type of

  1. Unsupervised machine learning
  2. Supervised machine learning
  3. Regression
  4. None of the above

Q16. Having more hidden layers in ANN will enable to model

  1. Complex relationships
  2. Simple relationships
  3. Arbitrary relationships
  4. None of the above

Introduction to Artificial Intelligence

Department of Computer Science