EASYTUTORGUIDE

Practical tutorials, tools, courses, digital skills, and business promotion.

Free Learning
Google Translate

Chapter 1: Introduction to Machine Learning

Learn Machine Learning from very beginner to expert with detailed topic guidance, practical examples, practice exercises, and review questions.

Beginner FriendlyExamplesPracticeExpert Topics
Estimated reading time0% read

What this chapter covers

This chapter contains 15 topics. Technical terms are followed by plain-language meanings in parentheses where they first appear. Code is included only when it naturally helps demonstrate the concept; architecture, workflow, governance, and comparison topics use practical scenarios instead.

1.1 What Is Artificial Intelligence?

What Is Artificial Intelligence? (computer systems designed to perform tasks that normally require human intelligence). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use What Is Artificial Intelligence? to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// What Is Artificial Intelligence?
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for What Is Artificial Intelligence?. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.2 What Is Machine Learning?

What Is Machine Learning? (a way for computers to learn patterns from data instead of receiving every rule by hand). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use What Is Machine Learning? to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// What Is Machine Learning?
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for What Is Machine Learning?. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.3 AI vs Machine Learning vs Deep Learning

AI vs Machine Learning vs Deep Learning (a way for computers to learn patterns from data instead of receiving every rule by hand). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use AI vs Machine Learning vs Deep Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// AI vs Machine Learning vs Deep Learning
const relu = x => Math.max(0, x);
const weights = [0.6, -0.2, 0.5];
const input = [2, 1, 3];
const bias = 0.1;
const weightedSum = input.reduce((s,x,i)=>s+x*weights[i], bias);
const output = relu(weightedSum);

console.log({ weightedSum: weightedSum.toFixed(2), output: output.toFixed(2) });

Code explanation

  1. The input vector contains three features and the weight vector assigns one learned importance to each feature.
  2. The weighted sum combines inputs, weights, and a bias into one number.
  3. The ReLU activation keeps positive values and replaces negative values with zero.
  4. This forward calculation is the basic building block that larger neural networks repeat many times.

Expected result: A weighted sum and activated neuron output are printed.

Practice exercise

Create a small real-world example for AI vs Machine Learning vs Deep Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.4 How Machines Learn from Data

How Machines Learn from Data (a practical concept used within foundations and practical tools). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use How Machines Learn from Data to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// How Machines Learn from Data
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for How Machines Learn from Data. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.5 Features and Targets

Features and Targets (an input value or measurable property given to a model). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Features and Targets to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Features and Targets
const rows = [
  { age: 22, score: 71 },
  { age: null, score: 88 },
  { age: 35, score: 93 }
];

const knownAges = rows.filter(r => r.age !== null).map(r => r.age);
const fallbackAge = knownAges.reduce((a,b) => a+b, 0) / knownAges.length;
const cleaned = rows.map(r => ({ ...r, age: r.age ?? fallbackAge }));

console.log(cleaned);

Code explanation

  1. The sample rows deliberately contain one missing value so you can see a preprocessing decision.
  2. Known ages are separated and averaged to create a simple fallback value.
  3. `map()` builds a new cleaned dataset instead of modifying the original rows in place.
  4. The final log lets you verify that every row now has a usable numeric age.

Expected result: A cleaned array is printed with the missing age filled.

Practice exercise

Create a small real-world example for Features and Targets. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.6 Training and Prediction

Training and Prediction (the output produced by a trained model for new input). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Training and Prediction to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Training and Prediction
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for Training and Prediction. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.7 Models and Algorithms

Models and Algorithms (a defined procedure used to learn a pattern or solve a problem). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Models and Algorithms to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Models and Algorithms
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for Models and Algorithms. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.8 Supervised Learning

Supervised Learning (learning from examples that include the correct answer). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Supervised Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Supervised Learning
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for Supervised Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.9 Unsupervised Learning

Unsupervised Learning (finding patterns or groups in data that has no target labels). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Unsupervised Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Unsupervised Learning
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for Unsupervised Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.10 Semi-Supervised Learning

Semi-Supervised Learning (learning from a small labeled dataset together with a larger unlabeled dataset). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Semi-Supervised Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Semi-Supervised Learning
const labeled = [
  {x:[1,1], label:'A'},
  {x:[5,5], label:'B'}
];
const distance=(a,b)=>Math.sqrt(a.reduce((s,x,i)=>s+(x-b[i])**2,0));
const classify=x=>labeled.map(r=>({...r,d:distance(r.x,x)})).sort((a,b)=>a.d-b.d)[0].label;
console.log(classify([1.4,1.2]));

Code explanation

  1. The example begins with only two labeled prototypes, making the supervision intentionally small.
  2. A distance function compares a new representation with the available labeled examples.
  3. The closest example supplies a simple predicted label.
  4. This toy setup helps explain how limited supervision, transfer, prototypes, or reusable representations can still support downstream learning.

Expected result: The label of the nearest prototype is printed.

Practice exercise

Create a small real-world example for Semi-Supervised Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.11 Self-Supervised Learning

Self-Supervised Learning (learning from training signals that are created automatically from the data itself). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Self-Supervised Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Self-Supervised Learning
const labeled = [
  {x:[1,1], label:'A'},
  {x:[5,5], label:'B'}
];
const distance=(a,b)=>Math.sqrt(a.reduce((s,x,i)=>s+(x-b[i])**2,0));
const classify=x=>labeled.map(r=>({...r,d:distance(r.x,x)})).sort((a,b)=>a.d-b.d)[0].label;
console.log(classify([1.4,1.2]));

Code explanation

  1. The example begins with only two labeled prototypes, making the supervision intentionally small.
  2. A distance function compares a new representation with the available labeled examples.
  3. The closest example supplies a simple predicted label.
  4. This toy setup helps explain how limited supervision, transfer, prototypes, or reusable representations can still support downstream learning.

Expected result: The label of the nearest prototype is printed.

Practice exercise

Create a small real-world example for Self-Supervised Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.12 Reinforcement Learning

Reinforcement Learning (learning actions through rewards, penalties, and repeated interaction with an environment). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Reinforcement Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Reinforcement Learning
let qValue = 0.4;
const reward = 1;
const nextBest = 0.7;
const rate = 0.2;
const discount = 0.9;
qValue = qValue + rate * (reward + discount * nextBest - qValue);

console.log(qValue.toFixed(3));

Code explanation

  1. `qValue` is the current estimate of how useful an action is.
  2. The reward represents immediate feedback from the environment.
  3. The next-state estimate is discounted because future rewards are usually treated as less certain.
  4. The update moves the old estimate partway toward the new target instead of replacing it all at once.

Expected result: The updated action-value estimate is printed.

Practice exercise

Create a small real-world example for Reinforcement Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.13 Common Machine Learning Applications

Common Machine Learning Applications (a way for computers to learn patterns from data instead of receiving every rule by hand). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Common Machine Learning Applications to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Common Machine Learning Applications
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for Common Machine Learning Applications. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.14 Machine Learning Workflow

Machine Learning Workflow (a way for computers to learn patterns from data instead of receiving every rule by hand). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Machine Learning Workflow to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Machine Learning Workflow
const tools = {
  average: values => values.reduce((a,b)=>a+b,0)/values.length,
  maximum: values => Math.max(...values)
};
const task = { tool: 'average', input: [4,7,9,10] };
const result = tools[task.tool](task.input);

console.log({ task, result });

Code explanation

  1. The `tools` object acts as a small registry of allowed operations.
  2. The task explicitly names which tool should run and provides its input.
  3. The dispatcher selects the requested function and executes it.
  4. This pattern demonstrates controlled tool use and workflow orchestration without giving unrestricted access to arbitrary operations.

Expected result: The selected tool and its computed result are printed.

Practice exercise

Create a small real-world example for Machine Learning Workflow. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

1.15 Limitations of Machine Learning

Limitations of Machine Learning (a way for computers to learn patterns from data instead of receiving every rule by hand). Within Chapter 1, this topic connects directly to foundations and practical tools. The important goal is to understand what information goes into the method, what transformation or decision happens, and what output should be checked.

For a beginner, focus on the meaning before memorizing formulas or syntax. Work with a very small example, identify each quantity or step, and then connect it to the way a model learns from data. This makes later algorithms easier because the same ideas appear repeatedly in training, evaluation, and prediction.

Example

Imagine a small machine-learning project. Use Limitations of Machine Learning to decide what information is needed, what step happens next, and what result should be checked.

Coding example

// Limitations of Machine Learning
const records = [3, 5, 7, 9, 11];
const transform = value => ({ input: value, output: value * 2 + 1 });
const results = records.map(transform);

console.log(results);

Code explanation

  1. The sample starts with a small list of inputs so every result can be checked manually.
  2. `transform()` represents the main operation for this topic in a deliberately simple form.
  3. `map()` applies the same rule consistently to every item and returns a new result array.
  4. Use this pattern to focus on input, transformation, and output before replacing the toy rule with a more advanced method.

Expected result: A transformed result is printed for each input value.

Practice exercise

Create a small real-world example for Limitations of Machine Learning. Write the input, the goal, the main steps, and the result you would check. Then list one limitation or mistake a beginner should watch for.

Chapter 1 Review Questions and Answers

Q1. What is What Is Artificial Intelligence??

Answer: What Is Artificial Intelligence? is computer systems designed to perform tasks that normally require human intelligence. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q2. What is What Is Machine Learning??

Answer: What Is Machine Learning? is a way for computers to learn patterns from data instead of receiving every rule by hand. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q3. What is AI vs Machine Learning vs Deep Learning?

Answer: AI vs Machine Learning vs Deep Learning is a way for computers to learn patterns from data instead of receiving every rule by hand. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q4. What is How Machines Learn from Data?

Answer: How Machines Learn from Data is a practical concept used within foundations and practical tools. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q5. What is Features and Targets?

Answer: Features and Targets is an input value or measurable property given to a model. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q6. What is Training and Prediction?

Answer: Training and Prediction is the output produced by a trained model for new input. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q7. What is Models and Algorithms?

Answer: Models and Algorithms is a defined procedure used to learn a pattern or solve a problem. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q8. What is Supervised Learning?

Answer: Supervised Learning is learning from examples that include the correct answer. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q9. What is Unsupervised Learning?

Answer: Unsupervised Learning is finding patterns or groups in data that has no target labels. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q10. What is Semi-Supervised Learning?

Answer: Semi-Supervised Learning is learning from a small labeled dataset together with a larger unlabeled dataset. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q11. What is Self-Supervised Learning?

Answer: Self-Supervised Learning is learning from training signals that are created automatically from the data itself. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q12. What is Reinforcement Learning?

Answer: Reinforcement Learning is learning actions through rewards, penalties, and repeated interaction with an environment. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q13. What is Common Machine Learning Applications?

Answer: Common Machine Learning Applications is a way for computers to learn patterns from data instead of receiving every rule by hand. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q14. What is Machine Learning Workflow?

Answer: Machine Learning Workflow is a way for computers to learn patterns from data instead of receiving every rule by hand. In this chapter, focus on the input, the method or decision, and the result that should be checked.

Q15. What is Limitations of Machine Learning?

Answer: Limitations of Machine Learning is a way for computers to learn patterns from data instead of receiving every rule by hand. In this chapter, focus on the input, the method or decision, and the result that should be checked.