Skip to main content

AI_G10_Ebook_AY25

Page 1

Sa

le

Subject Code 417

NEP 2020 based

|

Latest CBSE curriculum aligned

s

10

Sa

m

pl

e


Artificial Intelligence Subject Code 417

10


Acknowledgements Academic Authors: Jatinder Kaur, Neha Verma, Chandani Goyal, Kashika Parnami, Anuj Gupta, Simran Singh Creative Directors: Bhavna Tripathi, Mangal Singh Rana, Satish Book Production: Rakesh Kumar Singh, Sakshi Gupta Project Lead: Jatinder Kaur VP, Learning: Abhishek Bhatnagar

All products and brand names used in this book are trademarks, registered trademarks or trade names of their respective owners. © Uolo EdTech Private Limited First impression 2025 This book is sold subject to the condition that it shall not by way of trade or otherwise, be lent, resold, hired out, or otherwise circulated without the publisher’s prior written consent in any form of binding or cover other than that in which it is published and without a similar condition including this condition being imposed on the subsequent purchaser and without limiting the rights under copyright reserved above, no part of this publication may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of both the copyright owner and the above-mentioned publisher of this book. Book Title: Artificial Intelligence 10 ISBN: 978-81-979765-1-3 Published by Uolo EdTech Private Limited Corporate Office Address: 85, Sector 44, Gurugram, Haryana 122003 CIN: U74999DL2017PTC322986 Illustrations and images: www.shutterstock.com, www.stock.adobe.com and www.freepik.com All suggested use of the internet should be under adult supervision.


Preface In today’s rapidly advancing technological landscape that is dominated by robots and computers, understanding their language is more crucial than ever. From doctors harnessing AI to diagnose diseases to scientists deploying robots to explore space—computers are at the heart of it all. Simply knowing how to use a computer is no longer enough. The dynamic world of technology thrives on innovation, and this is where artificial intelligence (AI) plays a pivotal role. To meet the demands of this exciting age, Uolo proudly presents a two-book series on Artificial Intelligence (Subject Code 417), meticulously crafted for students in grades 9 and 10. This series not only provides theoretical knowledge but also fosters hands-on experience in AI and coding skills, preparing students for real-world applications. These books are thoughtfully aligned with the latest CBSE curriculum, ensuring that the material is presented in a clear and engaging manner. Within these pages, students will find all the resources they need to excel in both theoretical and practical AI examinations. Our books cover all the prescribed CBSE learning objectives, introducing students to essential AI concepts, domains, and applications. Additionally, these volumes include units that develop vital employability skills and vocational proficiencies, equipping students for the future. Each chapter is designed with detailed theoretical explanations that are contextual, relatable, and engaging for learners. The in-chapter activities provide practical experience with various AI concepts and domains, promoting a deeper understanding. We hope this series sparks curiosity in learners and empowers them to become informed participants in the ever-evolving world of AI.

iii


Chapter at a Glance: Walkthrough of Key Elements

Think Thinkand andTell Tell

1. 1.Can oforal, oral,spoken, spoken,and andwritten written communication? Canyou youlist listout outthe thedifferent different types types of communication? 2.2.Give ofverbal verbalcommunication. communication. Givetwo twoadvantages advantages and and disadvantages disadvantages of

Non-verbal Communication Non-verbal Communication

Non-verbal communicationisisaaway wayof ofsending sending messages messages without This implies thethe ability to interact Non-verbal communication withoutusing usingwords. words. This implies ability to interact with others without the useofofspoken spokenor orwritten written language. language. Instead, using facial expressions, hand with others without the use Instead,ititinvolves involves using facial expressions, hand signals, body postures, stances, and various gestures. signals, body postures, stances, and various gestures. Differences Between Verbal, Non-verbal, and Visual Communication

1

Hence, can define non-verbalcommunication communication as as the Hence, wewe can define non-verbal the type of that does not involve words. and communication Tell type Think of communication that does not involve words. It involves sharing signals and messages with others It involves sharing signals and messages with others through expressions, gestures, and body language. through expressions, gestures, and body language. Non-verbal Communication

Did DidYou YouKnow? Know?

1. Can you list out the different types of oral, spoken, and written communication? 2. Give two advantages and disadvantages of verbal communication.

Non-verbal communication involves expressions,

Non-verbal communication is a way of sending messages without using words. This implies the ability to interact with others without the use of spoken or written language. Instead, it involves using facial expressions, hand signals, body postures, stances, and various gestures.

Non-verbal communication involves expressions, posture, gestures, touch, space, eye contact, and posture, gestures, touch, space,the eye contact, and paralanguage. Understanding aspects of non-verbal Did You Know? paralanguage. Understanding aspects of non-verbal communication can help us bethe better communicators. Non-verbal communication involves expressions, communication can help us be better communicators. right posture, gestures,Using touch, space,the eye contact, and gestures and expressions while speaking paralanguage. Understanding the aspects of non-verbal Using the gestures and expressions while speaking communication can help us be better communicators. helps usright get our point across. Such understanding also Using the right gestures and expressions while speaking helps us gethelps our point across. Such understanding also usus get our point across. understanding also aids in understanding ourSuch audience’s reaction and aids us in understanding our audience’s reaction and Think and Tell altering our behaviour or communication accordingly. aids us in understanding our audience’s reaction and altering our behaviour or communication accordingly. Being professional at work requires that we be aware of appropriate gestures our and postures. If noise, altering behaviour or communication accordingly. distance, etc. interfere with spoken communication, Being professional at work requires that we be Hence, we can define non-verbal communication as the type of communication that does not involve words. It involves sharing signals and messages with others through expressions, gestures, and body language.

It has been observed that in our daily communication, information is constantly being shared and perceived through body movements (face, arm movements) and voice control (volume, tone, pauses), which are non-verbal in nature.

1. Have you ever played a game of dumb charades? What are the various ways in which you communicate in the game? Discuss with your teacher. 2. Have you ever felt confused when someone’s expression did not match their spoken words?

we can communicate using hand gestures to get our message across. For example, putting a finger on the lips signals that silence is required.

Basis Communication Visual Communication Did You Know?: FunVerbal facts related to theCommunication topic, Relies on visual elements, Involves using spoken or written Conveys meaning through facial included to captivate students’ interest. such as symbols, images, and words to convey messages and expressions, gestures, body language, Non-verbal

It has been observed that in our daily communication, It has been observed that in our daily communication, information is constantly being shared and perceived information is constantly being shared and perceived through body movements (face, arm movements) Meaning through movements (face, arm movements) and voice body control (volume, tone, pauses), which are and voice control (volume, tone, pauses), which are non-verbal in nature.

language Basis

How to Use Non-verbal Communication Effectively?

Types of Non-verbal Communication

Gestures

Facial expressions convey the emotional state of a person to others.

Maintain a calm expression. Be subtle and neutral.

For example, people smile when they are happy or frown when they are upset.

Maintain eye contact.

Forms 1. Have you ever played a game of dumb charades? the various ways in which you communicate 1. What Haveare you ever played a game of dumb charades? Meaning in the game? Discuss with your What are the various ways inteacher. which you communicate Medium 2. Have you ever felt confused when someone’s

Think and Tell

Gestures are a form of non-verbal communication used to express an idea or meaning through the movement of parts of the body, especially the hands or the head.

Align expression to words being spoken.

It is important to keep in mind that it is considered impolite to use your finger to point at someone.

For example, nodding of the head indicates agreement and understanding. Waving at others indicates a greeting.

Show that you are paying attention by nodding your head slightly when conversing or listening.

Verbal Communication Face-to-face conversations, phone calls, speeches, and written documents. Involves using spoken or written words to convey messages and Utilises spoken words, written information. documents, phones, and computers.

2

Differences Between Verbal, Non-verbal, and Visual Communication

but uses visual cues and elements to convey message Visual Communication Logos, posters, comics, produ packaging, andelements, illustrations. Relies on visual such as symbols, images, and design, to communicate ideas Utilises images, graphics, and concepts. videos, and animations.

May or may not use language Logo of visual a brand. but uses cues and elements to convey messages

Non-verbal Face-to-face conversations,Basis phoneVerbal Communication Visual Communication Communication Facial expressions, gestures, posture, Logos, posters, comics, produ Relies on visual elements, eyeorcontact, and touch. packaging, and illustrations. Involves using spoken written Conveys meaning through facial such as symbols, images, and Meaning words to convey messages and expressions, gestures, body language, documents. design, to communicate ideas information.

How to Use Non-verbal

Types of Non-verbal Communication (continued...) Facial expressions

involves elements like tone, volume, and pace. Non-verbal Communication Facial expressions, gestures, posture, eye contact, and touch. Conveys meaning through facial expressions, gestures, body language, Utilises body language, facial and other non-verbal cues. expressions, gestures, and physical presence. Does not use language directly but Requires the use of language, Writing an email or giving a speech. involves Noddingelements head or like shaking tone,hands. volume, including grammar and vocabulary. and pace. including grammar and vocabulary.

Activitycalls, Time speeches, and written Activity Time

Forms

How to Use Non-verbal Communication Effectively?

Try placing your hands by your sides instead of in

yourNon-verbal pockets when you’re having a conversation. Types of Communication

Example: I saw a dog in the park. (referring to one dog in general)

design, to communicate idea and concepts.

and other non-verbal cues.

Think and Tell: Analysis, reflection and text-to-self connection-based prompts for discussion in class

Think and Tell

aware of appropriate gestures and that postures. If noise, Being professional at work requires we be distance, etc. interfere with spoken communication, aware of appropriate gestures and postures. If noise, in the game? Discuss with your teacher. expression did not match their spoken words? we can communicate using hand gestures to get our 2. Have you ever felt confused when someone’s distance, etc. interfere with spoken communication, Use of across. Forusing example, putting a finger onour the expression did not match their spoken words? Example we message can communicate hand gestures to get language Rules for Using the Indefinite Article (a/an) lips signals that silence is required. message across. For example, putting a finger on the lips‘a’ signals that silence is required. 1. Countable Nouns: Use or ‘an’ with countable nouns when you are referring to one nonspecific item or thing. Facial expressions

information.

Differences Between Verbal, Non-verbal, and Does not use Visual language Communication directly but May or may not use language Use of Requires the use of language,

non-verbal in nature.

and other non-verbal cues.

and concepts.

Activity 1: Pros and Cons of Verbal and Non-verbal Communication Does not use language directly but May or may not use language, Use of Requires the use of language, body language, facial Utilises spoken words, written Utilises involves elements like tone, volume, but uses visual cues and

(Group Work

Communication Effectively? Utilises images, graphics, 2. Singular Nouns: Use ‘a’ before singular nouns that begin with a consonant Medium documents, phones, and expressions, gestures, and physical Converse on the advantages and Facial expressions convey the emotional state of sound. a Maintain a calm expression. Be subtle and neutral. In a small group of 4–5 students, choose and discuss any one type of communication. videos, and animations. Facial expressions

person to others.

computers.

language

including grammar and vocabulary.

Forms

Face-to-face conversations, phone calls, speeches, and written documents.

presence.

disadvantages of the chosen form of communication. Align expression to words being spoken. Example: He is a teacher. (Teacher starts with a consonant sound: Facial expressions convey emotional For example, people smilethe when they/t/.) are state happyof a Maintain a calm expression. Be subtle and neutral. Chapter 1 • Methods of Communication

7

person to others. or frown when they are upset.

Use ‘an’ before singular nouns that begin with a vowel sound. For example, people smile when they are happy IT Grade_9_Book.indb 7

02-09-2024 15:30:51

4.

elements to convey messages.

Facial expressions, gestures, posture, eye contact, and touch.

Logos, posters, comics, product packaging, and illustrations.

Utilises images, graphics, documents, phones, and expressions, and physical Example Writing an email or givingMedium a speech. Nodding head orgestures, shaking hands. videos, and animations. Logo of a brand. presence. On an A3 size sheet, list the advantages andcomputers. disadvantages discussed. You may make it creative and display it in the class.

Maintain eye contact.

Align expression to words being spoken.

Example

Utilises spoken words, written

Utilises body language, facial

Writing an email or giving a speech.

Nodding head or shaking hands.

Logo of a brand.

Activity 2: Common Body Language Mistakes

(Group Work

Activity Time Activity Time Activity Time: Classroom- and laboratory-based group It is important to keep in mindand that it is consideredForm groups of 4–5 students and engage in discussion on the dos and don’ts of body language that should be followed in or frown when they are upset.

Example: She has an umbrella. (Umbrella startsarewith a of vowel sound: /ʌ/.) Gestures a form non-verbal communication 3.

and pace.

Maintain eye contact.

ActivityTime Time Activity

Activity 1: Pros and Cons of Verbal and Non-verbal Communication

(Group Work)

used to express an idea or meaning through the In a small group of 4–5 students, choose and discuss any one type of communication. Converse on the advantages and impolite to use your finger to point at someone. a formal and informal setting. disadvantages of the chosen form of communication. movement of parts of thesingular body, especially the that begin with a silent ‘h.’ Singular Nouns Starting with a Silent Gestures ‘H’: Use ‘an’ before nouns Communication (Group Work) On an Non-verbal A3 size sheet, list the advantages and disadvantages discussed. You may make it creative and display it in the class. form of non-verbal communication Try placing your hands by your sides instead of inActivity 1: Pros and Cons of Verbal and hands orare theahead. It is important to keep in mind that it is considered Activity 2: Common Body Language Mistakes (Group Work) used to express an idea or meaning through the To make the presentation interesting, you can create a small skit displaying the good and bad body language in different Gestures your pockets when you’re having a conversation. impolite to use your finger to point at someone. Form groups 4–5 students andany engage one in discussion on theof dos and don’ts of body language that should be followed in In a small group of 4–5 students, choose andofdiscuss type communication. Converse on the advantages and Example: He’s an honest person. (Honest starts with a silent ‘h’ and begins with the vowel sound of ‘o’) For example, nodding of the head indicates movement of parts of the body, especially the a formal and informal setting. scenarios. agreement understanding. Show that youyour are paying attention by nodding of the chosen form of communication. To make the presentation interesting, you can create a small skit displaying the good and bad body language in different hands or the and head. Try placing hands by your sides instead disadvantages of in scenarios. your heador slightly when conversing or listening. Professions and Nationalities: Use ‘a’ orWaving ‘an’ when referring someone’s profession nationality without your pockets when you’re having a conversation. at others indicates ato greeting. For example, nodding of the head indicates On an A3 size sheet, list the advantages and disadvantages discussed. You may make it creative and display it in the class. Gestures

individual activities for an enhanced learning experience

specifying a particular person.

agreement and understanding.

Show that you are paying attention by nodding

Activity 2: Common Body Language Mistakes (Group Work) your head slightly when conversing (continued...) or listening. Chapter Checkup: Chapter-end exercises containing Form groups of 4–5 students and engage in discussion on the dos and don’ts of body language that should be followed in Chapter Checkup a formal and informal setting. She is an Indian chef. subjective and objective questions to enable comprehensive (continued...) make the interesting, you can create a small skit displaying the good and bad body language in different Chapter 1 • Methods of Communication 7 Select ATo thepresentation correct option. 5. General Statements: Use ‘a’ or ‘an’ to make general statements about a group. practice of concepts. scenarios. 1 What is the medium of verbal communication? Chapter Checkup

Waving at others indicates a greeting. Example: She is a lawyer. (referring to any lawyer in general)

A Select the correct option.

1 What is the medium of verbal communication? a To use pictures and symbols

b To exchange information through spoken or written words c To communicate using only gestures

d To convey emotions through facial expressions

Let us consider predicting student performance on an upcoming exam. We can build a model using a student

Example: ‘I need a book for my research’. (referring to any book that fits the research). database. This database would have various features suitable for training and testing. Here is how we can split

7 a To use pictures and symbols10

Chapter 1 • Methods of Communication

b To exchange information through spoken or written words

the data: IT Grade_9_Book.indb 7 6. First Mention: When you introduce a new, singular, and Training Data: Training or data is a collection examples nonspecific noun in a conversation text, use ‘a’ orof‘an’.

3

Let us consider predicting student performance on an upcoming exam. We can build a model using a student that the model uses to learn how to do a specific task. database. This database would have various features suitable for training and testing. Here is how we can split the IT data: Grade_9_Book.indb Example: ‘I sawThis a car on include the 7street’. (The car hasn’t beenscores in would data features like past exam Training Data: Training data is a collection of examples that the model uses to learn how to do a specific task. mentioned before in the conversation.) relevant subjects, attendance records, and time spent on Remember This would include data features like past exam scores in relevant subjects, attendance records, and time spent on online learning platforms online learning platforms (numerical data). It might also (numerical data). It might also include categorical data like learning style (visual, auditory), Specific vs. nonspecific: ‘a’categorical and (active, ‘an’reserved), indicate a nonspecific or preferred class participation etc. Forlike learning style (visual, auditory), include data better efficiency of an AI project, the training data needs to be relevant and authentic. generic item, whereas ‘the’ indicates a specific or reserved), previously preferred class participation (active, etc. For Testing Data: Testing data is used to evaluate the performance of a trained model. This data would be unseen efficiency of an AI project, the training data needs to mentioned item. better by the model during training. It would include similar Error Alert! features from a separate group of students taking the same be relevant and authentic. exam. By comparing the model’s predictions on the testing Machine Learning (ML) is a branch of AI where the machine makes

predictions and decisions based on the data that we provide it.

‘I need a pen’. (Any pen will do.)

data with the actual exam results, we can evaluate its

If an AI application is trained with an inaccurate or inappropriate data it may leads to incorrect result.

effectiveness in predicting performance. Testing Data: Testing data is used to evaluate the Activity of a trained model. This data be unseen ‘I need the pen youperformance borrowed yesterday’. (referring to a would specific pen) Imagine you are tasked with creating an AI system to predict whether a customer is likely to purchase a high-end by the model during training. It would include similar smartphone based on their online behaviour. The AI system will be trained using historical data from previous customers. Identify the data features you would collect to ensure the AI system can accurately predict the likelihood Cases with zero article usage, often referred ‘zero article’, occur features from a separate groupto of as students taking the same of a customer purchasing the smartphone. Possible Data Features: By comparing the‘the’, model’s on the a testing when we don’t use exam. any article (neither ‘a’, predictions nor ‘an’) before noun. • Browsing Behaviour: Customers who have bought high-end smartphones before are likely to buy again. • Search Queries: Specific searches for features or brands related to high-end smartphones indicate intent. data with the actual exam results, we can evaluate its • Demographic Information: Age and income can influence purchasing decisions for high-end smartphones. Use effectiveness in predicting performance. • Reviews and Ratings: High ratings on products may sway customer decisions. Now, think of three additional data features beyond those previously discussed to predict customer behaviour in the context of purchasing high-end smartphones. Also, explain why each feature is important.

I don’t like pets.

Activity Data Feature

Importance

What time do you have breakfast? 1.

02-09-2024 15:30:51

c To communicate using only gestures IT Grade_9_Book.indb 10

Remember

Remember Machine Learning (ML) is a branch Remember: Important A Select the correct option.points to aid memory and 02-09-2024 15:30:51

Uncountable plural nouns: of AI whereand the machine makes In the case of and uncountable nouns predictions decisions based on the data that wewe provide it. use ‘a’ or plural nouns, do not or ‘an’.

recall.

1 What is the medium of verbal communication? a To use pictures and symbols

10

Incorrect: ‘I need a information.’

b To exchange information through spoken or written words c To communicate using only gestures

d To convey emotions through facial expressions

Correct: ‘I need information.’

Error Alert!: Common misconceptions with clear If an AI application is trained with an inaccurate solutions. or inappropriate data it may leads to incorrect Error Alert!

result.

IT Grade_9_Book.indb 10

10

Reason

Meals- lunch, breakfast, dinner.

IT Grade_9_Book.indb 10

2.

smartphone based on their online behaviour. The AI system will be trained using historical data from previous He does not speak Telugu. Languages. customers. Identify the data features you would collect to ensure the AI system can accurately predict the likelihood of a customer purchasing the smartphone. I love studying Biology. School subjects. 153 Chapter 5 • Data Acquisition

IT Grade_9_Book.indb 153

•

Next, last.

Key Terms

4

Unit Reflection

Unit Reflection

02-09

Key Terms Self-awareness: It is to know oneself as an individual—be it one’s likes, dislikes, strengths, or weaknesses, and reflect on one’s experiences to gain valuable insights into their personality.

Self-awareness: It is to know oneself as an individual—be it one’s likes, dislikes, strengths, or weaknesses, a Self-confidence: Self-confidence involves believing in one’s own judgement, abilities, and capabilities. It is reflected in one’s thoughts, ideas, and behaviour. reflect on one’s experiences to gain valuable insights into their personality. Self-management: Self-management is the capability of an individual to exercise control over one’s feelings, ideas, thoughts, emotions, and behaviour to achieve the desired goals in both personal and professional settings.

02-09-2024 15:32:17

Browsing Behaviour: Customers who have bought high-end smartphones before are likely to buy again.

Key• Terms: Important terms to ensure a firm grasp of Connecting Ideas: Paragraphs Demographic Information: Age and income can influence purchasing decisions for high-end smartphones. Now that we have read about sentences, let us learn how to put them together to make paragraphs. Think of a • Reviews and Ratings: High ratings on products may sway customer decisions. important concepts. •

02-0

Unit Reflection

Pets in general—general meaning.

Imagine you are tasked with creating an AI system to predict whether a customer is likely to purchase a high-end 2021 was a great year. Years, months, days.

Possible Data Features: We went to the shopping mall last week.

02-09-2024 15:30:52

d To convey emotions through facial expressions

Chapter Checkup

Search Queries: Specific searches for features or brands related to high-end smartphones indicate intent.

It anbelieving intrinsic feeling that in encourages one toown completejudgement, tasks and achieve goals independently. It is and capabilities. It is re Self-confidence: Self-confidenceSelf-motivation: involves one’s abilities, an internal drive or enthusiasm that prompts one to take initiative. in one’s thoughts, ideas, and behaviour. Stress management: It is the coping mechanism that enables an individual to handle work efficiently, even under

Self-management: Key TermsSelf-management is the capability of an individual to exercise control over one’s feelings pressure or difficulties.

Time management: It is the ability to successfully complete tasks within specified deadlines and the ability of an individual to minimise distractions and unproductive activities.

thoughts, emotions, and behaviour to achieve the desired goals in both personal and professional settings. Things to Remember

Self-motivation: It an intrinsic feeling thatoneself encourages complete tasks and achieve goals independen It is to know asone antoindividual—be it one’s likes, dislik paragraph as a group of friends who share something in common. Just like how friends stay close, sentences within Self-awareness: Now, think of three additional data features beyond those previously discussed to predict customer behaviour in an internal drive or enthusiasm that prompts one to take initiative. a paragraph remain interconnected as they discuss a common topic. reflect on one’s experiences to gain valuable insights into their personality. the context of purchasing high-end smartphones. Also, explain why each feature is important. Data Feature

30

Importance

1.

IT Grade_9_Book.indb 30

Things to Remember: Unit-end point-wise summary to consolidate 2. concepts.

• Various self-management skills that an individual should possess are self-awareness, self-confidence, self-motivation, problem solving, teamwork, time management, goal setting, decision-making, and stress management.

• Effective self-management helps in achieving goals, managing one’s time, reducing stress, making a person more organised, improving relationships, enhancing problem solving abilities, career advancement and instilling

discipline. Stress management: It is the coping mechanism that enables an individual to handle work efficiently, even • A self-confident person is ready to accept new challenges, willing to take risks, and has trust in their own capabilities. pressure or difficulties. Self-confidence Self-confidence: involves believing in one’s own judgement, • A few qualities that are commonly associated with self-confident people are self-belief, hard work, commitment, and a positive attitude.

Time management: It is the abilityand to successfully complete tasks within specified deadlines and the ability in one’s thoughts, ideas, behaviour. • The three main factors that influence self-confidence are social, cultural, and physical.

• There are some factors that work against us and do not help us boost our confidence, like negative self-belief, individual to minimise distractions and unproductive dwelling on past mistakes, fear of failure, andactivities. negative surroundings.

Self-management: Self-management is the capability of an individual to exe thoughts, and behaviour to achieve the desired goals in both pers Things to emotions, Remember • To build self-confidence, one should think positively, stay clean, hygienic and smart, find happiness in small things, chat with positive people, and get rid of negative thoughts.

02-09-2024 15:31:04

• Various self-management skills that an individual should are self-awareness, Self-motivation: It an intrinsic feeling thatpossess encourages one toself-confidence, complete task self-motivation, problem solving, teamwork, time management, goal setting, decision-making, and stress anmanagement. internal drive or enthusiasm that prompts one to take initiative. 52

• Effectivemanagement: self-management helps achieving goals,mechanism managing one’s that time, reducing stress, a perso Stress It isinthe coping enables an making individual more organised, improving relationships, enhancing problem solving abilities, career advancement and in pressure or difficulties. discipline. IT Grade_9_Book.indb 52

iv

Chapter 5 • Data Acquisition

02-09-2024 15:31:11

153 • A self-confident person is ready to accept new challenges, willing to take risks, and has trust in their own Time management: It is the ability to successfully complete tasks within spe capabilities.

individual to minimise distractions and unproductive activities.

IT Grade_9_Book.indb 153

• A few qualities that are commonly associated with self-confident people are self-belief, hard work, commit and a positive attitude. 02-09-2024 15:32:17 • The three main factors that influence self-confidence are social, cultural, and physical. Things to Remember


computers or devices. Communication networking allows computers and devices to share resour with each other, and work together regardless of their physical location.

Q3. Riya wants to backup her files to protect her data from potential loss. Name one device that she c purpose. A3. External hard drive.

5

Chapter Checkup A Select the correct option.

Answer Key: Solutions to unsolved questions to support independent practice and learning.

1 Which of the following is NOT a primary operation of a computer? a Input

b Processing

c Storage

Answer Key

d Printing

2 Which of the following is an example of an input device? a Monitor

b Printer

c Keyboard

d Speaker

3 Which of the following refers to the saving and retrieval of data on a computer? a Input

d Control

1 The primary operations of a computer include input, processing, storage, and 2 A joystick is an example of an 3

A 1. d

b Output

c Storage

B Fill in the blanks with the most suitable words.

.

B 1. Output

device.

is a type of storage device that uses flash memory to store data.

4 A

is a network that connects computers and devices around the globe.

C State whether the following is True or False. Correct the statements that are false.

2. c

3. c

2. Input

3. SSD

C 1. True.

1 Processing refers to the manipulation of data by a computer.

2 A computer network does not allow computers and devices to share resources. 3 Input is the process of entering data and commands into a computer. 4 A webcam is an example of an input device.

4. WAN

6

List of Practicals

2. False. A computer network allows computers and devices to share resources.

D Answer the following questions. (Solved)

Write a Python program to solve the following problems. PRINT

Q1. What are storage operations in a computer system?

A1. Storage operations are crucial for saving and retrieving data. It involves reading and writing data to and from these storage devices.

1. To print personal information like Name, Father’s Name, Class and School Name.

3. True.

Q2. What is communication networking?

A2. Communication networking in computer systems refers to the exchange of data and information between two or more computers or devices. Communication networking allows computers and devices to share resources, communicate with each other, and work together regardless of their physical location.

Q3. Riya wants to backup her files to protect her data from potential loss. Name one device that she can use for this purpose.

2. To print the following patterns using multiple print commands:

4. True.

A3. External hard drive.

Answer Key 3. To find the square of number 7.

A 1. d

2. c

3. c

B 1. Output

2. Input

3. SSD

4. To find the sum of the numbers 15 and 20.

4. WAN

C 1. True.

5. To convert length given in kilometres into metres.

2. False. A computer network allows computers and devices to share resources.

6. To print the table of 5 up to five terms.

3. True.

83

Chapter 10 • Basic Computer Skills

7. To calculate Simple Interest if the principle_amount = 2000, rate_of_interest = 4.5 and time = 10.

Chapter 10 • Basic Computer Skills

4. True.

8. To print “Good” 10 times 9. To print concatenated strings given str1 = “Welcome to” str2 = “the World of Python” 10. To convert the time given in hours into minutes and seconds.

IT Grade_9_Book.indb 83

02-09-2024 15:31:42

INPUT

List of Practicals: Recommended list of practical questions for active learning. IT Grade_9_Book.indb 83

11. To calculate area and perimeter of a rectangle 12. To calculate area of a triangle with base and height

List of Practicals

13. To calculate average marks of 3 subjects 14. To calculate discounted amount with discount % 15. To calculate surface area and volume of a cuboid 16. To calculate speed given, distance traveled and time taken 17. To calculate circumference and area of a circle given its radius

Write a Python program to solve the following problems.

7

18. To calculate volume of a cube given the length of its side 19. To calculate sum of the first N natural numbers

PRINT

20. To calculate profit given cost price and selling price

1. To print personal information like Name, Father’s Name, Class and School Name.

379

List of Practicals

2. To print the following patterns using multiple print commands:

Viva-Voce Questions

IT Grade_9_Book.indb 379

1. Give any one disadvantage of AI.

02-09-2024 15:35:45

Ans. Overdependence on AI makes humans trust AI recommendations more than their own cognitive skills. 2. What is NLP?

Ans. NLP stands for Natural Language Processing (NLP). It is a domain of AI that helps computers understand and respond to us when we talk to them. 3. What is testing data?

Ans. Once a model is trained, it needs to be checked to see how well it works with new information. This is done with a different set of data that was not used during training, known as testing data or validation data. 4. What fundamental questions does the 4 Ws canvas answer?

Viva-Voce Questions: Reference list of viva questions Viva-Voce 3.Questions To find the square of number 7.

Ans. The 4 Ws canvas focuses on answering 4 fundamental questions: Who, What, Where and Why. 5. What is the full form of APIs?

Ans. The full form of APIs is Application Programming Interfaces. 6. What is a box plot graph?

Ans. A box plot graph is a graph that summarises the distribution of a dataset by showing the median, quartiles, and potential outliers.

to better prepare for oral examinations.

4. To find the sum of the numbers 15 and 20.

7. What is AI modelling?

5. To convert length given in kilometres into metres.

Ans. AI modelling refers to the process of creating algorithms, known as models, that can1. learnGive from data anyand one disadvantage of AI. make predictions or decisions based on new data.

Ans. Overdependence on AI makes humans trust AI recommendations more than their skills. 6. To print the table ofown 5 upcognitive to five terms.

8. How is prediction different from reality?

Ans. Prediction is the output given by the machine whereas reality is the actual situation in field at the time the 2.theWhat is NLP? prediction was made.

7. To calculate Simple Interest if the principle_amount = 2000, rate_of_interest = 4.5 and time = 10.

Ans. NLP stands for Natural Language Processing (NLP). It is a domain of AI that helps computers understand and respond to us when we talk to them. 8. To print “Good” 10 times

9. Give an example of False Positive.

Ans. The machine predicts it is raining, but it is not actually raining. 10. Define deployment.

3. What is testing data?

9. To print concatenated strings given

Ans. Deployment is the last stage in the AI project cycle where you implement your solution, in a real-world scenario, based on the model you have selected. Ans. Once a model is trained, it needs to be checked to see how well it works with new information. This is done

= “Welcome to” or validation data. with a different set of data that was not used during training,str1 known as testing data

11. State any one ethical principle for AI.

Ans. AI should support and enhance human autonomy and decision-making. 12. State any one way to reduce AI bias.

4. What fundamental questions does the 4 Ws canvas answer? str2 = “the World of Python”

13. How can multi-factor authentication (MFA) ensure cyber security?

5. What is the full form of APIs?

14. Define data literacy.

6. What is a box plot graph?

Ans. One way to reduce AI bias is to collect diverse data by ensuring that training data represents the variety of the Ans. The 4 Ws canvas focuses on answering 4 fundamental questions: Who, What, Where and Why. population without supporting existing biases.

10. To convert the time given in hours into minutes and seconds.

Ans. Applying multi-factor authentication (MFA) adds an extra layer of security by requiring users to provide Ans. The full form of APIs is Application Programming Interfaces. additional credentials, such as a onetime password (OTP) sent to their mobile device.

INPUT 11. To calculate area and perimeter of a rectangle

Ans. The ability to understand, interpret and communicate with data is known as data literacy.

8

Projects Project 1: Create an AI model using Teachable Machine

Ans. A box plot graph is a graph that summarises the distribution of a dataset by showing the median, quartiles, 12. To calculate area of a triangle with base and height Ans. The three domains of AI are Computer Vision (CV), Natural Language Processing (NLP), and Statistical Data. and potential outliers. 15. Name the three domains of AI.

7. What is AI modelling?

13. To calculate average marks of 3 subjects

8. How is prediction different from reality?

15. To calculate surface area and volume of a cuboid

Teachable Machine is a web-based tool that makes the creation of machine learning models fast, easy, and accessible to everyone. It helps train a computer to recognise images, sounds, and poses. Follow the steps below to get started working on this application: 1. Visit this link: https://teachablemachine.withgoogle.com/

Ans. AI modelling refers to the process of creating algorithms, known as models, that can learn from data and 381 14. To calculate discounted amount with discount % make predictions or decisions based on new data.

Viva-Voce Questions

This will direct you to a web page as shown.

15:35:45 Ans. Prediction02-09-2024 is the output given by the machine whereas reality is the actual situation in thedistance field at the time theand time taken 16. To calculate speed given, traveled prediction was made.

IT Grade_9_Book.indb 381

Projects: Detailed projects that promote the application of knowledge.

17. To calculate circumference and area of a circle given its radius

9. Give an example of False Positive.

Projects

Ans. The machine predicts it is raining, but it is not actually raining. 18. To calculate volume of a cube given the length of its side 10. Define deployment.

19. To calculate sum of the first N natural numbers

Ans. Deployment is the last stage in the AI project cycle where you implement your solution, in a real-world 20. To calculate profit given cost price and selling price scenario, based on the model you have selected.

Project 1: Create an AI model using Teachable Machine

11. State any one ethical principle for AI.

Teachable Machine is a web-based tool that makes the creation of machine learning models fast, easy, and Ans. AI should support and enhance human autonomy and decision-making. accessible to everyone. It helps train a computer to recognise images, sounds, and poses. 12. State any one way to reduce AI bias. List of Practicals Ans. One way to reduce AI bias is to collect diverse data by ensuring that training data represents the variety of the Follow the steps below to get started working on this application: population without supporting existing biases.

379

13. How can multi-factor authentication (MFA) ensure cyber security? 1. Visit this link: https://teachablemachine.withgoogle.com/

9

Ans. Applying multi-factor authentication (MFA) adds an extra layer of security by requiring users to provide IT Grade_9_Book.indb 379 This will direct you to a web page as shown. additional credentials, such as a onetime password (OTP) sent to their mobile device.

Sample Paper – 1

2. Click on the Get Started button.

02-09-2024 15:35:45

3. From the window that appears, you can use any of the following options to teach your machines:

14. Define data literacy.

• Images: To teach a model to classify images using files on your system or your webcam. • Sounds: To teach a model to classify audio by recording short sound samples.

Ans. The ability to understand, interpret and communicate with data is known as data literacy.

• Poses: To teach a model to classify body positions or poses using image files on your system or striking poses in your webcam.

15. Name the three domains of AI.

Artificial Intelligence (SUBJECT CODE - 417)

Try to create the image project, sound project and pose project by uploading pictures or using a webcam or using a microphone.

Ans. The three domains of AI are Computer Vision (CV), Natural Language Processing (NLP), and Statistical Data.

Class IX (Session 2024-2025) Max. Time: 2 Hours

Max. Marks: 50

General Instructions: 1.

384

Please read the instructions carefully.

2.

This Question Paper consists of 21 questions in two sections: Section A & Section B.

3.

Section A has Objective type questions, whereas Section B contains Subjective type questions.

381

Viva-Voce Questions

4.

Out of the given (5 + 16 =) 21 questions, a candidate has to answer (5 + 10 =) 15 questions in the allotted (maximum) time of 2 hours.

5.

IT Grade_9_Book.indb 384

02-09-2024 15:35:46

All questions of a particular section must be attempted in the correct order.

6.

SECTION A - OBJECTIVE-TYPE QUESTIONS (24 MARKS): i.

ii.

This section has 05 questions.

Marks allotted are mentioned against each question/part.

Sample Papers: Sample papers, adhering to CBSE Sample Paper – 1guidelines, to ensure preparedness for written exams.

IT Grade_9_Book.indb 381

02-09-2024 15:35:45

iii. There is no negative marking.

iv. Do as per the instructions given.

7.

SECTION B – SUBJECTIVE-TYPE QUESTIONS (26 MARKS):

i.

ii.

This section has 16 questions.

A candidate has to do 10 questions.

iii. Do as per the instructions given.

iv. Marks allotted are mentioned against each question/part.

SECTION A: OBJECTIVE-TYPE QUESTIONS Q1. Answer any 4 out of the given 6 questions on Employability Skills

(1 x 4 = 4 marks)

Artificial Intelligence (SUBJECT CODE - 417) Class IX (Session 2024-2025)

1. Tarun moved to Japan for a tech job but struggles with Japanese, the primary office language. This makes it hard for him to participate in meetings and follow instructions, affecting his performance. This is an example of: a. Interpersonal barrier

c. Organisational barrier

b. Physical barrier

d. Linguistic barrier

Max. Time: 2 Hours

Max. Marks: 50

General Instructions:

2. A non-profit organisation works to preserve forests and restore degraded land, promoting biodiversity and supporting local wildlife. This can be related to: a. Life on land

c. Affordable and clean energy

1.

b. Clean water and sanitation

2.

d. Reduced inequalities

3.

Please read the instructions carefully.

This Question Paper consists of 21 questions in two sections: Section A & Section B.

Section A has Objective type questions, whereas Section B contains Subjective type questions. 2. Click on the Get Started button.

3. “Can you help me with my homework after school?” What type of sentence is this? a. Interrogative c. Assertive

388

b. Exclamatory d. Imperative

4. 5. 6.

IT Grade_9_Book.indb 388

Out of the given (5 + 16 =) 21 questions, a candidate has to answer (5 + 10 =) 15 questions in the allotted 3. From the window that appears, you can use any of the following options to teach your machines: (maximum) time of 2 hours. • Images: All questions of a particular section must be attempted in the correct order. To teach a model to classify images using files on your system or your webcam. SECTION A - OBJECTIVE-TYPE QUESTIONS (24 MARKS):

• Sounds: To teach a model to classify audio by recording short sound samples.

• Poses: To teach a model to classify body positions or poses using image files on your system or striking poses in your webcam. Marks allotted are mentioned against each question/part. Try to create the image project, sound project and pose project by uploading pictures or using a webcam or using a microphone. iv. Do as per the instructions given.

i.

ii.

This section has 05 questions. 02-09-2024 15:35:47

iii. There is no negative marking. 7.

SECTION B – SUBJECTIVE-TYPE QUESTIONS (26 MARKS): i.

ii.

This section has 16 questions.

A candidate has to do 10 questions.

384

iii. Do as per the instructions given.

iv. Marks allotted are mentioned against each question/part. IT Grade_9_Book.indb 384

SECTION A: OBJECTIVE-TYPE QUESTIONS

02-09-2024 15:35:46

v


Artificial Intelligence (Subject Code 417) Class – X (Session 2024–2025) Total Marks: 100 (Theory – 50 + Practical – 50) No. of Hours for Theory and Practical

Max. Marks for Theory and Practical

Unit 1: Communication Skills-II

10

2

Unit 2: Self-Management Skills-II

10

2

Unit 3: ICT Skills-II

10

2

Unit 4: Entrepreneurial Skills-II

15

2

Unit 5: Green Skills-II

05

2

50

10

Units

PART A

Employability Skills

Total

PART B

Subject Specific Skills Theory

Practical

Unit 1: Introduction to Artificial Intelligence (AI)

15

-

7

Unit 2: AI Project Cycle

15

-

9

Unit 3: Advance Python (To be assessed in Practicals only)

-

30

-

Unit 4: Data Science (Introduction, Applications of Data Sciences, Data Science: Getting Started (up to Data Access), remaining portion is to be assessed in practical

7

8

4

Unit 5: Computer Vision (Introduction, Applications of Computer Vision, Computer Vision: Getting Started (up to RGB Images), remaining portion is to be assessed in practical

12

18

4

Unit 6: Natural Language Processing

25

5

8

Unit 7: Evaluation

15 Total

8 150

40

PART C

Practical Work Practical File with minimum 15 Programs

15

Practical Examination Unit 3: Advance Python Unit 4: Data Science Unit 5: Computer Vision

5

Viva Voce

5

5 5

PART D

Total

35

Project Work / Field Visit / Student Portfolio (Any one to be done)

10

Viva Voce

5 Total GRAND TOTAL

vi

15 210

100


Contents Part A • Employability Skills UNIT 1

Communication Skills-II

UNIT 2

Self-management Skills-II

UNIT 3

Information and Communication Technology Skills–II

UNIT 4

Entrepreneurial Skills–II

• Methods of Communication • Understanding Feedback • Barriers to Effective Communication • Principles of Effective Communication • Basics of Writing Skills Unit Reflection

• Stress Management 56 • Ability to Work Independently 64 Unit Reflection 72 • Operating Systems and File Organisation • Care and Maintenance of Computer Unit Reflection • Exploring Enterpreneurship Unit Reflection

UNIT 5

3 14 25 32 39 50

Green Skills–II

• Sustainable Development Unit Reflection

76 87 97 101 112 115 123

Part B • Artificial Intelligence UNIT 1

Introduction to Artificial Intelligence

UNIT 2

AI Project Cycle

• Foundational Concepts of AI • Basics of AI • AI Ethics Unit Reflection

129 137 147 156

• Introduction to AI Project Cycle • Problem Scoping and SDGs • Simplifying Data Acquisition • Visualising Data • Introduction to Modelling Unit Reflection

160 165 173 178 185 198

vii


UNIT 3

Advance Python (To be assessed through Practicals)

UNIT 4

Data Sciences

UNIT 5

Computer Vision

UNIT 6

Natural Language Processing

UNIT 7

Evaluation

• Jupyter Notebook • Introduction to Python • Python Basics Unit Reflection

202 217 255 264

• Introduction to Data Science • Applications of Data Science • Revisiting AI Project Cycle, Data Collection, Data Access • Python for Data Sciences • Statistical Learning and Data Visualisation • K-Nearest Neighbour Model (Optional)** Unit Reflection

268 273 278 285 294 303 309

• Introduction to Computer Vision • Understanding CV Concept • Introduction to OpenCV • Understanding Convolution Operator (Optional)** • Introduction to CNN (Optional)** Unit Reflection

313 319 330 343 349 357

• Introduction to Natural Language Processing • Revisiting AI Project Cycle (NLP) • Data Processing Unit Reflection

361 368 374 389

• Introduction to Model Evaluation • Model Evaluation Terminologies • Confusion Matrix • Evaluation Methods Unit Reflection

393 399 406 410 417

Assertion Reasoning Questions Competency-Based Questions

List of Practicals Viva-Voce Questions

Part C • Practical Work

421 428

438 442

Part D • Project Work

Projects 447

Sample Paper 1 Sample Paper 2 Answer Key to Assessment

** Note: These chapters are optional as per the CBSE syllabus and may not be covered in assessments.

viii

451 457 464


Part-A

Employability Skills


Unit 1 • Communication Skills II

1 Methods of Communication

C

ommunication is the process of transmitting information from one individual or group to another, using various methods and media.

People talk, write, or show visuals to communicate information about their ideas, thoughts, feelings, or send other messages to each other. Communication is a fundamental aspect of human interaction and is essential for acquiring knowledge and developing relationships. Communication can be interpersonal, i.e., between two people: communal (within a group) or broadcast (one person to multiple people or groups). Good communication does not only mean sending a message, but also making sure others understand what is being said or shown. In this chapter, we will learn about the various types of communication, their functions, and their use in our daily lives. Three Forms of Communication Forms of Communication

Verbal

Non-verbal

Visual

Did You Know? Pigeons were used as messengers in ancient times. Messages were written on paper and attached around the necks of pigeons who were trained to send and receive messages. Even in the inaugural Olympics in ancient Greece, pigeons were used to send information about the results to an athlete’s home town.

3


Verbal Communication

Verbal communication is the process of transmitting ideas and information about thoughts, feelings, ideas, and messages to another person. Ideas and information can be expressed through the use of words. Verbal communication is a vital aspect of human interaction, enabling individuals to convey ideas, build relationships, and function effectively in both personal and professional settings. We use verbal communication to tell stories, ask questions, and share thoughts. We also write down to explain or pass any information. For example, when you talk to your friends, family, or teachers, you are using verbal communication to share what is on your mind. Verbal communication can be further divided into four major categories: 1. Oral communication 2. Written communication

Remember

Improving oral communication takes time. Be patient with yourself and keep practicing. The more you practice, the more comfortable and skilled you will become at talking and sharing your thoughts with others.

3. Intrapersonal communication 4. Interpersonal communication

Type of Verbal Communication

Oral communication

Explanation

Examples

It is a form of verbal communication that involves transmitting information through spoken words and sentences. It is the most common medium of communication. Effective oral communication is a two-way process, which includes speaking and listening. Mechanical devices such as a telephone, loud speakers, or tape recorders can be used to communicate messages orally. It also includes attending lectures, classroom teaching and learning, and giving presentations in a meeting. When communicating orally, the speaker needs to give clear, concise, and complete information.

A conversation with a friend, family, or a colleague while giving a presentation or speech are examples of oral communication.

(continued...)

4


Type of Verbal Communication

Explanation

Examples

Written communication

It is a form of communication using written words. It is a formal and structured mode of communication that uses a written language to record and transmit information. It involves using symbols such as alphabets and numbers to create messages that others can read. It is a more reliable source of communication than speech. Written communication is used extensively for official work. It creates a permanent record that can be referred to and reviewed over time. Such communication is valuable for documentation, legal, and maintaining historical records purposes.

Writing an email, letter, or writing on the social media, writing reports, articles, etc.

Intrapersonal communication

Intrapersonal communication is an essentially private communication that happens entirely within our own minds. It is defined as a dialogue with oneself. It occurs when one reflects on situations, makes choices, or analyses one’s emotions and thoughts. This type of communication also involves rehearsing a dialogue or speech within their mind or writing a personal diary.

Writing about one’s innermost thoughts, feelings, and emotions in a diary; debating with oneself about a choice or a situation.

Interpersonal communication

Interpersonal communication takes place when individuals effectively interact, exchange information, and connect with others in various personal, social, and professional settings. It involves two or more people. It is a one-on-one conversation in which the individuals are constantly changing their roles as the sender and the receiver.

Board meetings, discussion between friends, team meetings, group discussions, etc.

Interpersonal Communication Is Further Divided Into: Type of Interpersonal Communication

Explanation

Examples

This type of communication occurs when two people interact with each other.

A special talk between two friends or two people working together. They take turns between talking and listening, and it is a bit more personal and private than talking in a big group.

It is the process of exchanging ideas, information, and opinions among a small number of people who are working together or discussing a specific topic. Each participant takes part in the discussion.

Study groups, board meetings, press conferences, and team meetings.

It is a form of communication where an individual addresses a larger audience. This communication involves delivery of information, ideas, opinions, or messages to a group of people, usually in a structured and organized manner.

A speech delivered by a politician or a leader in a meeting.

Face-to-face communication

Small group communication

Public communication

Chapter 1 • Methods of Communication

5


Advantages of Verbal Communication

1. Helps in Understanding: When we talk to each other, we can quickly explain things and understand each other better. If we are confused, we can ask questions right away to clear things up. 2. Effective Sharing: Verbal communication helps us share how we feel. Our tone of voice can show if we are happy, sad, excited, or angry. This communication helps others know how we are doing. 3. Reduce the Likelihood of Misunderstandings: When we express our thoughts and receive feedback quickly, there are very less chances of misunderstanding. 4. Reach a Larger Audience: Through verbal communication, we can reach a large number of people and convey our message. 5. Building Rapport: Verbal communication fosters connections and builds rapport among individuals. Engaging in meaningful conversations helps establish and strengthen personal and professional relationships. 6. Negotiating and Convincing: It is useful when you are trying to agree on something or get others to see things your way. 7. Social Interaction: In social settings, conversations and verbal exchanges are fundamental for networking, socializing, and building social connections.

Tips to Improve Verbal Communication

1. Practice speaking every day with as many people as you can. 2. Practice good listening skills when the other person is speaking to you. 3. Speak slowly and use clear words so that your ideas are conveyed easily. 4. Use gestures while talking, and maintain eye contact, tone, volume, and pace. 5. Plan what you want to write and speak ahead of time. 6. Proofread your writing, before you deliver it. 7. Record your speech so that you can later analyse how you are speaking. 8. Stay confident while speaking. 9. Be clear and simple so that your idea reaches everyone.

10. Use appropriate vocabulary and sentence structure in your writing.

Non-verbal Communication

Non-verbal communication refers to the messages and information that are conveyed without using words or spoken languages; it includes expressing thoughts, ideas, and feelings through gestures, facial expressions, and body language. Non-verbal communication can effectively convey thoughts, emotions, and feelings even though no words are used. Non-verbal communication is important in the classroom and at professional places because it helps understand the mood and thoughts of another person.

6


Types of Non-verbal Communication Type

Explanation

Examples

Gestures are intentional and often include symbolic physical movements, postures, or actions made by individuals, using their hands, arms, or other parts of the body.

Showing your palm when you want to stop something.

Gestures

We use our body parts to express our thoughts. Various cultures may have unique interpretations for some gestures.

Facial expression

Facial expressions are perhaps the most noticeable form of non-verbal communication.

Raising an eyebrow when you are not sure about something.

They include smiles, frowns, raised eyebrows, and other movements of the face.

Opening your mouth wide to show how surprised you are.

Eye contact refers to the act of individuals making direct visual connection by looking into each other’s eyes during a conversation or interaction. It involves using eyes to express, thoughts, or indicate attentiveness, interest, or disinterest.

Touch

Nodding your head when you want to confirm something.

It is when we use our faces to show our emotions and feelings such as sadness, happiness, confusion, or anger.

These expressions play an important role in expressing your thoughts. Eye contact

Showing numbers through your fingers.

Touch, as a form of non-verbal communication, involves physical contact among individuals, using various parts of the body, typically the hands or other body parts like the shoulders or back. Touch is a powerful means of conveying emotions, feelings, and intentions. It can have both positive and negative connotations, depending on the context and cultural norms.

Smiling to show you are happy.

Opening eyes wide indicates surprise. Looking into the speaker’s eyes indicates attentive listening.

A pat on the back or a reassuring hand on the shoulder can communicate empathy and support. A friendly handshake or a high-five can signify camaraderie and positive social interactions.

Space Space refers to the physical distance between two people. It plays a significant role in conveying messages and establishing relationships.

Space can include standing close to someone to indicate intimacy or maintaining distance to signal respect for personal boundaries.

(continued...)

Chapter 1 • Methods of Communication

7


Type

Explanation

Examples

Paralanguage is a term used to describe the non-verbal elements of spoken communication that accompany speech.

For instance, a high-pitched, fastpaced voice may indicate excitement or nervousness, while a slow, lowpitched voice can convey seriousness or sadness.

Paralanguage

This includes the tone, pitch, volume, and speed of your voice.

Posture

Posture refers to the position and alignment of an individual’s body, including how they hold their head, torso, arms, and legs. It is a fundamental element of nonverbal communication and can convey a lot of information about a person’s emotions, attitudes, and intentions.

Leaning forward or tilting the head slightly can indicate interest and engagement in a conversation or an activity. A slouched or hunched posture can convey timidity, insecurity, or submission.

Tips to Practice Non-verbal Communication During an Interview 1. Facial Expression: Make sure that you look confident. Smile when needed and avoid showing too many expressions, such as confusion or fear on face. 2. Body Language: Always sit and stand straight. Do not bend because that can show tiredness or boredom. 3. Gestures: Gestures can be used to show affirmation while expressing yourself, but make sure that you do not move your hands. Always keep your hands straight on your lap or in a cross position. Never talk to anyone with your hands in the pockets. 4. Eye Contact: Always make eye contact with the other person. Never talk with your eyes down or never roll your eyes.

Advantages of Non-verbal Communication

1. Making Messages Clearer: It adds extra information to what you are saying with words. For example, you can nod your head while saying “yes” to make it clearer that you agree. 2. Quick Communication: It can be faster than talking. For example, you can signal “stop” with your hand without saying a word and people will understand. 3. Building Trust: It helps build trust and connection with others. When you look at them in the eyes or shake hands, it shows you are friendly and trustworthy. 4. Conveys Emotions and Feelings: Non-verbal communication is a powerful tool for expressing emotions and feelings. Facial expressions, body language, and the tone of voice can convey happiness, sadness, anger, fear, and other emotions, often more vividly than words alone.

8


5. Support Verbal Communication: Non-verbal cues can complement, enhance, and reinforce verbal messages. These cues can help make the overall communication more effective and easier to understand. 6. Helpful for People with Disabilities: They can use gestures to convey their ideas and thoughts. Let us see how we can use verbal and non-verbal communication in our daily life. Salesperson: (with his hands folded, smiling and in a very soft tone) Good morning, madam! How can I help you? Customer: Good morning! I want to buy a washing machine for my home. Salesperson: (smiling widely) Oh! That is great, madam. We have many options available for washing machines. Which machine are you looking for, semiautomatic or automatic? Customer: (looking confused) Umm! What is the difference between the two? Salesperson: (pointing towards a machine) Madam, a semiautomatic machine washes clothes on its own, but you need to take out clothes and dry them separately in the dryer, so it requires a little more effort. Whereas, an automatic machine does not require your efforts, you just need to put clothes in it and start it. It will wash and dry them on its own. Customer: (opening her mouth wide) Wow! That is a major difference. Then, I would like to buy an automatic washing machine. Salesperson: (shaking his hands with the customer) Great choice, madam! Let us go to the billing department.

Visual Communication

Visual communication is the process of providing information, data, ideas, and thoughts through visuals and graphics. This type of communication uses only images, graphs, charts, videos, presentations, and other graphics to convey the message to other people or organisations. Visual communication remains the oldest form of communication as even before speaking, people used to provide information through symbols and pictures. All the ancient scripts are written in symbols and provide us with information about those times. It is the most effective way of passing information, as the human mind processes images quickly. Verbal communication can be made more effective and meaningful with the use of visual aids like posters, signs, diagrams, and images. Example: A speaker is conducting a seminar on ‘Following Road Safety’. His ideas and messages would be clearly communicated and perceived if he used standard signs related to traffic rules while communicating.

Chapter 1 • Methods of Communication

9


Examples of Visual Communication

Under Construction

No Pets Allowed

No Parking

No Spitting

Food Not Allowed

No Camera or Mobile phones

Advantages of Visual Communication

1. Easy to Understand: Pictures make things simpler to understand, especially if the topic is complicated. They allow for the presentation of data and concepts in a clear and concise manner. 2. No Language Barrier: You don’t need to know a specific language to understand a picture. It’s like a universal language. 3. Easier to Remember: Visuals are often more memorable than text alone. People tend to retain and recall visual information better. 4. Keeps You Interested: Pictures and videos can keep your attention better than long paragraphs of text. 5. Quick Information: Visuals can convey information quickly. A well-designed infographic, for example, can convey a complex message in much less time than it would take to read a lengthy document. 6. Helps in Making Choices: Visuals can help you make decisions, especially when comparing different options. 7. Accessible to Everyone: Visuals can be adapted for people with disabilities, like those who can’t see well.

10


Difference Between Verbal, Non-verbal, and Visual Communication Aspects

Verbal

Non-verbal

Visual

Definition

Information is shared in the oral or written form, using words.

Information and ideas are shared without words, using body gestures, space, or eye contact.

Information is shared through visuals, images, and graphics.

Usage

The best way to express thoughts in small and large groups, interpersonally.

It is used to express emotions and feelings. It is mostly used to supplement verbal communication.

It is suited for sharing information with versatile groups at a mass level.

Types

Written or oral.

Body language, facial expressions, gestures, and eye contact.

Graphics, visuals, images, videos, and symbols

Advantages

It is helpful for long discussions and for expressing thoughts in detail.

It saves time and expresses emotions directly.

It is a universal language and can be understood by everyone.

Disadvantages

It is time-consuming, and the wrong selection of words may lead to confusion.

It becomes difficult to get detailed information through non-verbal communication.

Some information cannot be explained through visuals and requires detailed explanation.

Examples

Letter, e-mail, speech, group discussions, etc.

Eye contact, posture, hand movements, etc.

Road signs, emoticons, etc.

ActivityTime Time Activity Activity 1: Pros and Cons of the Methods of Communication

(Group Work)

In a group of four to five students, discuss the three methods of communication. Highlight the advantages and disadvantages of all the three methods.

On an A3 size sheet, list down the pros and cons of the three methods of communication. When participating in a discussion, be an attentive listener and respect others’ opinion. Activity 2: Role Play—Common Body Language Mistakes

(Group Work)

Get into a small group of four-five students. Choose any one of the scenes of communication from daily life. Prepare a role play using verbal and non-verbal communication. Show a character using the wrong body language and the impact of the same on the other characters and the overall communication.

At the end of your performance, specify the common body language mistakes and the dos and don’ts of avoiding miscommunication because of the body language.

Encourage the other students in the class to list down the dos and don’ts of miscommunication because of body language. Scenes

1. Conversation at restaurant between a waiter and customer 2. Conversation between a salesperson and customer 3. Conversation between a teacher and student 4. Conversation between a parent and child 5. Conversation between friends at park

Chapter 1 • Methods of Communication

11


Chapter Checkup A Select the correct option.

1 Which of the following is an example of visuals?

a E-mail b Speech c Eye contact

d Graphics

2 If we are using hand gestures to deny something, then which of the following are we using? a Verbal communication c Visual communication

b Non-verbal communication d All of these

3 Which of the following is not an advantage of verbal communication? a It helps in understanding. c It reaches a larger audience.

b It helps in effective sharing. d It does not use words.

4 Which of the following can be used to communicate with one or many individuals living at various locations? a Face-to-face conversation

b An email

c Posters d Diary entry

B Fill in the blanks with the most suitable words. 1 2

,

, and visual are the three methods of communication.

is used to describe the non-verbal elements (tone, pitch, and volume) in a spoken communication that accompanies speech.

3 Eye contact is an example of

.

4 While talking to someone, we should always use

to explain it better.

C State whether the following statements are True or False. Correct the statements that are false.

1 Use of non-verbal and visual communication for a verbal message makes the communication more complex. 2 Graphics are examples of non-verbal communication.

3 Communication is the process of exchanging information, ideas, thoughts, and feelings. 4 Symbols are the oldest form of communication. D Answer the following questions. (Solved) Q1. What is communication?

A1. Communication is the process of transmitting information from one individual or group to another, using various methods and mediums. People talk, write, or show visuals to communicate information about their ideas, thoughts, feelings, or send other messages to each other. Communication is a fundamental aspect of human interaction and is essential for acquiring knowledge and developing relationships.

Communication can be interpersonal, i.e., between two people; communal (within a group); or broadcast (one person to multiple people or groups). Good communication does not only mean sending a message but also making sure others understand what’s being said or shown.

Q2. What are the three methods of communication? A2. There are three methods of communication:

Verbal communication: Verbal communication is the process of transmitting ideas using information about thoughts, feelings, ideas, and messages with another person. Thoughts can be expressed through the use of words. We speak to each other to tell stories, ask questions, and share thoughts. We also write down to explain or convey any information. Examples: Writing an email, group discussions, public speaking, etc. Non-verbal communication: It is the process of expressing thoughts and messages without using words. Non-verbal communication includes gestures, body language, eye contact, and postures to convey feelings.

Examples: Using eye contact to accept or deny something, using hands to show numbers, etc.

12


Visual communication: Visual communication is the oldest form of communication; it includes symbols and graphics to communicate. It is less time-consuming and helps people understand things even if they are not familiar with the language. Any person can understand the symbols and pictures, and can easily find out the meaning.

These three are the methods of communication, which helps us in our day-to-day life and make communication easier. Q3. Mridul is a student of class 10. He needs to take a workshop on ‘Say No to Bullying’. He has prepared his speech for the workshop. His friends have been advising him to use visual aids to make his presentation more impactful, but Mridul is not convinced. If you were Mridul’s friend, what would you say to convince him into using visual aids to communicate his message? A3. If I were Mridul’s friend, I would state the advantages of using visual communication as a support to the verbal message that he would be using during his workshop. I would try to make him understand that his speech can be made more effective and meaningful with the use of visual aids like posters, signs, diagrams, images, and so on.

• Easy to understand: Pictures make things simpler to understand, especially if the topic is complicated. They allow for the presentation to be clear and concise. • Easier to remember: Visuals are often more memorable than the text alone. People tend to retain and recall visual information better. • Keeps you interested: Pictures and videos can keep your attention better than long speeches.

• Quick information: Visuals can convey information quickly. A well-designed infographic, for example, can convey a complex message in lesser time. • Helps in making choices: Visuals can help you make decisions, especially when comparing multiple options.

Answer Key A 1. d

2. b

3. d

B 1. Verbal, non-verbal

4. b 2. Para-language

3. Non-verbal communication

4. gestures

C 1. False. Use of non-verbal and visual communication for a verbal message makes the communication more effective. 2. False. Graphics are examples of visual communication. 3. True. 4. True.

Chapter 1 • Methods of Communication

13


Unit 1 • Communication Skills II

2 Understanding Feedback T

he art of communication involves more than selecting the right words or mediums. Communication is a dynamic process that encompasses not only the transmission of information but also the reception, interpretation, and response to that information. Thus, it is important for us to delve into an understanding of the elements within the communication cycle, as well as acknowledge the crucial role that feedback plays within it.

Communication Cycle

Communication is the process of transmitting information from one source to another through messages using the mediums of speech, writing, gestures, visuals, or symbols. We have an English test tomorrow. I thought I would inform you as you were not in class today.

Tests are a useful tool for understanding what you have already learnt. Do not worry about it, please. You will do well, I am confident.

Thank you for informing me about this.

Thank you for believing in me. Your confidence in me helped me overcome my stress and do well in the test.

Okay, I will try not to worry.

14

You’re always welcome.


These examples serve as an illustration of the communication process, in which one person, known as the sender, sends a message to another person (or group of people), known as the receiver. When the receiver receives the message, they usually acknowledge it in two ways, either verbally, as illustrated in the above examples, with a sound like “hmm”, or non-verbally, for example, with a nod. This acknowledgement can be termed as feedback. Feedback assures the sender that the message has been received as intended and completes the cycle of communication.

Elements of a Communication Cycle Sender

A sender is a person who initiates a communication by creating and sharing a message with the intention of conveying information, ideas, or thoughts to another person or a group.

Message

A message refers to information, ideas, or thoughts that a sender wants to communicate to a receiver. The message can be in the form of spoken or written words, images, gestures, or any other means of expression.

Encoding

Encoding is a process of converting a sender’s thoughts and ideas into a form that can be understood by others. This process involves choosing relevant words, arranging sentences, and using symbols to create a message that can be effectively transmitted.

Channel

A channel is a means or method through which a message is transmitted from a sender to a receiver. The channel can include verbal communication, written communication, visual presentations or electronic mediums, like email or video calls.

Receiver

A receiver is an individual or a group who receives and interprets a message sent by a sender. The receiver is responsible for understanding and making sense of the information conveyed.

Decoding

Decoding is a process by which a receiver interprets and understands a message sent by a sender. This process involves analysing the words, symbols, and context to derive the intended meaning.

Feedback

Feedback is the response or reaction provided by a receiver to a sender’s message. This response helps the sender understand the effectiveness of their communication and whether the intended message was understood accurately.

Communication Cycle

It is important for effective communication that the sender encodes the message and the receiver decodes the message in the manner it is intended. Encoding means that the sender shares information in a way that is understandable to the receiver, such as using a shared language understood by both the sender and the receiver. Decoding means that the receiver accurately understands the meaning of the information sent by the sender. Chapter 2 • Understanding Feedback

15


Look at the illustration of communication cycle. It shows a communication cycle which involves a sender and a receiver of information. The sender encodes the message and sends it to the receiver who decodes the message and responds to it appropriately. The effectiveness of a communication cycle depends on how long it takes for the feedback to be received by the initial sender. In general, the faster the response, the more effective the communication cycle is.

Hello, I am Amit.

Hi Amit, nice to meet you.

The sender or receiver of the information needs to take the necessary time to analyse the information being transmitted to them in order to respond faster. The following examples illustrate this: Example 1 Imagine that your teacher assigns you a challenging math problem-solving exercise. The instructions are to carefully read the problem and then solve it step by step. The correct approach will be to follow your teacher’s instructions, read the problem carefully, analyse the given data, and solve the problem step by step. However, if you are impatient or overconfident, you may skip the reading part and immediately start attempting the problem. Because of this, you may find yourself struggling to grasp the problem’s requirements and end up making mistakes in your calculations. This will eventually take you more time to rectify the errors.

Example 2 Your manager Rakesh has assigned you a complex report to analyse and provide insights on. He has instructed you to thoroughly review the report, extract relevant data, and then offer your analysis. The correct approach will be to follow your manager’s guidance and manage your time well to finish the task appropriately. However, if you are not provided sufficient time and are assigned a tight deadline, you can end up skimming through the report quickly and immediately starting with your analysis. Unfortunately, without a clear understanding of the report’s content, your insights may lack depth and you may even misinterpret some data. These issues will force you to revise your work multiple times and spend more time than expected. Both the examples showcase the importance of taking time to understand and process the information properly before responding. Therefore, for a communication to be effective, the feedback should be timely and appropriate.

Feedback

Error Alert! It is a misconception that immediate feedback is always better. Effective feedback requires thoughtful interpretation and understanding.

Feedback is a crucial element of a communication cycle. It is the response or reaction of the receiver upon perceiving or understanding the message. By receiving the receiver’s response, the sender gains understanding which leads to further actions, thereby completing the communication cycle. Feedback allows the roles of sender and receiver to be interchanged.

16


Let us understand this with the help of the following examples: Example 1 Raj has written a creative story and has shared it with his classmates. They offer their thoughts and opinions on his story’s characters, plot, and overall theme. Their responses and suggestions help him in understanding how his writing is being perceived and guide him in making improvements.

Example 2 Tina presents a new idea during a brainstorming session at her workplace. Her colleagues listen attentively and then provide their insights and suggestions on how the idea can be implemented. Their feedback helps her refine her idea and consider various angles for its execution. In each of these examples, feedback is the response or input received from others after conveying something, whether it is a piece of writing, an idea, a performance, or a project. This feedback is essential for understanding the effectiveness and impact of your communication and making necessary adjustments to improve its quality. Let us break down these examples into the elements of the communication cycle—the sender, receiver, feedback, and future action: Example

Sender

Receiver

Feedback

Future Action

1

Raj

Classmates

Opinions and suggestions on creative writing

Makes improvements to the story based can be rephrased.

2

Tina

Colleagues

Insights and suggestions on the implementation of her idea

Refines the idea and explores various aspects.

Feedback can be negative or positive. Understanding various types of feedback allows us to refine our communication and life skills.

Positive Feedback

• Positive feedback is an indicator to the sender of the message to continue following the mode of the communication. • It helps increase the confidence of the sender and motivates the person to excel. • For example: “The speech was outstanding. Keep it up!”

Negative Feedback

• Negative feedback is an indicator to the sender of the message that there is a need to modify or change the mode of communication as their ideas are not being communicated effectively. • This may lower the sense of self-esteem and morale of the sender.

• For example: “The pace was too fast to understand. I wish you went a little slow and understood the needs of your audience”.

Both positive and negative feedbacks provide valuable insights for enhancing communication. Positive feedback encourages you to continue with the effective methods, whereas negative feedback requires adjustments for better clarity and comprehension.

Think and Tell Think of the last time you received feedback, and it helped you to improve the quality of your work.

Importance of Feedback

Feedback is an important component of effective two-way communication. Feedback needs to be heard, interpreted, and accepted for ensuring that the process of communication is smooth and clear. The sender gets an opportunity

Chapter 2 • Understanding Feedback

17


to assure that his message was received as intended. Feedback is also essential to fill any gaps between what is understood and what the actual aim was. Example 1 Imagine that your friend Rashmi is explaining a complex science concept to the entire class. As she proceeds, she senses some confusion among her classmates and asks if they need further clarification. Their questions and responses provide her with feedback that the concept needs more explanation, prompting her to simplify her explanation and provide additional examples. These are various ways in which feedback is important: Ways in Which Feedback Is Important

Why and How?

Example

I magine that a sales team is presenting the Annual Sales Report to all their colleagues. There were a lot of numbers When feedback highlights these gaps, it helps and percentages involved which resulted individuals recognise where their message may not in a lot of confusion and ambiguity. have been clear or well-received. Seeing such confused responses of This insight becomes a starting point for problemtheir colleagues, the sales team took solving as the receiver of the feedback can address corrective measures and addressed their these issues and find ways to convey information more colleagues’ all queries. effectively. eedback acts as a valuable tool for identifying areas F of confusion or misunderstanding in communication.

Basis of problem-solving

eedback encourages effective listening as it provides F an immediate indication of whether the message was accurately received and comprehended by the audience. Effective listening

hen someone receives feedback that aligns W with their intended message, it signifies that their communication was successful.

n the other hand, if the feedback indicates confusion, O it prompts them to reevaluate their message and make necessary adjustments.

Motivation

Performance improvement

ositive feedback can be a powerful motivator. When P someone receives praise for their communication skills, it boosts their confidence and encourages them to continue using effective methods of communication.

hen a student confidently presents W their research in the classroom and receives applause from their peers and teachers, they feel motivated to keep creating such presentations and enhancing their skills.

eedback can be valuable for improving the F performance and communication skills of an individual. Feedback includes inputs, suggestions, and areas of improvements which are helpful to achieve better results.

I f a student delivers a speech and receives feedback that their voice projection needs improvement, they can work on their voice modulation techniques to engage the audience more effectively.

hink of a student who participates in an T elocution competition for the first time. After their speech, they receive feedback When people receive feedback, they learn about their areas of improvement. This process helps them stick to from the teacher about the structure and their goals and continue learning, and gives them new delivery of their content. This feedback will help them improve for future events opportunities. and competitions. eedback fosters a culture of learning by enabling F individuals to adapt and grow based on external input.

Tool for continued learning

18

I magine a student explaining a historical event to their classmates. If their classmates respond with relevant questions and thoughtful comments, it shows that the message was well understood. On the other hand, if the classmates are puzzled, the student knows they need to provide more context or clarification.


Therefore, feedback plays a vital role in shaping effective communication. Feedback helps identify communication gaps, promotes active listening, boosts motivation, drives performance improvement, and supports continuous learning. Through feedback, individuals can refine their communication skills and enhance their ability to convey ideas clearly and convincingly.

Think and Tell 1. How does effective feedback contribute to improving communication? 2. Can you provide examples of situations where effective feedback can make a significant impact on the outcome?

Descriptive Feedback

Descriptive feedback is detailed and specific input provided to an individual, focusing on their strengths and areas for improvement in their communication or work. Such feedback goes beyond generic statements, offering actionable insights that facilitate growth and enhancement. Descriptive feedback includes specific information in the form of written comments or verbal conversations that help the receiver of the feedback understand what all improvements can be made in their work. Letter grades, number grades, or coded symbols do not fall under the purview of descriptive feedback. Example 1 Imagine you have given a presentation in a class about one of the chapters of this book. Instead of merely saying, “Good job on the presentation”, your teacher provides descriptive feedback by telling you the ways in which you can enhance the engagement by incorporating more visuals and pictures to support your points. Feedback is highly important for students’ learning. It helps the students understand their current strengths and weaknesses and offers suggestions to enhance their performance. Moreover, feedback provides guidance and assists students in recognising the necessary steps to reach their goals and objectives.

Benefits of Descriptive Feedback Benefit

Provides useful information

Fills gaps between the present level of performance and the learning outcome

Meaning

Example

If you have written an essay for your English class, descriptive feedback highlights the strengths of your essay, such as strong arguments and clear Descriptive feedback goes beyond just indicating organisation. It also points out areas whether something is right or wrong. Such feedback offers specific details about what is done well and what that need improvement, like using more varied vocabulary or adding more can be improved. examples. This information helps you understand exactly what you are doing right and what needs further attention.

Descriptive feedback acts as a bridge between where you currently stand in terms of your performance and where you aim to be.

Imagine you are learning to play a guitar. Your goal is to play a specific song flawlessly. When you perform the song in front of your music teacher, they provide you with descriptive feedback. They may mention that your chord transitions are mostly correct, but there is a specific section where your timing is slightly off. This feedback highlights the gap between your current performance level and your goal of playing the song perfectly. (continued...)

Chapter 2 • Understanding Feedback

19


Benefit

Self-assessment

Meaning

Example

Detailed feedback encourages you to take ownership of your learning journey. When you receive descriptive feedback, you can reflect on it and assess your own work. This self-assessment process empowers you to recognise your strengths and areas for improvement.

If you have participated in a group project and your teacher provides descriptive feedback on your contribution, you can use that feedback to evaluate your role in the project objectively. This self-awareness allows you to take steps to enhance your performance in future projects.

In essence, descriptive feedback not only tells you what is working and what is not, but also guides you on how to bridge the gaps and refine your skills. It is like having a personalised roadmap for improvement that empowers you to take charge of your own learning and growth.

Essential Factors of Descriptive Feedback

The following factors should be considered to make descriptive feedback effective: Goal-oriented

Feedback should align with the intended learning objectives or communication goals.

Actionable

It should provide actionable steps for improvement, suggesting specific strategies or changes.

User-friendly

Feedback should be easy to understand and easily comprehensible. Avoid use of complex language.

Timely

Giving feedback on time ensures its relevance and impact on the receiver’s work or communication.

Continuous

Regular feedback fosters a culture of ongoing improvement and learning.

Consistent

Consistency in providing feedback ensures fairness and enables tracking of progress over time.

The effectiveness of feedback is based on its quality. Feedback must be task-oriented so that students can hone their abilities, re-engage in their studies, and focus on their objectives.

Specific and Nonspecific Feedback

Error Alert! It is a misconception that feedback is only about pointing out mistakes. Feedback also highlights strengths and provides suggestions for improvement.

Feedback

Specific Feedback Focuses on exact aspects of the performance or work and offers concrete suggestions for enhancement.

20

Nonspecific Feedback Nonspecific feedback lacks detail and fails to pinpoint areas for improvement, making it less actionable.


Specific Feedback

1. It gives elaborate information on exact aspects of communication or performance and offers substantial suggestions to the receiver. 2. It is advantageous because it provides the receiver directly with valuable points to consider and enables them to focus on the areas that need improvement. 3. But most individuals hold back their feedback to prevent a defensive response. 4. Feedback can significantly alter a person’s attitude or performance if it is offered with appropriate intentions. 5. To ensure that others accept and value your feedback, it is important to be courteous and clear with it. 6. In other words, the power of specific feedback is like having a treasure map for improvement! If you have just shown your awesome project to a friend. They tell you, “Wow, it’s great!” That is nice, but it would be even better if they said, “Your project’s visuals were super engaging, especially the colourful charts. To make it even cooler, you can add captions for all the pictures you included in it”. See the difference? When feedback is given with care and good intentions, it can work wonders. The following are the appropriate examples of specific feedback. Example 1 After Ali finished his presentation, his teacher praised him by saying, “The introduction of your presentation effectively captured the audience’s attention with a thought-provoking question”. Example 2 During a science fair, Asma’s classmate, Mohit, looked at her work and remarked, “Your analysis of the data was thorough, but it can be supported by relevant examples”.

Nonspecific Feedback

1. It lacks the necessary details to guide someone on how to enhance their performance or work. 2. It is less helpful because it does not highlight specific strengths or areas that need improvement. 3. It is vague and does not guide the receiver directly about the aspects which require his immediate attention. The following examples illustrate the concept: Example 1 After Shruti finished her speech, her friend Aarushi commented, “Good job on the presentation”. While Aarushi meant well, her feedback did not provide specific insights into what parts of the presentation were effective or how Shruti can further enhance the less effective parts.

Example 2 When Maya shared her essay with her teacher, Mr. Rajesh, she received the remark, “Your writing needs improvement”. Although Mr. Rajesh’s intention was to help, his feedback did not specify which aspects of Maya’s writing needed enhancement. As a result, Maya found it challenging to know where to focus her efforts to make her writing better.

Chapter 2 • Understanding Feedback

21


Need for Specific Feedback

The importance of specific feedback in various contexts, including education, workplace, and personal development, cannot be overstated. 1. Clarity and Precision: Specific feedback provides clear and precise information about what was done well and what requires improvement. 2. Give Guidance to Act: Specific feedback not only points out areas for improvement but also provides details on how to make those improvements. This guidance encourages individuals to take concrete steps towards better performance. 3. Enhanced Learning: In educational settings, specific feedback aids learning by highlighting strengths and weaknesses. Learners can focus their efforts on specific skills or concepts that require improvement, leading to more effective learning and skill development. 4. Motivation: When individuals receive recognition for their specific achievements, it boosts their self-esteem and confidence, encouraging them to continue working on their goals. 5. Goal Setting: Specific feedback plays a key role in motivating an individual in setting and achieving goals. Such feedback helps individuals set realistic goals by identifying areas in which they need to grow or improve. 6. Performance Improvement: In the workplace, it is essential for employee development and performance improvement. 7. Makes one Responsible and Accountable: Motivated and encouraged individuals take full ownership of working towards their goals and improving performance. 8. Effective Communication: Specific feedback contributes to effective communication. It minimizes misunderstandings and misinterpretations by providing precise information, ensuring that messages are conveyed accurately. 9. Self-Reflection: Specific feedback encourages self-reflection. Recipients can assess their performance in a more objective manner and gain insights into their strengths and areas for growth. 10. Continuous Improvement: Specific feedback aligns with the principle of continuous improvement. Such feedback fosters a mindset of always seeking ways to get better and achieve higher standards.

Activity Time Activity 1: Enhancing Feedback Skills (Pair Work & Class Discussion) In a pair, reflect and write on what you have learnt from this chapter. Write down your understanding of the key concepts and note something new that you have discovered. Then, swap your written reflections with your partner.

Next, read through your partner’s reflection and consider their insights. Craft a paragraph of specific and descriptive feedback for them based on their write-up. Focus on highlighting their strengths and providing suggestions for improvement.

Now, share the feedback that you have received from your respective partner to the whole class. Listen to the other feedbacks shared in the class and take notes.

Activity 2: Feedback Sandwich (Pair Work) In pairs, students will prepare and present a one-minute speech on a topic of their choice. The partners will provide feedback sandwich after the presentation. Each feedback session should include three components: • Positive Comment (Compliment): Start with a positive comment or praise related to the topic.

22


• Constructive Feedback (Critique): Offer specific, constructive feedback on what can be improved or what needs attention. • Positive Comment (Encouragement): End with another positive comment or words of encouragement. Topics for speech: Rising Global Warming, Climate Change, Sustainable City, or Electric Vehicle. Remember to focus on using the 7 Cs (Clear, Concise, Concrete, Correct, Coherent, Complete, and Courteous) when delivering the speech and while providing feedback. Switch the role and repeat the process.

Chapter Checkup A Select the correct option. 1 Feedback is important in communication because it: a delays the communication process.

b adds complexity to the message.

c encourages active listening and clarifies understanding.

d disrupts the communication cycle. 2 Descriptive feedback provides:

a general observations without details.

c letter grades and number grades.

b specific information on strengths and areas for improvement. d sudden and unexplained reactions.

3 Which of the following is an example of specific feedback? a “Your presentation was nice”.

b “Your essay needs improvement”.

c “Your use of visuals enhanced the impact of your presentation”.

d “You did well overall”.

B Fill in the blanks with the most suitable words. 1 In the communication cycle, the sender 2 3

the message, whereas the receiver

the message.

allows the roles of the sender and the receiver to interchange. encourages you to maintain effective methods, whereas clarity and comprehension.

4 Descriptive feedback helps learners understand their

prompts adjustments for better

and areas that need

.

C State whether the following statements are True or False. Correct the statements that are false. 1 Specific feedback offers concrete suggestions for enhancement. 2 Nonspecific feedback provides clear insights into strengths and weaknesses. 3 Feedback is not essential for improving communication skills. 4 Descriptive feedback focuses on general observations. D Answer the following questions. (Solved) Q1. Define specific feedback and explain why it is considered valuable in a learning process. A1. Specific feedback focuses on the exact aspects of performance or work and offers concrete suggestions for enhancement.

Chapter 2 • Understanding Feedback

23


Such feedback is considered valuable as: • It provides clear insights into what worked well and what needs improvement. • It guides the receiver to make precise adjustments to enhance their communication or work, ultimately leading to more effective outcomes. Q2. Elaborate on the five factors that are essential when providing descriptive feedback. How do these factors contribute to the effectiveness of the feedback process? A2. The five essential factors to be kept in mind when providing descriptive feedback are: • Feedback should align with the intended learning objectives or communication goals. • Feedback should provide actionable steps for improvement, suggesting specific strategies or changes. • Feedback should be easy to understand and easily comprehensible. Avoid the use of complex language. • Providing feedback on time ensures its relevance and impact on the receiver’s work or communication. • Regular feedback fosters a culture of ongoing improvement and learning. Q3. Rishika received her term end report card. She had been eagerly waiting for the day as she would get to read the feedback from her subject teachers. She performed exceptionally well in her term, and the teachers gave her feedback like ‘Good Job, Rishika!’, ‘Congratulations, Rishika’, and ‘Keep it up, Rishika!’. Though Rishika was happy, she was looking for something else in her feedback. What do you think was missing in Rishika’s feedback? Why is that missing element so important for students like Rishika?

A3. R ishika was disappointed as the feedback from her teachers lacked descriptive details. The feedback responses did not mention her strengths or the areas to work on. They did not provide her any way forward, which would help her improve herself and her performance in the future. Having descriptive feedback is significant for learners like Rishika because: • It acts as a bridge between where you currently stand in terms of your performance and where you aim to be. • Detailed feedback encourages you to take ownership of your learning journey. When you receive descriptive feedback, you can reflect on it and assess your own work. • It goes beyond just indicating whether something is right or wrong. It offers specific details about what was done well and what can be improved.

Answer Key A 1. c 2. b 3. c B 1. encodes, decodes

2. Feedback

3. Positive Feedback, negative feedback

C 1. True

4. strengths, improvement

2. False. Nonspecific feedback does not provide clear insights into strengths and weaknesses. 3. False. Feedback is essential for improving communication skills. 4. False. Descriptive feedback focuses on specific observations.

24


Unit 1 • Communication Skills II

3 Barriers to Effective Communication E

ffective communication is the process of exchanging ideas, thoughts, opinions, knowledge, and data so that the related messages are received and understood with clarity and purpose. When we communicate effectively, both the receiver and the sender feel content and satisfied. There are various methods of communication and all these methods of communication can only be effective if we follow the 7 Cs of communication, i.e., clear, concise, concrete, correct, coherent, complete, and courteous. Absence of any C can lead to miscommunication. Concise

Clear

Use simple words (say only what is needed)

Be clear in what you want to say

Coherent Words should make sense and relate to the main topic

Correct

Concrete Use exact words and facts

Use correct spelling and grammar

Complete

Courteous

Include all the needed information

Be respectful, friendly, and honest

The process of communication has multiple barriers. A communication barrier is an obstacle that prevents the receiver from receiving and understanding the message that has been sent by a sender. If the message has not been understood well, it can lead to gaps, causing confusion, misinterpretation, and misunderstanding. Thus, it is important for the communicator to ask for feedback or ask questions to check that the message has been understood clearly.

Think and Tell Think of a situation where you had to face a challenge in expressing your thoughts and feelings to your closed ones.

The barriers to effective communication can be of many types, like linguistic, physical, interpersonal, cultural, or organisational.

25


Types of Communication Barriers Linguistic Barriers 1. The language barriers are considered as one of the main and the most common barriers that limit the effective communication. 2. The inability to communicate using a language is known as the language barrier to communication. 3. All regions have their own language and not knowing them can lead to misunderstandings, misinterpretation, and miscommunication.

Did You Know? The concept of “Chinese Whispers” or “Telephone” is often used to illustrate how communication barriers can lead to misunderstandings. This game is known by various names around the world and has been played for centuries. It is a playful reminder of how easily miscommunication can occur even when sending a simple and short message, highlighting the importance of clear and effective communication in our daily lives.

4. Such barriers can occur because of limited vocabulary, problems related to accents and pronunciations, speech disorder, multiple meanings, and cultural references of symbols, and so on. 5. As per some estimates, the dialects of every two regions changes within a few kilometres. 6. For example: Even in the same workplace, each employee will have a unique linguistic skill. As a result, the communication channels within the organisation can be affected by this. Thus, keeping this barrier in mind, considerations must be made for various employees, as some of them can be fluent in a certain language, whereas others can be basic users of these languages. 7. Imagine a situation where two people, one who primarily speaks English and the other who primarily speaks Spanish, are trying to communicate without a common language: Rishi (English speaker): I need directions to the nearest hospital. Joseph (Spanish speaker): Hospital? Rishi: Yes, hospital.

In this scenario, Rishi is seeking directions to a hospital, but Joseph, who primarily speaks Spanish, has limited knowledge of English. The language barrier becomes evident when Joseph repeats the word “hospital” in English because he is unsure about how to provide directions or how to ask for more information in English. Physical Barriers 1. Physical obstacles such as distance, noisy environments, or poor audio quality can make it difficult to hear or understand each other. 2. These are obstacles or conditions in the environment that can hinder effective communication between individuals or groups. 3. Physical barriers can exist in the form of noise, distance, infrastructural barriers (wall, closed doors), visual distractions (flashing lights, overcrowded places), insufficient or poor lighting, technical issues (poor network connections, defective speaker, or microphones), and so on. 4. Natural conditions like physical disabilities (hearing impairment or poor eyesight) may also cause obstacle while communicating. 5. Example: Imagine a factory floor where workers operate with heavy machinery. The noise generated by the machines is extremely loud, making it difficult for the workers to hear each other or hear any verbal instructions

26


from their supervisors. As a result, crucial information regarding safety protocols, task assignments, or emergency procedures may not be effectively communicated due to the overwhelming noise. 6. Imagine a classroom where there is poor lighting. The students may have difficulty reading teachers’ written notes on the board or understanding their facial expressions. The lack of proper lighting becomes a physical barrier to effective teaching and learning. Interpersonal Barriers 1. An interpersonal barrier in communication refers to obstacles that arise because of the equation in the relationship between people, affecting the exchange of information and understanding. 2. It becomes difficult and challenging to communicate with a person who is not willing to listen, talk, and express their feelings and views. 3. Interpersonal barriers often arise from differences in personalities, perspective, communication styles, or behaviours. 4. Major interpersonal obstacles include ego, pride, stereotypes, lack of empathy, inactive listening, making assumptions, having preconceived notions, and emotional barriers (anger, fear, stress). 5. Example: Imagine two colleagues in a workplace who have a history of personal conflicts. Due to these conflicts, they have developed negative perceptions of each other. When they need to work on a project, their history and personal differences may hinder open and effective communication. They may misinterpret each other’s messages or be reluctant to share information, leading to incomplete and inaccurate communication. 6. Imagine a situation of a team working on a project. One member of the team insists on a particular way of achieving the goal and rejects other ideas. This closed-mindedness can create a barrier to communication and collaboration. Organisational Barriers 1. An organisational barrier refers to any obstacle or challenge within a company or institution that affects the effective flow of communication among individuals, teams, or departments. 2. These barriers can arise from factors such as hierarchical structures, inadequate communication channels, lack of transparency, conflicting goals, and differing priorities. 3. Organisational barriers can obstruct the timely and accurate exchange of information, leading to misunderstandings, decreased efficiency, and overall communication breakdowns within an organisation. 4. Example: If we see two colleagues working on a project and they face any challenges, it is important for them to communicate to their respective departments or supervisor, to ensure effective flow of communication. 5. Imagine a scenario where a subordinate feels shaky and nervous, fidgets when standing, and fails in communicating the message correctly. On the other hand, the boss is impatient and starts advising even before the subordinate has fully explained the case. Cultural Barriers 1. Our country is diverse and has rich culture. However, because of this richness, people find it difficult to understand each other’s culture and traditions which can result in inconveniences and difficulties. 2. Cultural barriers to communication arise from differences in cultural backgrounds, customs, norms, and values between individuals or groups.

Chapter 3 • Barriers to Effective Communication

Error Alert! Removing all barriers is possible! While it is essential to minimise communication barriers, it is unrealistic to expect that all barriers can be eliminated. Communication barriers can arise from various sources, including individual differences and external factors. The goal is to reduce obstacles and improve communication and not to eliminate all barriers entirely.

27


3. Not only this, there can also be stereotypical assumptions on the cultural differences that may lead to differences in opinion and can be a major barrier to effective communication. 4. Imagine an organisation that has offices in both the United States and Japan. The employees from the US are used to expressing their opinions, agreements, and disagreements openly during meetings. On the other hand, the employees from Japan are more reserved and tend to avoid contradicting their superiors in public. During a joint video conference, the American team proposes an idea, and some Japanese team members have concerns. However, due to their cultural norms, the Japanese team members hesitate to voice their reservations, leading the American team to believe that everyone is on board with the idea. In this scenario, the cultural difference in communication styles creates a barrier.

Factors Contributing to Communication Barriers

Lack of Clarity Unclear or incomplete messages can lead to confusion, misunderstanding, and misinterpretation. Thus, it is extremely important for a sender to send clear and concise messages. Lack of Feedback Without feedback or confirmation, a sender will not know if the message was understood correctly or not. Effective communication includes continuous feedback. In the absence of any feedback, the sender may never feel the need to make necessary adjustments. Too much information Providing excess or too much information can overwhelm the receiver and make it challenging to process the main points. This factor can cause the receiver to either miss or forget the main points. Distractions Any type of noise or interruptions can divert the attention of the receiver which can lead to incomplete communication, where the receiver may not have perceived it correctly. Cultural Differences Different customs or value systems can cause misunderstanding among cultures. What may be considered appropriate and respectful communication behaviour in one culture can be considered disrespectful or confusing in another culture. Power Dynamics Unequal power relationships can hamper communication within any organisation. Subordinates may hesitate to express their opinions to their seniors. Perceptual Differences People interpret messages based on their individual perspectives or experiences. However, this can lead to interpreting the same message in different ways. Technological Issues In the present world, where technology is the king of effective communication, there are challenges and glitches that can cause obstructions. Poor internet connectivity, software errors, or not understanding the communication tools can disrupt the flow of information.

Measures to Overcome Barriers to Communication

The following are some of the measures that can be used to overcome various barriers to effective communication. 1. Communication should take place as per the understanding and capabilities of the receiver. It is always best to use a language that can be understood by the receiver. 2. The language, tone, and content of the information should be carefully chosen. It should be understandable and not harm any human sentiments. 3. There should be no room for incomplete information and ambiguity. Information shared should be complete in every way. 4. The idea of a communication is to be clear between the sender and the receiver. The communication must be conveyed effectively and in simple language.

28


5. Proper and effective feedbacks must be taken from the receiver. The receiver should always be encouraged to respond during a conversation. 6. There should be mutual trust and respect between the sender and the receiver, this helps in reducing perception errors. 7. It is a good idea to communicate in person as much as possible. This enables the sender to receive immediate feedback by looking at the nonverbal cues of the receiver. 8. When it comes to culture or traditions, forming assumptions and stereotyping one should not be encouraged. 9. Using visuals while communicating an idea or information, will ensure that the message or information is communicated completely and effectively. 10. The sender of the information should also be a patient listener and be open to all sorts of communication. 11. Physical disabilities or any other physical barriers should be taken into consideration during the communication. Appropriate means of communication, such as sign language, visual aids, or written communication should be used in such situations.

Think and Tell How can you remove barriers to effective communication?

ActivityTime Time Activity Activity 1: Listen and Draw

(Individual Work)

This game is easy to play but not so easy to “win”. It requires participants’ full attention and active listening. Take a piece of paper and pen or pencil. Listen attentively to the step-by-step instructions on drawing an object. The instructions may include: 1. Draw a square, measuring 5 inches on each side. 2. Draw a circle within the square, such that it fits exactly in the middle of the square. 3. Intersect 2 lines passing through the circle and dividing the circle into 4 equal parts. As the exercise continues, it will get progressively harder. One misstep can mean that every following instruction is

misinterpreted or misapplied. Listen carefully to ensure that their drawing comes out accurately. Once the instructions is complete, compare the drawings and decide who won.

Activity 2: Role Play on Barriers to Effective Communication

(Group Work)

In a group of five students, plan and present a role play. You may pick one barrier of communication and plan a scene from daily life around it. Also, present the measure you would take to overcome the barrier chosen by your group. Activity 3: Overcoming Barriers

(Group Work)

In a group of five students, choose a barrier of communication for your group discussion. Discuss the factors of the chosen barrier and the measures needed to overcome them.

After the discussion, create a poster highlighting the factors and measures discussed in the group.

Chapter 3 • Barriers to Effective Communication

29


Chapter Checkup A Select the correct option.

1 Which of the following is a common barrier, and causes misunderstanding and misinterpretations between people? a Physical barriers c Interpersonal barriers

b Linguistic barriers

d Organisational barriers

2 Which of the following can be considered as an interpersonal barrier? a Being shy c Natural condition

b Slang language

d Religion colloquialism

3 Which of these is not a common communication barrier? a Linguistic barrier c Financial barrier

b Interpersonal barrier

d Organisational barrier

B Fill in the blanks with the most suitable words.

1 When a sender sends a message which is received differently from how it was intended will be considered a barrier. 2 The

3 Using 4

barrier leads to stereotypical assumptions about others, based on their cultural background. is one of the ways of overcoming communication barriers.

communications are less effective than face-to-face communication.

C State whether the following statements are True or False. Correct the statements that are false. 1 Inability to communicate using a language is known as an interpersonal barrier. 2 Text messages are more effective than face-to-face communication.

3 The superior-subordinate relationship is a type of an organisational barrier. 4 To overcome linguistic barriers, take the help of a stenographer. D Answer the following questions. (Solved)

Q1. Explain the physical and linguistic barriers with appropriate examples.

A1. Barriers of communication cause hindrances and obstacles in communicating a message or an idea effectively, correctly, and clearly. Physical Barrier

• The environmental and natural condition that act as a barrier is known as a physical barrier.

• A gesture, posture, or body language that cannot reach the receiver makes communication less effective. • Text messages are less effective compared to face-to-face communication. Linguistic Barrier

• This is the most common barrier.

• It can cause misunderstandings and misinterpretations between people. • Slang language, professional jargon, religious colloquialisms

Q2. Explain how can you overcome barriers to communication?

A2. The following are some of the measures that can be used to overcome various barriers to effective communication.

• The communication should take place as per the understanding and capabilities of the receiver. It is always best to use a language that can be understood by the receiver.

• The language, tone, and content of the information should be carefully chosen. It should be understandable and not harm any human sentiments. • Proper and effective feedbacks must be taken from the receiver. The receiver should always be encouraged to respond during the conversation.

• There should be no room for incomplete information and ambiguity. Information shared should be complete in every way.

30


• The idea of communication should be clear between the sender and the receiver. The idea must be conveyed effectively. • The sender of the information should also be a patient listener and be open to all sorts of communication.

Q3. Nikita has recently joined Tiara Cosmetic Company as an Associate Manager in Marketing. She must collaborate with the product and sales department to understand about the latest product. In spite many efforts, she is not able to overcome the communication barrier she is experiencing because of the structure of the company. What kind of barrier is it? Explain this barrier in about 75 to 100 words. A3. This kind of barrier is an organisational barrier. An organisational barrier refers to any obstacle or challenge within a company or an institution that affects effective flow of communication among individuals, teams, or departments. These barriers can arise from factors such as hierarchical structures, inadequate communication channels, lack of transparency, conflicting goals, and different priorities. Organisational barriers can impede timely and accurate exchange of information, leading to misunderstandings, decreased efficiency, and overall communication breakdowns within an organisation.

Answer Key A 1. b

2. a

B 1. Interpersonal

3. c 2. Cultural

3. visuals

4. Nonverbal communications

C 1. False. Inability to communicate using a language is known as a language barrier. 2. False. Face-to-face communication is more effective than text messages. 3. True

4. False. To overcome linguistic barriers, take the help of a translator.

Chapter 3 • Barriers to Effective Communication

31


Unit 1 • Communication Skills II

4 Principles of Effective Communication I

magine a world where our ideas, thoughts, and dreams remain locked in our mind, unable to reach others. Such a world would lack progress and understanding. Communication is the key that unlocks this world, allowing us to share our ideas, connect with others, and bring our aspirations to life. In a world driven by connections and collaborations, effective communication is the key to success. It is the invisible thread that weaves through every aspect of our lives, from the classroom to the workplace and beyond. Effective communication is more than just exchanging words; it is about conveying our thoughts in a way that others can understand and appreciate. It involves not only the words we choose, but also our tone of voice, our body language, and our ability to actively listen. Imagine communication as a bridge that brings people, ideas, and opportunities together, helping them travel the wide world of human interaction. Effective communication means expressing our thoughts, ideas, or information clearly and in a way that others can easily understand, leading to successful understanding and meaningful interactions. Rohan and Ashima work as the Associate Marketing Manager at Idea Advertising Firm. They need to pitch a new advertising idea to a beverage brand. Both Rohan and Ashima are excited and buzzing with ideas. They brainstorm ideas with their respective teams and are ready for the final day’s presentation. In order to impress, Rohan begins his presentation with heavy data, technical terms, and complex ideas. The brand team feels disengaged and unclear. On the other hand, Ashima expresses her ideas with relatable and realistic examples. She uses easy-to-understand language, which leaves a lasting impact. Who do you think communicated more effectively?

32

Did You Know? Humans process visual information much faster than text. Studies have shown that the brain can process images in as little time as 13 milliseconds. This is why using visual aids, such as diagrams, charts, and infographics, can be a powerful way to enhance communication and quickly convey complex ideas to our audience.


Principles of Effective Communication

To engage in effective communication, one should take care of the following principles:

Simple Language +

Definite purpose +

+ Appropriate Medium

Completeness and Concision +

+

Authenticity

+

Courtesy

Error Alert! It is commonly misunderstood that clear speech is the only important factor of effective communication. But effective communication involves much more than just speaking clearly. While clear speech is important, to be able to communicate effectively, one needs to listen actively, understand nonverbal cues, adapt to various contexts, and empathise with others.

Simple Language Using language that is easy to understand helps ensure that both the sender and the receiver grasp the message without confusion. For example, explaining the objective of a project using simple words makes it easier to understand the need and purpose of the project, thereby improving efficiency. Definite Purpose Having a clear purpose in mind when communicating prevents misunderstandings and ensures that the message’s intent is well-understood. For example, a leader should clearly communicate the goal of a group project before assigning it to a team. Completeness and Concision Providing all necessary information in a concise manner ensures that the recipient gets the full picture without being overwhelmed. For example, a senior is providing the steps for data study to his subordinate. The senior breaks down the instructions into clear, crisp, and concise statements and provides complete information to avoid confusion. Appropriate Medium Choosing the right communication medium and considering factors, such as timing, distance, and the nature of interaction ensure effective communication. For example, sending a text message to a team member to confirm the meeting time may work, but using a message to discuss the future course of action can cause ambiguity. Authenticity Sharing accurate and honest information builds trust and credibility in communication. For example, it is important to provide reliable sources when presenting information to others. Courtesy Politeness and respect in communication contribute to a positive atmosphere and healthy relationships. For example, thanking a team member for clarifying doubts creates a positive atmosphere for further communication. Active Listening Effective communication involves not only speaking or writing but also actively listening to others. Active listening involves giving full attention to the speaker or the message, asking clarifying questions if needed, and avoiding interruptions. Adaptability Tailoring communication to fit the needs and preferences of the audience or receiver. Consider the level of knowledge, communication style, and the context of the interaction. For example, when communicating ideas to young students, the language and content should be chosen according to their age group and understanding. The content should be supported with visual aids to make it interesting.

Chapter 4 • Principles of Effective Communication

33


The 7 Cs of Effective Communication 7 Cs OF EFFECTIVE COMMUNICATION

Conciseness: Convey information concisely, without sacrificing essential details.

Correctness:

Maintain accuracy in grammar, spelling, and factual information.

Completeness:

Clarity: Ensure that your message is easily understood and is free from ambiguity.

Courtesy: Use a respectful and considerate tone that promotes positive relationships.

Concreteness:

Coherence:

Use specific and tangible examples to make your message more relevant.

Organise your message logically for smooth comprehension.

Provide the necessary information to prevent misunderstandings or doubts.

The 7 Cs of effective communication are a set of principles that helps ensure that messages are conveyed clearly and comprehensively. These principles aid in avoiding misunderstandings, misinterpretations, and confusion, thus enhancing the overall quality of communication. Clarity 1. Clarity is the most important factor, impacting effective communication. Messages should be clear, straightforward, and easy to understand. 2. We should avoid technical words, complex vocabulary, or difficult sentence structures that can confuse the receiver of the information. 3. The sender should have clarity of thoughts so that the message is conveyed clearly. 4. The sender should not mix many ideas together when sending a message or information, as it may lead to confusion. 5. Example: Imagine you are a customer service representative addressing a customer’s complaint about a defective product. Here, using clear language and providing step-by-step instructions on how to return the item ensures better understanding of the process for the customer and builds trust. Conciseness 1. Being concise means conveying the message using the fewest possible words to make it brief and comprehensive. 2. Adding unnecessary details while communicating can lead to disinterest or loss of focus. Only state what is necessary to know. Avoid overexplaining to avoid confusion. 3. The message should be to the point and precise with essential details. 4. The words used should be meaningful and of interest to the receiver.

34


5. Example: Consider the difference between these two messages: “I just wanted to let you know that the upcoming meeting scheduled for next Monday at 9 AM may be postponed to the following Wednesday at 2 PM due to unforeseen circumstances that have arisen.” In contrast, “The meeting on Monday at 9 AM may be postponed to Wednesday at 2 PM due to unforeseen circumstances.” By being concise, the revised message conveys the same information in a more brief and engaging manner. Concreteness 1. Concreteness in communication means being clear and specific in what you are saying. 2. It is like using detailed examples and facts to make your message easy to understand and convincing. 3. Providing concrete examples, facts, and figures can help clarify your points and make the message more convincing. 4. Example: When making a presentation about the change in choices of the consumers, directly saying that consumers show desires to own luxury products may not have as much impact as when confirming the same through statistical data. Correctness 1. Correctness pertains to the accuracy of your message in terms of grammar, spelling, punctuation, and information. Errors can undermine your credibility and cause confusion. 2. Always proofread your communication to ensure accuracy and professionalism. 3. Example: Imagine receiving a message with errors like “The employees meeting their managers to discuss performance or goals.” Revise it to “The employees are meeting with their managers to discuss performance and goals”. Here, grammar is corrected, leading to a more accurate message and better impact. Coherence 1. Coherence involves organising your message logically and ensuring that the ideas flow smoothly from one point to another. 2. Each part of the message should connect naturally, allowing the receiver to follow the thought process effortlessly. 3. Logical coherence enhances understanding and prevents confusion. 4. In simpler terms, when your communication is coherent, it is like telling a story that has a clear beginning, middle, and end, and all the parts fit together logically. 5. Example: Consider the original message “The project deadline is approaching. Will you attend the launch party tonight? Will you be able to meet your deadline?” The topics are disjointed. However, if revised to “As the project deadline is approaching, I wanted to know if you will be able to meet the deadline? By the way, would you be attending the dinner party tonight?” the connection between the project and the party inquiry makes the message more coherent. Completeness 1. A complete message provides all the essential information a recipient needs to take the necessary action or make informed decisions. 2. Incomplete messages can lead to misunderstandings or lead to follow-up questions, time wastage, and effort. 3. It is important to ensure that your communication includes all relevant details and addresses potential questions or concerns.

Chapter 4 • Principles of Effective Communication

35


4. Example: Think about the message “Please send me the report.” It lacks details. In contrast, “Could you please send me the quarterly sales report by Friday at 3 PM?” provides essential information about the specific report and the deadline, making it a complete and more actionable question. Courtesy 1. Courtesy refers to the tone and manner in which a message is conveyed. Respect and consideration for the recipient’s feelings, opinions, and perspectives are vital. 2. A courteous tone fosters positive relationships and encourages open communication. 3. Avoid aggressive language or insensitive remarks that may hinder understanding or cooperation. 4. Example: Imagine receiving a message that demands “I need this report now!” This tone may come across as rude or threatening. However, when revised to “Could you please send me the report at your earliest convenience? Your assistance would be greatly appreciated,” the message becomes more courteous and acknowledges the recipient’s effort.

Think and Tell

Imagine you are a manager in an Indian company. You need to deliver feedback to an employee about their performance. How would you apply the principle of “concreteness” to ensure that your message is clear and well-received? Share a real or fictional example of how you would do this effectively.

By adhering to the 7 Cs of effective communication, you can create messages that are clear, concise, meaningful, and respectful. These principles are applicable across various communication channels, from face-to-face conversations to written documents and digital communication. Embracing the 7 Cs can significantly enhance your ability to communicate effectively in both personal and professional contexts.

Benefits of Effective Communication

Clear Understanding Good communication helps people understand each other better, reducing confusion and mistakes. Stronger Relationships When we communicate well, we build better relationships with friends, family, and colleagues. Solving Problems Effective communication is crucial for solving arguments and disagreements. It helps find solutions everyone can agree on. Persuading Others If we talk well, we can convince others more easily. This is useful in getting what we want or need. Career Success Having good communication skills provides ample of opportunities for professional growth and development. Less Stress Misunderstandings and miscommunication can lead to reasons of stress. Effective communication helps us feel better by solving problems and worries. Personal Growth Learning to communicate better makes us more confident and helps us express ourselves. Changing the World On a larger scale, good communication can help with important issues like raising awareness or making positive changes in society. I n short, effective communication is a valuable skill that can make life easier and more successful by promoting clear understanding and positive connections with others.

36


Activity Time Activity 1: C for Communication

(Group Work)

Form a group of four to five students. The teacher can help each group pick one C of communication and ensure that the topic is not repeated.

Each group is to discuss about the chosen C of communication. Finally, create a poster highlighting all the important details and examples related to the topic.

Present your poster and learning to the whole class. Activity 2: Phone Conversation Challenge

(Pair Work)

In pairs, engage in a phone conversation where one student plays the role of a customer with a complaint or inquiry and the other student plays the role of a customer service representative.

The customer’s issue should be related to a simple product or service concern, and the customer service representative must address the issue effectively and respectfully, using the principles of clear communication, active listening, and empathy.

After each role play, the students can switch roles and discuss their experiences. Activity 3: Note Your Thoughts

(Whole-Class Work)

Arrange the class in a big circle. Teacher will set the timer to 30 seconds. Start the activity by passing a chart paper to the student on the right-hand side of the teacher. Encourage learners to write their thoughts on the 7 Cs of Communication.

They can either express in words, phrases, or complete sentences. After every 30 seconds, the student will pass the chart to the one on their right. This process continues till the sheet completes the circle and returns to the teacher. This chart can then be displayed on the board as the class summary.

Chapter Checkup A Select the correct option. 1 Which of the following is NOT one of the 7 Cs of effective communication? a Clarity b Completeness c Coordination d Courtesy

2 Which of the following best represents the “Completeness” principle of effective communication? a A message that is vague and unclear

c A message that uses complex vocabulary

b A message that includes the necessary information d A message that is overly lengthy

3 Which of the following is an attribute of the “Conciseness” principle of effective communication? a Providing clear and specific details

b Using polite language

c Including unnecessary information

d Active listening during a conversation

B Fill in the blanks with the most suitable words. 1 Concreteness involves using

examples to make a message more relevant and relatable.

2 Effective communication goes beyond just speaking clearly; it also encompasses active 3

.

involves adjusting your communication style to fit the context and audience.

4 Correctness in communication refers to maintaining accuracy in

and information.

C State whether the following statements are True or False. Correct the statements that are false. 1 Effective communication only involves conveying information clearly through spoken words.

Chapter 4 • Principles of Effective Communication

37


2 Empathy is the ability to understand and acknowledge the emotions and viewpoints of others. 3 Feedback in communication is discouraged as it can lead to conflicts and misunderstandings. 4 Adaptability in communication means using complex vocabulary to impress the audience. D Answer the following questions. (Solved)

Q1. Why is clarity an important aspect of effective communication in the workplace?

A1. Clarity is a fundamental element of effective communication because it ensures that your message is crystal clear and easily understood by your audience. In the Indian employability sector where diverse backgrounds and languages are prevalent, being clear in your communication is essential. When you use plain and precise language, along with wellstructured information, you reduce the chances of creating misunderstandings and causing confusion. This fosters trust and enhances your professional image. Clear communication also promotes efficient decision-making and problemsolving within teams and organisations, which are critical skills in the Indian job market.

Q2. How can practising the 7 Cs of communication, especially being considerate, improve your workplace relationships and career prospects? A2. Practising the 7 Cs of communication, especially being considerate, can significantly improve your workplace relationships and career prospects. When you show consideration for your colleagues’ needs and emotions, you create a positive and respectful work environment. Such environment can lead to better teamwork, stronger collaboration, and increased support from your peers. In the Indian employability sector, where interpersonal relationships are highly valued, being considerate in your communication can set you apart as a trusted and valued team member. Over time, your communication skills can open opportunities for career growth and advancement as your colleagues and superiors recognise your professionalism and empathy. Q3. Imagine you are a project manager in an Indian IT company. You have a diverse team working on a critical project, and miscommunication has led to confusion and delays. Apply the principles of the 7 Cs of effective communication to explain how you would address this issue and restore clarity and efficiency in your team’s communication. A3. In this scenario, I would address the miscommunication issue by applying the 7 Cs of effective communication:

Clarity: I would ensure that all team members clearly understand their roles and responsibilities in the project.

Conciseness: I would encourage my team members to provide concise updates and reports to avoid overwhelming others with unnecessary details. Coherence: I would establish a standardised reporting structure to ensure that all project updates and communications follow a logical flow. Consistency: I would implement regular communication checkpoints to ensure that everyone is on the same page and consistency is maintained. Correctness: I would emphasise the importance of accurate data and information in all communications. Consideration: I would encourage team members to be considerate of each other’s perspectives and provide feedback respectfully. Completeness: I would ensure that all necessary information is included in project documentation and communications to prevent gaps in understanding. By applying these principles, I would foster better communication within the team, reducing confusion and delays, and ultimately ensuring successful completion of the project.

Answer Key A 1. c B 1. specific

2. b

3. a

2. listening

3. Adaptability

4. language

C 1. False. Effective communication involves various forms of communication, not just spoken words. 2. True

3. False. Feedback is encouraged as it helps in improving communication.

4. False. Adaptability in communication means adjusting your communication style to suit the audience, not using complex vocabulary to impress.

38


Unit 1 • Communication Skills II

5

Basics of Writing Skills W

riting helps us share ideas, feelings, and information in a way that lasts. In today’s world, with the expanding presence of information communication and technology, writing is even more important. It is not just about sending an email or typing an essay; it is a skill that helps us express ourselves clearly and connect with others.

Understanding Sentences

Sentences are the building blocks of writing. A sentence is a group of words that make complete sense on their own. It is like a thought captured in words. When you speak or write, you are creating sentences to communicate your ideas. Example: The sun is shining. This is a sentence because it is a complete thought. The sentence tells us something about the sun. Bright and early every morning. This is not a sentence because it is not a complete thought. It is just a group of words.

Parts of a Sentence

Every sentence can be broken down into two essential parts, a subject and a predicate.

A subject in a sentence is a word or a group of word that tells the name of a person or thing that the sentence is about. A predicate in a sentence is the part of a sentence that tells what the subject is doing or what the subject is. For example: The man drove the car swiftly.

In this sentence, “The man” is the subject. It is who the sentence is talking about. “Drove the car swiftly” is the predicate, as it tells us what the man is doing. Remember, a sentence cannot exist without a subject and a predicate. They work together to create a complete thought. If you have only one or the other, it is not a sentence; it is just a group of words. For example: • Subject without a predicate: “The book.”

• Predicate without a subject: “jumped over the fence.”

In both cases, we do not have a complete idea. We are left wondering, “What about the book?” and “Who or what jumped over the fence?” By understanding the subject and predicate of a sentence, you will be able to recognise and create clear, meaningful sentences. This knowledge forms the foundation for constructing sentences that effectively convey your thoughts and ideas in writing.

39


Types of Sentences

There are four basic types of sentences: 1. Declarative Sentence (statement) 2. Interrogative Sentence (question) 3. Imperative Sentence (command) 4. Exclamatory Sentence (exclamation) Declarative Sentence A sentence that states a fact or an argument and ends with a full stop (.). This is the most frequently used sentence type. For example: Mount Everest is the highest mountain in the world. Mamta is playing badminton in the garden. Interrogative Sentence A sentence that asks a direct question. Interrogative sentences always end with a question mark (?). For example: Why are you late for the meeting? Where did you keep the packet? Consider the following sentence: “She asked what had happened to the containers with melted ice cream in them.” Is this an interrogative sentence? No, it is not an interrogative sentence, as no one is doing the asking. The event is just recorded as a statement, making it a declarative sentence. Imperative Sentence Like declarative sentences, imperative sentences usually end with a full stop (.). Unlike declarations though, the subject (you) is understood and an imperative sentence makes a command or a request. For example: Read chapter 4 for tomorrow’s class. (command) Please leave this file on my desk. (request) Exclamatory Sentence A sentence that expresses a strong feeling like surprise, wonder, sorrow, or happiness. This sentence is a complete statement that ends with an exclamation mark (!). For example: Tanmay scored five goals in the game! Wow, that is a beautiful painting! Knowing the various types of sentences and how they function helps you decide what kind of sentence to write for a situation. The table below outlines the differences between the four types of sentences. Sentence Type

Feature

Example

Punctuation

Declarative

States a fact or an argument

We are going to the library today.

Ends with a full stop (.)

Interrogative

Asks a question

Are you presenting your topic tomorrow?

Ends with a question mark (?)

Imperative

Gives a command

Stop! Do not enter that room.

Ends with a full stop or an exclamation mark (.) (!)

Wow! We won.

The exclamation word ends with an exclamation mark (!) The sentence may or may not end with an exclamation mark.

Exclamatory

40

Shows an emotion


Phrases

A phrase is a group of words that work together to convey a specific meaning. Unlike sentences, phrases do not have both a subject and a predicate, so they do not express a complete thought on their own. Instead, they are essential components within sentences, adding depth, detail, and nuances. Understanding the phrases is essential for improving writing. They add richness and detail to sentences, making communication more vivid and engaging.

Types of Phrases Types of Phrases

Definition

Think and Tell Identify and state the types of the sentences given below. 1. Roshan was worried about his exam preparation. 2. Do you know the directions to the Qutub Minar? 3. Stop talking! 4. They were driving to Agra. 5. Please help me in organising the shelf. 6. Hurray! We won the match.

Example The big red apple fell from the tree.

Noun phrase

A group of words centred around a noun, which can include articles, adjectives, and other modifiers.

Verb phrase

A group of words centred around a verb, often containing auxiliary verbs and other elements.

Adjective phrase

A group of words centred around an adjective, providing additional information about a noun.

Adverb phrase

She danced gracefully. A group of words centred around an adverb, providing The athletes ran incredibly fast during more details about a verb, adjective, or adverb. the race.

Prepositional phrase

A group of words that starts with a preposition and includes an object. A prepositional phrase shows the The book is on the table. relationship between the object and other parts of They went on a vacation to the beach. the sentence.

Role of Phrases

The old oak tree swayed in the wind. She is studying for her exams.

They have been practicing for the upcoming concert. The house, with a stunning view of the mountains, is for sale.

He bought a car with sleek, modern design.

Think and Tell

Helps to provide descriptive detail Use adjective phrases to paint Underline the phrases in the given a clearer picture for your readers. Instead of saying “the car”, you sentences and state their types. can say “the sleek, red sports car”. 1. She walked to the park. Adds variety to sentence structure Use various types of phrases 2. The old book on the shelf is a family to add variety to your writing. Mix up noun phrases, verb phrases, heirloom. and adverb phrases to keep your readers engaged. 3. Running in the morning, he felt refreshed. For example: 4. He plays the guitar skilfully. 1. Noun phrase: “The big, old tree shaded the playground, 5. The concert will be held in the providing a cool spot-on hot day.” auditorium. In this sentence, a noun phrase “big, old tree” is used to describe the subject of the sentence. 2. Verb phrase: “She laughs happily whenever she plays with her friends.” Here, a verb phrase “laughs happily” describes how she laughs, adding detail to the action. 3. Adverb phrase: “He spoke very slowly to make sure everyone could understand him.” In this case, the adverb phrase “very slowly” tells us how he spoke, giving us more information about the action. Clarify relationships Prepositional phrases can help clarify the relationship between various elements in a sentence. For example, “The book on the table is mine” makes it clear which book is being referred to. Chapter 5 • Basics of Writing Skills

41


Parts of Speech

Imagine language as a toolbox, and each word as a unique tool. These tools are called “parts of speech,” and they serve specific functions in constructing sentences. Understanding parts of speech is like knowing how to use various tools for multiple tasks; it allows you to craft sentences that convey your thoughts precisely. There are eight parts of speech in the English language.

Parts of Speech

Definition

Examples

Usage

Noun

names of people, animals, places, manager, presentation, love things, or ideas

The manager scheduled a presentation to assess our skills.

Pronoun

used in place of a noun to avoid repetition

he, she, it, they

He went to the store and bought the groceries.

Verb

action words; tells what the person/thing is doing

type, collaborate, achieve

We collaborate effectively to achieve our project goals.

Adverb

words that modify and describe verbs, adjectives, or other adverbs

effectively, very, carefully

She communicates effectively and manages her time carefully.

Adjective

words that describe or modify nouns

efficient, experienced, essential

An efficient and experienced team is essential for success.

Preposition

words that show relationships between words

in, on, at, with

The meeting is scheduled in the conference room at 10 AM.

Interjection

words or phrases expressing strong emotions or exclamations

wow! oh! alas!

Wow, your presentation was outstanding!

Conjunction

words that connect words, phrases, or clauses

and, but, or, because

We need to review our project and make necessary revisions.

42


Articles

Articles are special words (a, an, the) that are used before nouns to specify whether we are talking about something specific or in general. There are two main types of articles: 1. Definite Article (the) 2. Indefinite Articles (a, an)

Definite Article (the)

We use “the” when we are talking about a specific thing that the listener or reader already knows about or can easily identify. Examples: • The manager called a staff to carry the files. • Please pass the documents. Rules for Using the Definite Article (the) 1. Specificity: Use “the” when referring to a specific item or group of items that the listener or reader can identify or is already familiar with. Example: I saw the cat in the playground. (You are referring to a particular cat and a specific playground.) 2. Unique Objects: Use “the” when referring to a unique object or something that is one of a kind. Example: The Eiffel Tower is in Paris. (There is only one Eiffel Tower.) 3. Superlative Forms: Use “the” before superlative adjectives (e.g., the best, the tallest) to indicate that something has the highest degree of quality. Example: She is the best employee we have. (Indicating that she is the employee with the highest level of performance) 4. Ordinals: Use “the” with ordinal numbers (e.g., the first, the second) when referring to specific items in a sequence. Example: He won the first prize in the contest. (Referring to a specific prize—the first one) 5. Geographical Features: Use “the” before the names of oceans, seas, rivers, mountain ranges, and other geographical features. Example: The Ganga River flows through eleven Indian states. 6. Countries with Plural Names: Use “the” when referring to countries with plural names, such as “the United States” or “the Netherlands.” Example: I have never been to the United States. 7. Musical Instruments: Use “the” before the names of musical instruments. Example: She plays the sitar beautifully. 8. Newspapers: Use “the” before the names of newspapers. Example: I read the Indian Express every morning. 9. Religious Books: Use ‘the’ with religious books to indicate a specific, well-known, and revered text within a particular religious tradition. Example: I find comfort in reading the Bible every morning.

Indefinite Articles (a/an)

We use “a” or “an” when we are talking about something in a general or nonspecific way. Examples: • I have a meeting at 2 p.m. • She is an excellent candidate for the job. Chapter 5 • Basics of Writing Skills

43


Rules for Using the Indefinite Article (a/an) 1. Countable Nouns: Use “a” or “an” with countable nouns when you are referring to one nonspecific item or thing. Example: I saw a dog in the park. (Referring to one dog in general.) 2. Singular Nouns: Use “a” before singular nouns that begin with a consonant sound. Example: He is a teacher. (Teacher starts with a consonant sound: /t/.) 3. Singular Nouns Starting with a Vowel Sound: Use “an” before singular nouns that begin with a vowel sound. Example: She has an umbrella. (Umbrella starts with a vowel sound.) 4. Singular Nouns Starting with a Silent “H”: Use “an” before singular nouns that begin with a silent “h”. Example: He’s an honest person. (Honest starts with a silent “h” and begins with vowel sound of “o”.) 5. Professions and Nationalities: Use “a” or “an” when referring to someone’s profession or nationality without specifying a particular person. Example: She is a lawyer. (Referring to any lawyer in general.) 6. General Statements: Use “a” or “an” to make general statements about a group. Example: I need a book for my research. (Referring to any book that fits the research.) 7. First Mention: When you introduce a new, singular, and nonspecific noun in a conversation or text, use “a” or “an.” Example: I saw a car on the street. (The car has not been mentioned before in the conversation.)

Constructing and Writing Paragraphs When you write, you use paragraphs to make your ideas easy to understand. A paragraph is like a group of sentences that stick together because they talk about the same thing. They are the building blocks that structure your ideas and thoughts. They provide organisation and coherence to your text, making it easier for readers to follow along and grasp your message. When writing a paragraph, the idea should be clear to you and there should be a definite topic. Without the two, your paragraph will lack focus, clarity, and uniformity.

44

Understanding Grammar- a, an or the 1st time There is a fly in my soup. 1 or any I need a pencil. Some quantities a couple, a few, a handful, etc ... Jobs I’m a teacher. Exclamations singular What a beautiful day!

a or an

2nd time What is the fly doing in my soup? Only 1 the moon, the Queen, the President

the

no article

Rivers and seas The Severn is the longest river in the UK.

Superlatives Football is the best sport in the world. Inventions The computer has revolutionised the way we work

Exclamations Generalisations plural Dogs ore better than What beautiful cots. children you have! Proper nouns meals People, countries, breakfast/ lunch/ special places cities, etc ... dinner/ supper school, college, university, hospital, prison, church

Remember

Specific vs. Nonspecific: Remember that “a” and “an” indicate a nonspecific or generic item, whereas “the” indicates a specific or previously mentioned item. Example: “I need a pen.” (Any pen will do.) “I need the pen you borrowed yesterday” (Referring to a specific pen.)

Error Alert! Even though using articles is important in the English language; however, they are not used everywhere! Cases with zero article usage, often referred to as “zero article”, occur when we don’t use any article (neither “the,” “a,” nor “an”) before a noun. Example: What time do you have breakfast? We went to the shopping mall last week.


A well-structured paragraph typically consists of three essential elements: 1. A topic sentence 2. Supporting details 3. A concluding sentence Topic Sentence The topic sentence is like the headline of your paragraph. It introduces the main idea or point that the paragraph discusses. It is a crucial element that guides the reader’s understanding of what is to come. Example: “One of the key benefits of regular exercise is improved physical health.”

Think and Tell State whether the articles in the sentences have been used correctly or not. If not, replace the article with the correct one. 1. Please pass me a salt. 2. He is a honourable man. 3. Rishi has moved to the United States of America. 4. My father is the honest man.

Supporting Details Supporting details are sentences or examples that provide evidence or an explanation for the topic sentence. They add depth and context to your main idea. Example: “Exercise helps strengthen the heart, reduce the risk of chronic diseases, and improve overall fitness.” Concluding Sentence The concluding sentence summarises the paragraph’s main point and often provides a smooth transition to the next paragraph. Example: “Incorporating regular exercise into your daily routine can lead to a healthier and happier life.” Effective paragraphs are not just about structuring sentences, but also about conveying your ideas clearly and persuasively. By constructing paragraphs properly, you are better equipped to communicate your thoughts and engage your readers effectively.

Tips for Writing Effective Paragraphs

Every writer should remember that it is important that their paragraphs are coherent and well-structured. Use the tips given below as a checklist while constructing and writing paragraphs: 1. Unity: Ensure that all sentences in a paragraph relate to the main idea expressed in the topic sentence. Irrelevant information can confuse readers. 2. Coherence: Use transition words and phrases (e.g., “furthermore,” “in addition,” “however”) to connect ideas within a paragraph and make the text flow smoothly. 3. Order: Organise your supporting details logically. You can use sequential order, order of importance, or any other suitable pattern to structure your paragraph effectively. 4. Conciseness: Be clear and concise in your writing. Avoid unnecessary repetition or overly long sentences that may confuse the reader. 5. Variety: Use a mix of sentence structures and lengths to keep your writing engaging. Short, direct sentences can be followed by longer, more descriptive ones for variety. 6. Proofreading: Always proofread your paragraphs for grammar, punctuation, and spelling errors. Clear, error-free writing enhances your credibility.

Transition Words

Transition words, also known as linking words, are essential for creating smooth and coherent written pieces. They help guide readers through the text, showing the logical relationships between ideas and shifts in thought or direction. Here are some common transition words and phrases, grouped by their functions:

Chapter 5 • Basics of Writing Skills

45


Beginning

To begin with Generally speaking

On the one hand To be sure

Comparison/Contrast

On the other hand Despite Still Yet

Nevertheless In spite of Although

Emphasis

Indeed In fact Furthermore

Certainly Especially

Transition Between Paragraphs

First and foremost Moving on, to begin with

On the contrary In regard to

Conclusion

To sum up In the final analysis In brief

To conclude On the whole As a result

Activity Time Activity 1: Paragraph Writing

(Individual Work)

Imagine your teacher has given you a school assignment about the Importance of Internet. Write a 200-250-word paragraph

explaining why internet has become a necessity in today’s world. Use transition words to make your paragraph flow smoothly.

Topic Sentence

Supporting Details

Conclusion

Activity 2: Planning a Podcast

(Pair Work)

Get in pairs. Use the graphic organiser given below to plan your own podcast. In this graphic organiser template, prompts are given to guide your podcast planning. Choose any one topic, idea, or theme that you want to work on. Using the three

essential elements of a paragraph: Topic Sentence, Supporting Details, and Concluding Sentence/s, write a paragraph that you would like to share about. Include information about the concept, audience, and important details for the podcast.

46


Podcast Name: Episode Title: Length: Purpose or Goal: What do you hope to accomplish through your podcast episode?

Overview: What topic will you discuss? (Global Warming, Importance of Reading, The Indian Constitution, Neeraj Chopra, etc.)

Topic Sentence: (What will you say to introduce your topic and hook your listeners?) Supporting Detail 1: (Details, Evidence, Examples) Supporting Detail 2: (Details, Evidence, Examples) Supporting Detail 3: (Details, Evidence, Examples) Concluding Sentence/s: (What should listeners do with the information you shared in this episode? What call to action do you have for them?)

Chapter Checkup A Select the correct option.

1 Which type of sentence asks a direct question? a Declarative c Interrogative

b Imperative

d Exclamatory

2 When do you use the definite article “the”?

a When talking about something in general

b When referring to a unique object or that is one of a kind c When referring to an unspecific item

d When making a general statement about a group

Chapter 5 • Basics of Writing Skills

47


3 Which part of speech is used to replace nouns and avoid repetition? a Verb

b Adjective

c Adverb

d Pronoun

B Fill in the blanks with the most suitable words.

Use transition words or phrases from the boxes to fill in the blanks in the paragraphs. consequently

for instance

however

furthermore

particularly

likewise

nonetheless

moreover

Most habitable places on Earth have at least one species of snake. (1) , the rich, green land of Ireland is one place where ophidiophobes—those who have an excessive fear of snakes—can rest easy, for Ireland has no snakes. The most recent ice age, which ended about 10,000 years ago, made many places in the world too cold for reptiles like snakes to survive. (2) , snakes survived the period by migrating to warmer climates. Once the ice age ended, snakes were able to return to many of those original locations. But why not Ireland? Due to melting glaciers, Ireland’s land link to the mainland Britain and the rest of Europe was cut off thousands of years prior to the end of the most recent ice age. (3) , snakes were blocked from migrating to Ireland by the newly formed seas that surrounded it. As a large island cut off from other land masses, Ireland has maintained its snake-free status for thousands of years. (4) , the large islands of Antarctica, Iceland, Greenland, and New Zealand are also without any wild snakes. C State whether the following statements are True or False. Correct the statements that are false.

1 A well-structured paragraph consists of a topic sentence, supporting details, and a concluding sentence. 2 In the sentence, “The book on the table is mine”, the article “the” is used correctly.

3 A sentence can be considered complete if it contains either a subject or a predicate, but not both. 4 A declarative sentence gives a command and ends with a full stop. D Answer the following questions. (Solved)

Q1. Explain the three essential elements of a well-structured paragraph, with an example.

A1. A well-structured paragraph has three essential elements: a topic sentence, supporting details, and a concluding sentence.

• Topic Sentence: The topic sentence tells you what the paragraph is going to be about. It is usually the first sentence of the paragraph.

Example: “Summer is my favourite season because of the warm weather and outdoor activities.”

• Supporting Details: These are the sentences that come after the topic sentence. They give more information, examples, or reasons related to the main idea in the topic sentence.

Example: “During summer, the sun shines brightly, and the days are longer. It is the perfect time for going to the beach, having picnics, and playing outdoor sports.” • Concluding Sentence: The concluding sentence is the suitable ending for your paragraph. It wraps up the main points and sometimes gives a final thought.

Example: “In short, summer brings joy and opportunities to enjoy nature and various outdoor activities.”

Q2. What is a sentence? Describe the four basic types of sentences in detail. Provide examples for each type.

A2. A sentence is a group of words that forms a complete thought, conveying a specific meaning. It is the basic unit of communication in written and spoken language. A sentence typically consists of a subject, which is what the sentence is about, and a predicate, which contains the verb and other words that provide information about the subject’s action or state. The four basic types of sentences—declarative, interrogative, imperative, and exclamatory sentences. • •

48

Declarative Sentences: Declarative sentences make statements or convey information. They end with a full stop. Example: “The sun rises in the east.” Interrogative Sentences: Interrogative sentences ask questions. They end with a question mark. Example: “Did you finish your homework?”


• Imperative Sentences: Imperative sentences give commands, requests, or instructions. They can end with a full stop or an exclamation mark.

Example: “Please pass the salt.”

• Exclamatory Sentences: Exclamatory sentences express strong emotions, excitement, or surprise. They end with an exclamation mark.

Example: “What a beautiful sunset!”

Q3. Rohan is writing a speech on the topic ‘Sustainable Development Goals’. He needs to deliver his speech in the school assembly. He needs your help in writing the speech. What are the tips that you would like to give him? A3. I would ask Rohan to remember that it is important that the paragraphs are coherent and well-structured. The tips given below would help him while constructing and writing paragraphs: • Unity: Ensure that all sentences in a paragraph relate to the main idea expressed in the topic sentence. Irrelevant information can confuse readers. • Coherence: Use transition words and phrases (e.g., “furthermore,” “in addition,” “however”) to connect ideas within a paragraph and make the text flow smoothly. • Order: Organise your supporting details logically. You can use sequential order, order of importance, or any other suitable pattern to structure your paragraph effectively. • Conciseness: Be clear and concise in your writing. Avoid unnecessary repetition or overly long sentences that may confuse the reader. • Variety: Use a mix of sentence structures and lengths to keep your writing engaging. Short, direct sentences can be followed by longer, more descriptive ones for variety. • Proofreading: Always proofread your paragraphs for grammar, punctuation, and spelling errors. Clear, error-free writing enhances your credibility.

Answer Key A 1. c

2. b

B 1. However

3. d 2. Nonetheless

3. Furthermore

4. Consequently

C 1. True

2. True

3. False. A sentence can be considered incomplete if it contains either a subject or a predicate, but not both. 4. False. An imperative sentence gives a command and ends with a full stop.

Chapter 5 • Basics of Writing Skills

49


Unit Reflection

Key Terms Articles: Articles are special words (a, an, the) that are used before nouns to specify whether we are talking about something in particular or something in general. Communication: It is the process of transmitting information from one individual or group to another, using various methods and media. Verbal Communication: It is the process of transmitting ideas and information about thoughts, feelings, and messages from one person to another using words. There are four types of verbal communication: • Oral Communication: It is a form of verbal communication that involves conveying information through spoken words and sentences. • Written Communication: It is a formal and structured mode of communication that uses written language to record and transmit information. • Intrapersonal Communication: It is essentially a private communication that happens entirely within our own minds and can be defined as ‘dialogue with oneself.’ • Interpersonal Communication: It allows individuals to effectively interact and exchange information with others in various personal, social, and professional settings. Non-verbal Communication: It refers to the messages and information that are conveyed without using words or spoken language; it includes expressing thoughts, ideas, and feelings through gestures, facial expressions, and body language. Visual Communication: It is the process of providing information, data, ideas, and thoughts through visuals and graphics. It only uses images, graphs, charts, videos, presentations, and other graphics to convey the message or information to other people or organisations. Decoding: It is the process by which the receiver interprets and understands the message sent by the sender. Effective communication: It means conveying ideas, thoughts, opinions, knowledge, and data clearly, and in a way that others can easily understand, leading to meaningful interactions. Encoding: It is the process of converting the sender’s thoughts and ideas into a form that can be understood by others. Face-to-Face: This type of communication occurs when two people interact with each other in person. Feedback: It is the response or reaction provided by the receiver to the sender’s message. It helps the sender understand the effectiveness of their communication and whether the intended message was understood accurately. There are three types of feedback: • Descriptive feedback: It is a detailed and specific input provided to an individual, focusing on their strengths and areas for improvement in their communication skills or work. • Specific Feedback: It focuses on the particular aspects of a person’s performance or communication skills and offers concrete suggestions for enhancement. • Non-specific feedback: It lacks details and fails to pinpoint areas for improvement, making it less actionable.

50


Phrases: A phrase is a group of words. Unlike sentences, phrases do not have both a subject and a predicate, so they do not express a complete thought on their own. Sentence: A sentence is a group of words that make complete sense on their own. It’s like thoughts captured in words. Declarative sentence: It is a sentence that states a fact or an argument and ends with a full stop (.). Interrogative sentence: It is a sentence that asks a direct question. Interrogative sentences always end with a question mark (?). Imperative sentence: Like declarative sentences, imperative sentences usually end with a full stop (.). Unlike declarations though, the subject (you) is understood and an imperative sentence makes a command or a request. Exclamatory sentence: A sentence that expresses strong feelings like surprise, wonder, sorrow, or happiness. It is a complete statement that ends with an exclamation mark (!). Transition words: Transition words, also known as linking words, are essential for creating smooth and coherent writing. They guide readers through your text, showing the logical relationships between ideas and signalling shifts in thought or direction. 7 Cs of Communication: Clarity: Messages should be clear, straightforward, and easy to understand. Conciseness: Being concise means conveying the message using a few words to make it brief and comprehensive. Concreteness: Being concrete means being very specific and using tangible examples to make your message vivid and convincing. Correctness: It pertains to the accuracy of your message in terms of grammar, spelling, punctuation, and factual correctness. Coherence: It involves organising your message logically and ensuring that the ideas flow smoothly from one point to another. Completeness: A complete message provides all the necessary information that the recipient needs to take necessary action or make informed decisions. Courtesy: It refers to the tone and manner in which a message is conveyed. There should be respect and consideration for the recipient’s feelings and opinions.

Things to Remember • Interpersonal communication can be further divided into three types: face-to-face communication, small-group communication, and public communication. • The communication cycle has various elements like the sender, message, encoding, channel, receiver, decoding, and feedback. • Feedback is a crucial element within the communication cycle. For communication to be effective, the feedback should be timely and appropriate. It can either be positive or negative. • Descriptive feedback must be goal-oriented, actionable, user-friendly, timely, continuous, and consistent. • The 7 Cs of communication help to ensure that a message is conveyed clearly and comprehensively. • A communication barrier is an obstacle that prevents the receiver from receiving and understanding the message that has been sent by a sender.

Unit Reflection

51


• The barriers to effective communication can be of many types, like linguistic, physical, interpersonal, organisational, and cultural. • There are various factors which can act as barriers in effective communication like lack of clarity, lack of feedback, distractions, cultural differences, power dynamics, technological issues, etc. • To engage in effective communication, one should take care of the following principles: simple language, definite purpose, completeness and concision, appropriate medium, authenticity, courtesy, active listening, and adaptability. • Every sentence can be broken down into two essential parts: a subject and a predicate. A subject in a sentence is a word or a group of words that tell the name of a person or thing that the sentence is about. A predicate in a sentence is the part of a sentence that tells what the subject is doing or what/who the subject is. • There are eight parts of speech in the English language: Noun, Pronoun, Adverb, Adjective, Verb, Preposition, Conjunction, and Interjection. • There are two main types of articles: Definite article (the) and Indefinite Articles (a/an). • A well-structured paragraph should include three elements: a topic sentence, supporting details, and a concluding sentence.

52


Test Your Knowledge A. Select the correct option. 1. What are the types of communication barriers? a. Linguistic, personal, private, public, and cultural. b. Linguistic, physical, interpersonal, organisational, and cultural. c. physical, mental, private, public, and linguistic.

d. interpersonal, emotional, private, public, and cultural. 2. Which of the following types of feedback focuses on the strengths and areas for improvement in communication? a. Negative

b. Descriptive

c. Non-specific

d. No feedback

3. Which of the following is an example of oral communication? a. Newspapers

b. Letters

c. Phone call

d. Email

4. A message is transferred from its sender to the receiver through a a. Decoder

b. Feedback

c. Channel

d. Encoder

.

5. Which of the following can be considered as a physical barrier? a. Two people communicating in different languages. b. Two people arguing at the office. c. Two people talking on the phone with a poor line connection. d. Two students giving speeches on the same topic but with different accents. 6. Which of the following is defined as dialogue with oneself? a. Intrapersonal communication

b. Oral communication

c. Public communication

d. Small-group communication

7. Which of these is an example of a Declarative Sentence? a. It is raining outside.

b. Who are you?

c. Please open the door.

d. Hurray! It’s raining outside.

8. Which of the following sentences has an adjective? a. Raj has a blue shirt.

b. He can speak Spanish.

c. She will go by train.

d. Meera can run fast.

9. Which of the following includes expressing thoughts, ideas, and feelings through gestures, facial expressions, and body language?

a. Verbal communication

b. Non-verbal communication

c. Visual communication

d. Interpersonal communication

Unit Reflection

53


means use of brief and comprehensive words to convey the message.

10. a. Clear

b. Completeness

c. Conciseness

d. Correctness

B. Fill in the blanks with the most suitable words. 1. Unclear or incomplete messages can lead to confusion,

, and misinterpretation.

2. An

barrier in communication refers to obstacles that arise due to the equation of the relationship

3. The

is the individual or group who decodes and interprets the message sent by the sender.

between two people.

4.

feedback is an indicator to the sender that there is a need to modify the mode of communication as

5.

communication is the process of providing information, data, ideas, and thoughts through pictures,

their ideas are not being communicated effectively. images, and info graphics.

6. Transition words are also known as 7.

words.

involves organising your message logically and ensuring that ideas flow smoothly.

8. Delivering a speech in public is an example of

communication.

C. State whether the following statements are True or False. Correct the statements that are false. 1. All regions have their own languages and not knowing them does not cause any hindrance. 2. A communication barrier is an obstacle that prevents the receiver from receiving and understanding the message that has been sent by the sender.

3. A message refers to the information, ideas, or thoughts that the sender wants to communicate to the receiver. 4. Feedback is an important component of an effective one-way communication. 5. Face-to-face communication is a type of communication when two people interact with each other in person. 6. Non-verbal communication refers to the messages and information that is conveyed by using words or spoken language. 7. We do not use ‘the’ before the names of newspapers. 8. Good communication helps people understand each other better, reducing confusion and mistakes.

D. Short answer-type questions. 1. Explain organisational barriers with an example. 2. Differentiate between encoding and decoding. 3. Define written communication. 4. Explain the two parts of a sentence with an example. 5. Describe effective communication.

E. Long answer-type questions. 1. What are the factors contributing to communication barriers? 2. Differentiate between specific and non-specific feedback. 3. What is non-verbal communication? State its advantages.

54


4. Define phrases. Give examples of each of the four types of phrases. 5. Explain the principles of effective communication.

F. Competency-based questions. 1. Professor Krishna teaches at Tamil Nadu University. He needs to deliver a speech at a university located in Delhi, North India.

But, Prof. Krishna is under-confident due to the language and cultural barriers. What, in your opinion, might be the actions that Prof. Krishna need to take?

2. Rakesh and Vinay, who are the senior employees of an organisation, are required to provide detailed feedback to a junior worker. What factors must they take into account before giving the feedback?

3. Prakshi has to appear for an interview for the role of sales manager. Although Prakshi is well-versed in her subject matter and

has good communication skills, what steps should she follow in the interview which can increase her chances of getting hired?

4. Moksh works for a multi national firm. He was asked to write a paragraph about teamwork so that other workers could read it and understand the value of teamwork. Moksh is confused about how he should structure his paragraph. What suggestions would you like to give to Moksh?

5. Some parts of the city of Raipur were being affected by the rising communal riots. The senior manager in a corporate bank advised employees who were from riot-affected areas to avoid coming to the office the next day. However, because the

information was shared with many people working at different levels, when it got to the employees, it was modified to a workfrom-home notice for everyone. What might have been the best course of action for the bank manager to follow?

Unit Reflection

55


Unit 2 • Self-management Skills II

6

Stress Management S

elf-management is the capability of an individual to manage their behaviours, thoughts, and emotions in a productive way that helps them to reach their goal and feel good about themselves. It enables a person to excel in both personal and professional spheres. When people can manage themselves well, they generally become more productive and content. An individual should understand his responsibilities and work towards fulfilling them on their own. For example, Vikas is a Product Manager at Prepare EdTech Co. He effectively manages himself to ensure productivity and happiness. He has a morning routine, he prioritises things in his to-do lists, keeps track of his time, and doesn’t get distracted easily. He sets his goals and achieves them; he connects with other people and aims to learn continuously. He also practices healthy living and as a consequence, gets sufficient time to spend with his family. Hence, self-management is an integral part of his life.

Elements of Self-management

Time Management The capacity of an individual to manage and allocate time to various tasks and responsibilities while minimising distractions and unproductive activities. Self-motivation It’s the internal drive and enthusiasm that prompts an individual to take initiative, set goals, and persistently pursue them. Self-awareness Self-aware individuals can reflect on their internal experiences and gain insight into their personality and skills. This will help them to make informed decisions. Stress Management The ability of an individual to handle their work efficiently and effectively even under pressure or difficulties. Decision Making The capacity to resolve issues, address the problems, and make rational decisions by considering all the factors involved. To Have a Goal It is essential for an individual to have a fixed goal and to continuously work towards achieving it. Personal Development new things.

A person should continuously strive hard and improve their existing knowledge and learn

56


Stress Management

Stress is an automatic physical, mental, and emotional response to a challenging and difficult event. It is a common phenomenon in everyone’s fast-paced life and can get triggered due to various personal and professional reasons. The threats, challenges, and difficult events causing an emotional disturbance or stress are called stressors. They can be self-induced or external. Few examples of stressors can be: 1. You are feeling unprepared for an examination. 2. You haven’t completed your project before the submission date. 3. You experience the loss of someone close to you. Various factors that contribute to stress are: • Personal Relationships

• Lack of Control

• Financial Issues • Societal or Peer Pressures • Health Concerns • Technology Overload • Greed for materialistic pleasures

• Bad Experiences

• Unrealistic Goals • Discrimination

Stress can cause anxiety, irritability, and other serious ailments like headaches, body pains, loss of appetite, heart-related issues, etc. It can impact your mental health severely. You can also lose your ability to concentrate properly and can start feeling lonely even in familiar surroundings. But we have to cope with it to lead a happy and fulfilling life.

Error Alert! It is a misconception that all stress is harmful. Stress necessarily does not have a negative impact on us. Positive stress, often referred to as “eustress,” can motivate and energise you to perform well and achieve goals.

An individual can experience eustress when they are quite confident about their abilities and it leads to a positive response. After coping with a situation, they feel a sense of accomplishment. For example, Richa had to submit her project before the deadline and she successfully achieved her goal. She had to manage her time well and organised her tasks efficiently. The situation was stressful but it motivated her to take up more challenges in life. The way in which we respond to stress and manage in today’s world is of utmost importance. Stress management refers to the different ways, strategies, techniques, and practices used to reduce, cope with, and ease the physical, emotional, and psychological effects of stress. There are a variety of mechanisms which can help you to deal with stress in your life in a better way. Stress management is about learning how to deal with tough situations in a healthier and calmer way, so we can feel better and stay balanced.

Importance of Stress Management

The importance of stress management lies in its ability to promote overall well-being and help individuals to effectively navigate through the challenges of life. These are a few reasons:

Improving Physical Health

Stress can have a negative impact on physical health as it can lead to high blood pressure, cholesterol, obesity, and other lifestyle diseases. It is important to manage your stress to remain physically fit.

Improving Mental Health

Stress can have an equal amount of negative impact on one’s mental health and can lead to depression, anxiety, and many other related issues. Thus, stress management can help you cope with mental health issues.

Chapter 6 • Stress Management

57


Cognitive Functioning

If you learn to manage your stress well, your cognitive skills, decision making abilities, problem-solving abilities, and rational thinking will not get hampered.

Productivity

Excessive stress can lead to decrease in one’s productivity as it leads to distraction and reduction in focus. Hence, stress management can help in making you more productive.

Relationships

High-stress levels can lead to strained relationships as people become irritable and are not able to communicate well. Thus, stress management is all the more important.

Quality of Life

Effective stress management definitely helps in improving one's quality of life. Destressing leads to improved communication and a better lifestyle, thus improving the quality of life.

Resilience

Learning how to manage stress builds resilience, enabling individuals to cope better with future challenges.

Emotional Regulation and Adaptability

Stress management also helps in regulating one’s emotions well. Thus, it improves your relationships and helps you to adapt to changing environments.

To Enhance Performance

Stress management has always helped individuals enhance their performance. When anyone is in better control of their emotions, they automatically perform better.

Tips to Manage Excessive Stress 1. Keep a positive attitude.

2. Assert your feelings, opinions, or beliefs instead of becoming angry, defensive, or passive. 3. Learn to manage your time more effectively. 4. Set limits appropriately and refuse requests that would create excessive stress in your life. 5. Create time for hobbies and interests. 6. Seek out social support. Spend enough time with your loved ones. 7. Reach out to a psychologist or other mental health professionals if you need any help.

Stress Management Techniques

It is common to encounter stressful situations in life. But there are various techniques and methods to manage our stress effectively so that such situations do not overwhelm us. Let us look at some of them: Physical Exercise It includes all the activities that help an individual maintain physical fitness, and mental wellbeing, and help improve their sleep. Engaging in physical exercises keeps us healthy, active, and helps to build immunity. Various organ systems of our body start functioning properly. We can indulge in various exercises, like running, jogging, dancing, cycling, swimming, aerobics, etc.

58


Here are a few benefits of doing exercises regularly: 1. Release of Endorphins: Physical activity triggers the release of endorphins, which are natural “feel-good” chemicals that reduce stress and improve our mood. 2. Reduces Stress: Exercise helps to lower the level of the stress hormone like ‘cortisol’, which leads to a decrease in stress and anxiety. An individual can also vent out negative emotions and feelings using vigorous exercises. 3. Enhances Coping Mechanism: Regular exercises build resilience and strengthen a person physically and mentally. Thus, people are able to cope better with stress in the long term. 4. Boosts Confidence: It helps an individual feel more confident by improving their body image. 5. Better Mood: Regular exercise can make you feel less worried and avoid daily life stressors. It’s like a natural mood enhancer.

Think and Tell

• Imagine sitting down in a quiet corner and listening to soft music at the end of a hectic day. How would you feel? • Is ‘all work and no play’ a right way to lead your life?

6. More Energy: Exercise gives you an energy boost, which is great when stress is making you feel tired. Yoga Yoga is a part of our culture and its popularity is growing considerably as people are experiencing various health benefits. Different physical postures, meditation, breathing exercises, and relaxation techniques are very useful in reducing stress. The yoga exercises that focus on slow movement, stretching, and deep breathing are best for lowering your anxiety and stress levels. It should be a part of your daily routine so that it can provide a positive impact, both physically and mentally. Here are a few benefits of doing yoga regularly: 1. Improves strength, balance, and flexibility of an individual. 2. Can help you manage stress and reduce stress hormones. 3. Relaxes your mind to help you sleep better. 4. Provides relief in back pain and can ease symptoms of various ailments, like arthritis, asthma, etc. 5. Promotes self-care and helps in keeping your emotions in control.

Did You Know? Laughing counts as an exercise and acts like a mini-workout. It aims to cultivate joy, engages various muscles, and helps you let go of stressors.

6. Ensures more energy, a sense of happiness, and brighter moods. Meditation Meditation gives a sense of calm and balance to an individual’s life. It has worked wonders for many people and has many benefits. You need to focus your attention on something calming, like an image or chant a mantra; it will lower your stress and anxiety considerably. It will help you relax and improve your sleep, energy levels, and mood. To meditate, you will need to have the following things in place: 1. Find a quiet place. 2. Get into a comfortable position. 3. Focus your attention on a word, image, phrase, object, or even your breath.

Chapter 6 • Stress Management

59


Here are a few of the most common benefits that people experience when they practice meditation on a regular basis: 1. Reduces stress and helps control our anxiety 2. Helps increase our concentration power and attention span 3. Promotes emotional health and doesn’t let you fall in the trap of negative thinking 4. Clears your mind and enhances your creativity and imagination 5. Helps us stay calm during stressful situations 6. Ensures that an individual becomes more self-aware 7. Improves the sleep cycle of an individual Enjoying Engaging in enjoyable activities is a wonderful way to improve your mental health and well-being. One should find time to indulge in hobbies, activities, and events that they enjoy the most. It helps us cope with stressful situations in daily life. Enjoying your life can help you with stress management by: 1. Mood Enhancement: Doing things that you enjoy releases positive chemicals in your brain, like endorphins. That will instantly boost your mood and reduce stress. 2. Stress Relief: Participating in activities you love shifts your focus away from daily life stressors. It provides a healthy distraction and lowers stress levels. 3. Provides a Necessary Break: Enjoyable activities give your mind a break from excessive worrying and overthinking, allowing you to relax and recharge. 4. Positive Emotions: Laughter and joy associated with enjoyable activities trigger the release of chemicals that counter stress hormones. 5. Reduced Tension: Engaging in activities that you like relaxes your tense muscles and alleviate physical symptoms of stress. 6. Escape from Routine: Indulging in fun activities can provide a break from your regular schedule and create an opportunity to refresh your mind. 7. Restored Energy: Having fun can provide a burst of energy that can help you combat fatigue, which often accompanies stress. Going for Vacations and Holidays Vacations and holidays with friends and family can provide a necessary break from the mundane routine of life. It provides an opportunity to break free from the hectic schedule and helps in slowing down the pace of one’s life. It helps an individual to indulge in refreshing experiences, come close to nature, strengthen bonds with family, and let go of their stress. Here’s why vacations are great for reducing stress: 1. Relaxation: Vacations offer a much-needed break from the monotonous routine, allowing you to relax and unwind, which can significantly reduce stress levels. 2. Change of Environment: Going to a new place can help you detach from your usual stressors and gain a fresh perspective on different things.

60


3. Disconnecting: Taking a break from work, emails, and social media during a vacation gives your mind a chance to rest and reduces information overload. 4. Physical Rest: Vacations usually involve more sleep and physical rest, which helps your body recover from stress. 5. Positive Memories: The memories you create during vacations will serve as positive anchors when you struggle to manage stress during difficult times. 6. Stress Hormone Reduction: Vacations can lead to decreased levels of stress hormones like cortisol and make you more relaxed. Taking a vacation, whether short or long, allows you to recharge both physically and mentally, ultimately helping you better manage and cope with stress when you return to your regular routine. Nature Walk It is important that one goes back to nature or at least be with nature from time to time. Nature is the besthealer. Taking a nature walk is a simple yet powerful stress management technique that involves walking in a natural environment, such as a park, forest, beach, or any outdoor space with greenery. Here’s why nature walk can help to considerably reduce stress levels: 1. Fresh Air and Oxygen: Being outdoors exposes you to fresh air and provides an abundance of oxygen, which can help clear your mind and improve your mood. 2. Natural Beauty: Surrounding yourself with the beauty of nature, including trees, mountains, and water bodies, can calm and soothe your mind. 3. Reduced Mental Fatigue: Nature also helps in reducing mental fatigue caused by constant screen time and mental demands, giving your brain a much-needed break. 4. Time for Reflection: Nature provides a peaceful setting where you can introspect and contemplate about various solutions to challenges. 5. Improved Mood: Exposure to natural sunlight can boost serotonin levels. It will promote feelings of happiness and reduce anxiety. 6. Technology Detox: A nature walk provides a golden opportunity to disconnect from screens and digital devices, reducing stress caused by external factors. A small amount of stress may be beneficial for us and help us stay motivated, but too much stress can interfere with our daily life. The inability to cope with stress can cause many health problems. Stress can be dealt with the help of the techniques discussed in this chapter.

Chapter 6 • Stress Management

61


Activity Time Activity 1: Let’s Exercise Together

(Group Work)

As we all know, stress has become a part of our daily life and we have to deal with such situations regularly. Your teacher

has suggested that it will be beneficial to conduct a few stress management exercises in the class daily for 10 minutes. Get in groups of four and propose one exercise each that can be conducted in your class and highlight its importance to your classmates.

Activity 2: A Wonderful Trip

(Individual Work)

You went on a trip with your family and friends during your summer vacations. It helped you to relax and spend some

quality time with your closed ones. Write an essay on how was your trip and recount a few memories from those days.

Chapter Checkup A Select the correct option.

1 Which is a stress management technique?

a Cycling b Watching TV all day c Chatting with others

d Spending excess time on social media

2 How can we manage stress effectively? a By having a negative attitude

b By creating time for our interests and hobbies c By worrying continuously

d By having no goal in life

3 How is nature walk helpful in making our mind calm? a By increasing mental fatigue

b By spoiling our mood

c By spending extra time on screens

d By giving us time to reflect on our actions B Fill in the blanks with the most suitable words. 1 Positive stress is referred to as 2

3 Exposure to

.

individuals have an ability to reflect on their internal experiences.

4 By being

can boost seroton in levels.

and not aggressive, one will be able to put across one’s feelings and thoughts properly.

C State whether the following statements are True or False. Correct the statements that are false. 1 Meditation helps in relaxing our body and mind.

2 Indulging in fun activities forces you to adhere to your regular routine. 3 Doing exercises regularly will improve your sleeping patterns. 4 Nurturing hobbies and interests are a waste of time. D Answer the following questions. (Solved)

Q1. What are the different stress management techniques an individual can use to de-stress themselves? A1. The various stress management techniques are as follows: • Physical Exercise

62


• Yoga

• Meditation • Enjoying

• Vacations with friends and family • Taking a nature walk

Q2. Why do you think vacations are important?

A2. Vacations can be very relaxing and rejuvenating. They provide a much-needed break from the mundane routine and hectic schedules. The reasons why vacations are important are as follows: • Vacations give you time to unwind and relax. • They help you connect with the nature.

• They also help you to disconnect from usual stressors and provide a digital detox. • Vacations with friends and family also provides physical rest to your body. • It gives you a chance to create positive memories.

Q3. Rahul is about to appear for his annual exams. He is studying very hard to score good marks. However, he is under a lot of stress due to his family’s expectations from him. What measures do you suggest he should undertake in order to appear for his exam without any stress? A3. Measures that can be undertaken by Rahul are as follows:

• Study regularly and avoid any last-minute preparations as it would lead to more stress.

• Time management is the key. Rahul should use his time judiciously and prepare/revise according to the time tables created by him. • Sleep well and have a proper diet.

• Arrange all the things required for the exam the previous night as it helps avoid any stress at the last moment. • Do not think too much about the expectations of your family as stress is not healthy for your mind. • Relax yourself by meditating daily as it will improve your concentration power.

• You can take a break for a short period by indulging in any activity that you love, like dancing or listening to music. It will allow you to relax and recharge yourself.

Answer Key A 1. a

2. b

B 1. eustress

3. d 2. Self-aware

3. natural sunlight

4. assertive

C 1. True

2. False. Indulging in fun activities gives you a break from your regular routine. 3. True

4. False. Nurturing hobbies and interests is very useful.

Chapter 6 • Stress Management

63


Unit 2 • Self-management Skills II

7 Ability to Work Independently I

n a professional setting, individuals get the opportunity to complete their tasks in two main ways: with a group of colleagues or all by themselves. When people work in a group, they learn to work as a team. This can be helpful because everyone brings different skills and ideas to the table. Working within a group encourages different perspectives and the sharing of responsibilities. People come up with creative solutions and new ways of doing things together. On the other hand, working on our own has its own advantages. When someone works independently, they have the freedom to make decisions and work at their own pace. An independent worker can concentrate deeply on their work without distractions. They also don’t have to wait for others’ opinions or approval, which can speed things up. It is important for individuals and organisations to think about what works best for their goals and preferences.

Group Work

Independent Work

Ability to Work Independently

The ability to work independently means being capable of completing tasks and responsibilities on your own, without needing constant guidance from others. It means that you have to make your own decisions and organise your work properly because only you are accountable for it. It will increase your confidence and self-esteem. 1. When you work independently, it helps you set and achieve your goals on time. It also helps you understand yourself better. 2. You become less dependent on others and also develop leadership qualities.

64


3. Time management is an essential aspect of independent work. You need to manage and organise your tasks effectively. 4. You become your own boss and learn to take initiatives. You have to pave a path to success for yourself. 5. For example, if you are given the responsibility to make a PowerPoint presentation on a project, you will learn to execute your skills efficiently. You have to bring your own ideas to the forefront and also manage your time well. If the presentation turns out well, it will boost your self-esteem and motivate you to grow further.

Characteristics of an Independent Worker

1. They are self-reliant and do not depend on others for approval or meeting deadlines. 2. They are very determined about their work and set their own goals. 3. They are self-motivated and push themselves to overcome challenges. 4. They have problem-solving and decision-making abilities as they encounter difficulties and seek answers on their own. 5. They are confident in their own actions and decisions. They develop an ability to handle their problems well.

Importance of the Ability to Work Independently Boosts Confidence

Increases Self-esteem

Makes You Accountable

Time Management

Improves Decision-making Skills Brings Out The Best In a Person

Boosts Confidence Working individually without any other support definitely boosts the confidence of an individual. You are like your own boss and do not have to follow anyone’s instructions. This will enhance your confidence and your ability to work, as you will gain more knowledge. Improves Decision-Making Skills An independent worker needs to take all the important decisions on their own to keep moving ahead. One cannot rely on other opinions and has to make bold and timely calls. This helps in building decision-making skills in an individual, as they know that it will only impact them in the future. Brings out the Best in a Person If you work alone, then you put in more effort to make your work stand out. You get the opportunity to express your ideas and thoughts without any obstacles. Thus, it brings out the best in you. The final work is the end result of the time and efforts you have put in. Makes You More Accountable If you are working without a team, then you are responsible for both accurate and inaccurate outcomes. You need to inculcate a sense of responsibility for your work and take full ownership of it, even if something goes wrong. Increases Self-esteem When people accomplish a goal on their own, it improves the way they think about themselves, and other people also perceive them in a different light. It boosts their self-esteem and makes them value themselves more. Enhance Time Management Skills Working independently also teaches you a very important skill—time management. You learn how to manage your things efficiently and organise your tasks in a proper manner so that there is no delay in producing the outcome.

Chapter 7 • Ability to Work Independently

65


To achieve self-independence, we need to hone the following three skills:

Self-awareness

Self-motivation

Self-regulation

Think and Tell List down all your hobbies and interests. Discuss how you will manage your hobbies and studies together.

Self-awareness

The ability to recognise and understand one’s own thoughts, feelings, behaviours, and qualities is referred to as self-awareness. It involves being aware of your own strengths and flaws, as well as your values, beliefs, and emotions. You will know how they influence your actions and interactions with others. A person is prepared to work towards his goal in an effective manner when he is aware of how he thinks and what he thinks. It also involves having a good understanding of one’s own identity, desires, and motives. Only then can individuals make more informed decisions. 1. It is the ability to recognise, focus on, evaluate, and overcome one’s own weaknesses and limitations. 2. It will help you develop a positive mindset and progress towards achieving your goals. 3. The most important step towards self-awareness is paying attention to our emotions, thoughts, and behaviour. 4. For example, Rohan has joined a new firm as a Communications Trainer. He has his first project and has to give training to the Sales Department. He is feeling nervous and under-confident. He starts to make a list of their strengths and weaknesses. Then, he spots the areas where more attention is required and prepares himself accordingly. This increased his confidence in his abilities and made him more self-aware.

Types of Self-awareness Type of Self-awareness Public self-awareness

Explanation When you are conscious of how you are perceived publicly by other individuals or society, you have developed public self-awareness. Some people behave in a certain manner that is acceptable in society, as they are aware that they are being evaluated by other people. Such individuals are called ‘pleasers.’ All individuals try to impress others with their actions and behaviour when they are aware that all attention is on them.

Examples If we have to give a speech on our organisation’s Annual Day event, we will be aware that everyone’s attention is on us, so we become conscious of how we speak, what we speak, and our body language.

This type of self-awareness can also be harmful, as individuals can become pressurised by the expectations of society. Private self-awareness

When you are conscious of how you behave about certain things or situations and how it will impact others. With this type of self-awareness, you are able to notice and examine your own thoughts, feelings, and motivations. All individuals are aware of their actions and can reflect on them personally. Others cannot easily observe what is going on inside their minds.

66

Even when we have properly revised everything the night before an exam, our hearts still beat fast as the examination time approaches.


We need to be self-aware publicly and privately because these two aspects are very important for our mental health. Our mental health gets hampered from unnecessary negative thoughts.

Steps to Improve Self-awareness

Think and Tell Imagine you had a very rough day at school, how will you make sure that your day ahead doesn’t go like that?

1. Meditation helps in knowing and relaxing your body and mind. 2. Journal writing helps you note down your emotions, feelings, strengths, and weaknesses. 3. One needs to learn to create boundaries in order to maintain a healthy body and mind. We should refuse if we do not feel comfortable. 4. In talk therapy, you can express your emotions, feelings, and insecurities to a professional or a close person. They can talk to you about both your positive and negative thoughts. 5. Expressing your thought process to other people is also important. No one will clearly know what goes on in your head until you tell them.

Error Alert! Why do I need to know myself? People frequently wonder why they need to know themselves. They feel they already know everything. However, when you begin to learn about yourself, you will discover a new aspect every time.

Self-motivation

Self-motivation refers to the internal drive and determination that inspire an individual to take actions, achieve goals, and put in efforts even when faced with challenges or obstacles. It is the ability to find inspiration and energy within oneself, rather than relying on others. A self-motivated individual always takes the lead, works hard, and pushes himself to achieve his goals. It’s like having your own cheerleader within your own mind, who encourages you to keep going and do your best. 1. It is a life skill that needs to be inculcated within every individual. 2. It can be seen as an inner force that motivates every person to work towards accomplishing their goals and living a meaningful life.

Chapter 7 • Ability to Work Independently

67


Types of Self-motivation Type of self-motivation

Explanation

Examples

Intrinsic self-motivation

Intrinsic self-motivation is the drive that comes from within to accomplish a particular goal by putting in a lot of effort and hard work.

When you practice your favourite sport without feeling burdened or tired even after getting up early in the morning.

This typically comprises a job or a hobby that a person finds enjoyable rather than a huge burden of work to complete. This, the process of completing a task more rewarding than the actual accomplishment. So, this motivation comes from within and the individual is not concerned about the rewards or appreciation that come along with it. Extrinsic self-motivation

When you want to learn a new skill, then you take out time from your hectic schedule.

The drive to achieve a particular goal that comes from outside is known as extrinsic self-motivation. An action is performed due to external motivations like power, money, or rewards.

When you study hard to get good grades because your father promised a new gift.

This usually refers to a task that a person performs solely due to external factors and without any genuine passion for it.

An employee works day and night for a project because it will be reviewed for his salary increment.

Every person likes when they receive appreciation for any task they have completed, and working only by keeping that in mind is extrinsic motivation.

Importance of Self-motivation

Self-motivation is a critical attribute that can significantly impact various aspects of life. It is a valuable trait that can empower individuals to lead successful and fulfilling lives. Goal Achievement Self-motivated individuals are more likely to set and work towards achieving their goals. They have a strong internal drive that drives them forward, even in the face of obstacles. Productivity and Efficiency Self-motivated people tend to be more productive and efficient in their work. They have the initiative to start tasks and the determination to complete them with high quality results. Resilience A self-motivated individual is more likely to bounce back and persevere at the face of setbacks or failures. This makes them resilient by nature. Personal Growth Self-motivation is a driving force behind personal growth and self-improvement. It encourages individuals to continuously learn, develop new skills, and seek opportunities for self-enrichment. Independence and Autonomy Self-motivated individuals are often more independent and self-reliant. They are less dependent on external factors like rewards or external pressure to take action.

Tips to Stay Self-motivated

1. Develop healthy practices for progress toward your goals. 2. Set SMART goals for yourself. Your goal should be specific, measurable, attainable, relevant, and time-bound. 3. Prioritize your work and avoid all the distractions that come your way. 4. Always be grateful and humble for what you have achieved. 5. Self-evaluation is very essential to assess one’s growth, weaknesses, and strengths. 6. Learn to manage your time and maintain a healthy lifestyle.

68


Self-regulation

The ability to control and manage your thoughts, emotions, and behaviours in different situations is referred to as self-regulation. When you practice self-regulation, you can calm yourself even when you’re unhappy, be patient even when things are difficult, and stay focused even when there are distractions. It is about controlling your own reactions, behaviours, and state of mind. It is about teaching your brain to process information before acting and not reacting in a hurried manner. 1. It is like having a control centre in your mind which helps you to regulate your feelings and make good decisions. 2. It helps you to focus on pursuing your goals without any distractions. For example, a person going through overwhelming emotions on their personal front does not let that overpower their professional commitments.

Importance of Self-regulation

Self-regulation is needed in various aspects of life, as it plays a vital role in personal development, mental and emotional well-being, and success in both individual and societal contexts. Emotional Well-being Self-regulation helps individuals manage their emotions effectively. It enables them to recognize and cope with stress, anxiety, anger, and other negative emotions, leading to improved mental health and overall well-being. Adaptability People with self-regulation skills are more adaptable to change. They can adjust to new situations, environments, and circumstances with greater ease. Ethical Decision-Making It helps people make ethical and moral decisions by considering the consequences of their actions and aligning them with their values. Stay Positive Self-regulated individuals look at the situations from a positive point of view. It helps them remain calm at time of stress. They consider every challenge as an opportunity to learn and improve their efforts. To Resolve Conflicts Self-regulation allows an individual to consider different opinions and empathise with colleagues and others they interact in the workplace. A self-regulated professional help in solving workplace conflicts without emotions guiding their decisions.

Error Alert! People will often misunderstand you as being selfish after you start working on yourself. But remember that it is always important to be a better version of yourself.

Activity Time Activity 1: Working Independently vs Working in a Group

(Group Work)

In a group, discuss whether you like to work individually or in a group. Then, prepare a chart on the pros and cons of working independently.

Activity 2: Role Play on Self-awareness

(Group Work)

Prepare a role play on ‘Self-awareness’ in the class within a fixed time period. Prepare a storyline and include all the steps taken to become a self-aware person. Students can volunteer for the roles. You cannot take the help of your teacher.

Chapter 7 • Ability to Work Independently

69


Chapter Checkup A Select the correct option.

1 Ability to work independently means

a completing one’s own responsibilities.

b completing others’ responsibilities.

c completing everyone’s responsibilities.

d completing one’s own and others’ responsibilities.

2 The capacity to be aware of one’s thoughts, values, and emotions is called a selfishness b self-awareness c motivation d discipline

3 Which of the following is NOT a step to improve self-awareness? a Journal writing

c Talk therapy

b Meditation d Fighting

B Fill in the blanks with the most suitable words. 1

is the process of writing down one’s thoughts and emotions to work upon them.

2

self-motivation is the drive that comes from within to accomplish a task.

3 The ability to control and manage your thoughts, emotions, and behaviours is called 4 The ability to work independently will

.

your confidence.

C State whether the following statements are True or False. Correct the statements that are false. 1 The ability to know yourself and your emotions is called selfishness. 2 There is no need to regulate your emotions.

3 Self-awareness, self-motivation, and self-regulation are essential skills that we need to hone if we want to work independently. 4 Meditation helps in relaxing your body and mind. D Answer the following questions. (Solved) Q1. What is self-regulation?

A1. Self-regulation is knowing one’s behaviour, emotions, and ideas, and controlling them for future objectives. It involves controlling your state of mind and the situations that upset you. It’s about teaching your brain to process information before acting. It places a strong emphasis on concentrating and pursuing goals, and helps in regulating emotional reactions and controlling them.

Q2. Differentiate all the three skills needed to work independently. A2.

70

Basis

Self-awareness

Self-motivation

Self-regulation

Definition

The ability to recognise and understand one’s own thoughts, feelings, behaviours, and qualities is referred to as self-awareness.

Self-motivation refers to the internal drive and determination that inspires an individual to take an action, achieve goals, and put efforts even when faced with challenges or obstacles.

The ability to control and manage your thoughts, emotions, and behaviours in different situations is referred to as self-regulation.

Examples

Writing down your strengths and flaws, so that you become more aware about yourself.

Learning a new skill on your own, being appreciated for doing good work, etc.

A person going through overwhelming emotions on their personal front does not let that overpower their professional commitments.


Q3. Nitesh is a senior in high school. He is the captain of the school basketball team, as well as a member of the school drama and debate clubs. As college admissions approach, Nitesh is unsure which course to pursue further because he is interested in all three. What is your opinion on Nitesh’s approach to resolving the problem?

A3. Nitesh’s involvement in the school basketball team, drama club, and debate club showcases his diverse interests and talents. This not only reflects his willingness to explore different areas but also exposes him to a variety of skills and experiences. All three aspects provide different learning, exposure, and experience. Moreover, Nitesh’s ability to manage multiple commitments shows that he possesses good time management and organisational skills. These skills are important in college, regardless of the path he chooses. His experience in managing different activities effectively could give him an advantage in adapting to the demands of college projects and extra-curricular involvement.

Firstly, Nitesh needs to be self-aware about his area of interest. He needs to reflect on the co-curricular activity that he wishes to pursue further. Then, he needs to start journalling about his strengths, weaknesses, likes, dislikes, and opportunities. Finally, he needs to know which of the interests motivates him internally and not externally. This will help him know about his interests and then, he can easily choose his course.

Answer Key A 1. a

2. b

3. d

B 1. Journal writing

2. Intrinsic

3. self-regulation

4. boost

C 1. False. The ability to know yourself and your emotions is called Self-awareness. 2. False. Regulating your emotions helps in achieving your future goals. 3. True 4. True

Chapter 7 • Ability to Work Independently

71


Unit Reflection

Key Terms Ability to Work Independently: It means being capable of completing tasks and responsibilities on your own, without needing constant guidance from others. Eustress: It is a positive stress that can motivate and energise an individual to perform well and achieve their goals. Extrinsic self-motivation: The drive to achieve a particular goal that comes from outside a person is known as extrinsic self-motivation. Intrinsic self-motivation: The drive that comes from inside a person to accomplish a particular goal by putting in a lot of effort and hard work. Private self-awareness: When you are able to examine and reflect on your own thoughts, feelings, and motivations, you have developed private self-awareness. Public self-awareness: When you are conscious of how you are perceived publicly by other individuals or society, you have developed public self-awareness. Self-awareness: The ability to recognise and understand one’s own thoughts, feelings, behaviours, and qualities is referred to as self-awareness. Self-management: It is the capability of an individual to manage their behaviours, thoughts, and emotions in a productive way that helps them to reach their goal and feel good about themselves. Self-motivation: It refers to the internal drive and determination that inspires an individual to take an action, achieve goals and put efforts even when faced with challenges or obstacles. Self-regulation: The ability to control and manage your thoughts, emotions, and behaviours in different situations is referred to as self-regulation. Stress: It is an automatic physical, mental, and emotional response to a challenging and difficult event. Stressors: The threats, challenges, and difficult events causing an emotional disturbance or stress are called stressors. Stress Management: It refers to the different ways, strategies, techniques, and practices used to reduce, cope with, and ease the physical, emotional, and psychological effects of stress.

Things to Remember • There are various elements of self-management, like time management, self-motivation, self-awareness, stress management, decision making, personal development etc. • Various factors that contribute to stress are personal relationships, financial issues, lack of control, unrealistic goals, greed for materialistic pleasures, bad experiences, technology overload, etc. • Stress management can help in improving our physical and mental health, enhancing our cognitive abilities, productivity, and the quality of life, and building resilience and emotional control.

72


• There are various stress management techniques, like physical exercise, meditation, yoga, enjoying our favourite activities, nature walks, and going for vacations. • An independent worker is self-reliant, determined, self-motivated, confident and possesses decision making abilities. • The ability to work independently boosts your confidence, improves decision making skills, makes you more accountable, increases your self-esteem, and teaches you how to manage your time effectively. • To achieve self-independence, we need to hone the three skills: self-awareness, self-motivation, and selfregulation. • A self-motivated person is able to work productively and efficiently with resilience to achieve their goals. They can work independently for their personal and professional growth. • Self-regulation is important to monitor one’s emotional well-being and to stay optimistic. A self-regulated individual is able to resolve conflicts with their ethical decision-making.

Unit Reflection

73


Test Your Knowledge A. Select the correct option. 1. Which of the following is not an importance of working independently? a. Boost in confidence

b. Improved decision-making skills

c. Increased self-esteem

d. Demotivation

2. What do you possess if you are conscious of how people will view you in public? a. Public self-awareness

b. Private self-awareness

c. Self-motivation

d. Stress management

3. Which hormone is often referred to as the ’stress hormone’ and is released due to excessive stress? a. Dopamine

b. Serotonin

c. Cortisol

d. Endorphin

4.

seem to be difficult.

is the internal force and determination that drives you to complete tasks which

a. Self-motivation

b. Self-regulation

c. Self-respect

d. Self-praise

5. What is stress management? a. Thinking about stressful situations

b. Coping with stress effectively

c. Ignoring stress

d. Avoiding stressful situations

B. Fill in the blanks with the most suitable words. 1. A self-motivated individual always takes the lead, works hard, and pushes himself to achieve his

.

2. The ability to control and manage your thoughts, emotions, and behaviours in different situations is referred to as .

3.

is about learning how to deal with tough situations in a healthier and calmer way.

4.

self-motivation is the drive to attain a specific goal that emerges from external motivations, such as

money or power.

5. Enjoying life works as mood enhancement and releases positive hormones, like

.

C. State whether the following statements are True or False. Correct the statements that are false. 1. Self-regulation helps to regulate your feelings and enables you to make good decisions. 2. Stress is an intentional physical, mental, and emotional response to a challenging and difficult event. 3. Independent workers are very determined about the work but someone else sets their goals. 4. Stress can have a negative impact on our physical health only. 5. Time Management is the capacity of an individual to manage and allocate time to various tasks and responsibilities.

74


D. Short answer-type questions. 1. What is intrinsic self-motivation? Explain with the help of an example. 2. In a Unit Test of grade 10, Rashika received low marks. She needs to keep herself motivated so that she can improve her performance in the next test. Define self-motivation and suggest some tips which can be followed by Rashika.

3. How can yoga help in managing stress?

E. Long answer-type questions. 1. Differentiate between the two types of self-awareness. Give an example. 2. Define Stress Management. What are the different ways in which you can manage your stress effectively? 3. What do you mean by the ability to work independently? Discuss its significance.

F. Competency-based questions. 1. Sakshi is a media manager at an advertising agency. She was initially very passionate about her work, but due to a lack of

acknowledgment and a heavy workload, she has recently started to lose interest in it and has no motivation. What steps can she take to motivate herself to do better at work?

2. Jay works as a manager in Mitali Pvt. Ltd. His job involves meeting tight project deadlines and dealing with a demanding workload. Lately, the pressure has been taking a toll on his mental and physical health. You are Jay’s friend and are

worried about him. You have decided to help your friend realise the need and importance of managing stress. What would you tell him?

Unit Reflection

75


Unit 3 • Information and Communication Technology Skills II

8 Operating Systems and File Organisation I

n the early days of computers, there were no operating systems, so every program had to be created with its own specific set of instructions, which made computing complex and time-consuming. Then, in 1956, General Motors developed an operating system for a single IBM computer, marking the first step towards simplifying computer operations. As the 1960s rolled in, IBM began incorporating operating systems into their computers, making computing more accessible and efficient. A significant milestone came with the introduction of UNIX in the 1960s, a revolutionary system that allowed multiple users to work on a computer simultaneously and was written in the C programming language. Microsoft also entered the scene later, playing a pivotal role in the evolution of personal computing by developing its own operating system. Today, virtually all major computer devices come equipped with operating systems, each possessing unique features and contributing to the diverse landscape of modern computing.

Operating System

An operating system, often called an OS, is like the boss of a computer. It’s the important software that helps your computer do its job smoothly. Think of it as the traffic police of your computer world, directing all the programs and making sure they work together without crashing into each other.

Functions of Operating System

Processor Management The operating system oversees the functioning of the processor by assigning tasks to it, ensuring that each process and application get sufficient processor time for proper operation. Memory Management The operating system handles the distribution of internal memory (like RAM, cache, etc.) among various applications to ensure smooth execution of each process. Device Management An operating system controls the operation of input and output devices, receiving their requests, performing specific tasks, and communicating with requesting processes. File Management The operating system maintains organized records of file actions, such as creation, deletion, transfer, copying, and storage. It also preserves data integrity and directory structures. Security An operating system employs various techniques to safeguard user data’s confidentiality and integrity, typically involving usernames, passwords, and firewalls. Error Detection The operating system periodically checks for external threats, malicious software, and hardware issues, alerting users when necessary. Job Scheduling In multitasking systems where multiple programs run concurrently, the operating system decides which applications run and in what sequence, also determining their allocated time.

76


Types of Operating System

Following are the different types of Operating System: Single-user Operating System These operating systems were designed to accommodate just one user performing a single task at a time. Among the most well-known single-user operating systems were Microsoft Windows 3.1, Microsoft Windows 95, and Microsoft DOS. Batch Operating System In a batch operating system, there is no direct interaction between the user and the computer. Instead, an operator is responsible for grouping similar tasks into batches. Multiple users can submit their jobs to the operator. It’s good for handling a large volume of work efficiently. Example: Early mainframe computers used batch processing for tasks like payroll processing. Graphical User Interface This operating system employs a graphical interface that encourages user interaction. Within this system, menus and icons facilitate all tasks, simply requiring a click to execute. This eliminates the necessity for users to recall complex commands or their syntax, as was necessary in the Command-Line Interface (CLI) or Character User Interface (CUI). Notable examples of GUI-based systems include the Windows operating system, the Mac OS, and Linux. Multi-user Operating System Multi-user operating systems enable multiple users to utilise the same computer simultaneously. Examples of operating systems falling into this category include Linux, Unix, and various versions of Microsoft Windows. Windows 2000 marked a significant milestone as the initial Windows iteration permitted users to establish multiple user accounts on a single machine. Multitasking Operating System Multitasking refers to the capability of handling multiple tasks simultaneously. A multitasking operating system can manage multiple processes using shared resources like the CPU. Multithreading Operating System These are operating systems that enable various components of an application or program to operate concurrently. Multithreading, a characteristic of such systems, can potentially lead to delayed response times for specific processes. For instance, if you host a game server on a local area network (LAN), your friends can connect to your machine simultaneously, allowing them to engage with different aspects of the same game. Real-time Operating System Real-time operating systems are super quick. They process user commands with minimal delay. Used in scenarios where rapid responses are crucial, like in aviation or medical devices. Example: Aircraft control systems often run on real-time operating systems. Time-sharing Operating System This type of operating system allows multiple users to use a computer simultaneously from different terminals. The goal is to minimize response times for users. Example: Unix-based systems offer timesharing capabilities, allowing multiple users to work on the same server.

Chapter 8 • Operating Systems and File Organisation

Did You Know? The first Graphical User Interface (GUI) operating system, called “Xerox Alto,” was developed in the 1970s at Xerox’s Palo Alto Research Centre (PARC). It introduced concepts like windows, icons, and menus, which later inspired the GUIs of popular systems like Windows and macOS. In essence, your computer’s familiar desktop environment can be traced back to the groundbreaking work done at Xerox PARC.

77


Distributed Operating System Distributed operating systems connect multiple systems, allowing them to share resources and work together. They use multiple central processors to serve real-time applications. If one system fails, it doesn’t affect others. Example: Google’s distributed operating system, known as the Google File System (GFS) and the MapReduce framework. These systems are designed to manage vast amounts of data across thousands of servers, allowing Google to perform tasks like web indexing and data analysis on an immense scale.

Think and Tell

Imagine a world where each operating system is a character with its own unique superpower. For example, one OS can organise information super-fast, another can protect against viruses, and yet another can create amazing graphics. If these operating systems were superheroes in a computer universe, what adventures and challenges might they face? How would they work together to keep the computer world safe and efficient? Let your imagination run wild and tell us a story about these OS superheroes and their exciting journeys in the digital realm.

Windows 11

Windows 11, launched on October 5, 2021, represents Microsoft’s latest iteration of its personal computer operating system. While it maintains the underlying foundation of Windows 10, Windows 11 introduces a fresh user interface and various novel functionalities. Notable enhancements encompass a reimagined Start menu, updated snap controls for multitasking, and the inclusion of virtual desktops. It’s worth noting that Windows 11 brings revised system requirements into play, meaning that not all devices compatible with Windows 10 can accommodate Windows 11.

Starting Windows

When you power on your computer, Windows starts automatically and shows a welcome screen with a login message. Subsequently, you’re greeted by the initial Windows screen, referred to as the Desktop, which showcases graphical symbols known as icons.

ICONS DESKTOP

START BUTTON

78

Fig. 8.1: Windows 11 Interface


Desktop The term ‘Desktop’ draws its inspiration from the physical desk in your workspace, where you typically keep items like a pen holder, notepad, calculator, and files. Similarly, the Windows desktop replicates this concept by displaying icons such as shortcuts, documents, and disk drives for easy access. Icons Icons are the small graphical symbols you see on your computer screen, and they allow users to perform various tasks by double-clicking on them. Each icon corresponds to a specific program. Menu In a Graphical User Interface (GUI), menus are used to help users find information and execute program functions. A menu is a structured collection of options related to a particular operation. Taskbar The taskbar is a horizontal bar usually located at the bottom of the desktop. It has several sections:

Fig. 8.2: Taskbar in Windows 11

1. Start Button: Found at the bottom-left corner, clicking it opens the Start menu, where you can access various tasks like launching programs, searching for files, and shutting down the computer. It also provides quick access to File Explorer, Settings, and frequently used apps. 2. Middle Section: This part displays buttons for currently open programs, making it easy to switch between them with a single click. Active programs are highlighted. 3. Notification Area: Located on the right side, it shows the system date and time along with icons that provide information and notifications about various aspects of the computer, such as software updates, network status, battery life, and volume control. The Peek button on the extreme right minimizes all open program windows to reveal the desktop.

Difference Between Menu, Icon and Taskbar Feature

Menu

Icons

Taskbar

Definition

A digital menu card for your computer’s programs and options.

Tiny pictures or symbols representing programs, files, or folders on your screen.

A bar usually at the bottom of your screen that helps manage open programs.

Purpose

Helps you find and open programs and options easily.

Visual shortcuts for quick access to programs and files.

Manages open programs and allows you to switch between them quickly.

Function

Lists all available programs and options on your computer.

Represents programs, files, or folders visually.

Displays icons for open programs and provides quick access to them.

Example

Imagine it’s like a restaurant menu, showing all the dishes you can order.

Think of them as road signs on your computer screen that help you find what you need.

It’s like having a personal assistant on your computer desk, keeping things organized.

Usage

You use it to open programs and access various computer functions.

Click on icons to open programs, files, or folders without reading long names.

Helps you switch between different tasks or programs you’re working on.

Chapter 8 • Operating Systems and File Organisation

79


File

A file is like a digital document that can store information, data, or programs on a computer. It can hold text, images, music, and more. Just like you keep your school assignments in folders, a computer uses files to store and organize information. Each file has a unique name and a specific type, like a document (e.g., a Word file) or a picture (e.g., a JPEG image). Files help computers understand and manage the data they store. Example: Think of a file as a digital version of a book. A book can contain stories, pictures, or information, and you can give it a title like “My Vacation Photos.docx.”

File Operations

File operations are actions you can perform on files, like creating, opening, saving, copying, moving, or deleting them. When you work on a computer, you use these operations to manage files. For instance, you create a new document, open an existing photo, save changes you made to a file, copy a song to another folder, move a video to a different drive, or delete a file you no longer need. Example: Imagine you’re working on a project. You create a new file to write down your ideas, open it to edit, and save it when you’re done. These are file operations in action. File Operation

Explanation

Example

Create

Making a new file or folder.

Creating a new Word document.

Open

Accessing and viewing an existing file.

Opening a PDF to read its contents.

Save

Storing changes made to a file.

Saving edits made in a text document.

Copy

Duplicating a file or folder.

Copying a photo to create a backup.

Move

Relocating a file or folder to a different location.

Moving a video from one folder to another.

Delete

Removing a file or folder from the system.

Deleting a document you no longer need.

Rename

Giving a new name to a file or folder.

Renaming a file from “File001” to “Report.”

Properties

Viewing and changing file attributes like size, date, and author.

Checking the properties of an image file.

File Organisation

File organisation refers to how files are structured and arranged on a computer’s storage, like in folders and drives. Just like you use folders or drawers to organise your belongings, a computer uses folders to organise files. Files can be grouped into folders based on their type or purpose, making it easier to find and manage them. Example: Think of file organisation as arranging your school assignments in subject-specific folders. You have a “Math” folder for maths-related papers and a “Science” folder for the science-related ones.

Directory Structures

A directory structure is the way folders and subfolders are organised on a computer to create a hierarchy. Imagine a tree with branches. The main folder is like the tree trunk, and subfolders are like branches. This structure helps you organise and access files efficiently. You can have folders within folders to create a hierarchy. Example: Picture your computer’s directory structure as a tree. The “C:” drive is the trunk, and you have branches like “Documents,” “Pictures,” and “Music.” Inside “Documents,” you might have sub-branches like “Work” and “School.”

80


Difference Between File and Folder Feature

File

Folder

Definition

A digital document or data item that can contain text, images, programs, or other types of data.

A container used to organise and store files and other folders.

Purpose

Stores and manages specific data or content, such as a text document, image, or program.

Provides a way to group and organise related files and subfolders together.

Content

Contains data or information, such as text, images, audio, video, or executable code.

Contains files, subfolders, or a combination of both. It does not hold data directly but organises it.

Representation

Typically represented by an icon with a specific file extension (e.g., .txt, .jpg, .exe).

Usually represented by a folder icon, and its contents are visible when opened.

Example

Examples include a Word document (document.docx), an image (photo.jpg), or a music file (song.mp3).

Examples include a “Documents” folder, a “Pictures” folder, or a “Projects” folder.

Usage

Used to store and manage specific data or content. Files are the building blocks of digital information.

Used to organise and group related files and folders to maintain an orderly digital workspace.

Actions

Files can be opened, edited, copied, moved, renamed, and deleted.

Folders can be created, opened, copied, moved, renamed, and deleted.

Hierarchy

Typically, files are organised within folders

Folders themselves can be organised hierarchically within other folders.

File System Structures

A file system is the underlying software that manages how files and directories are stored and accessed on a computer’s storage device. Think of the file system as the rules that govern how files are saved, organised, and retrieved. Different operating systems (like Windows, macOS, or Linux) have their own file systems with their own set of rules. Example: It’s like the foundation and framework of a building. Without a proper structure (file system), the files and folders (the building’s rooms and floors) wouldn’t be organised or accessible.

Remember

File Operations: Actions like creating, opening, saving, copying, moving, and deleting files. File Organisation: Structuring files within folders and drives for easy management. Directory Structures: Hierarchical arrangement of folders and subfolders for efficient organisation. File-System Structures: Underlying software governing file storage and access, unique to each OS.

Creating a New File

To create a new file, think of it like starting a new document or drawing. You need an application, such as OpenOffice Writer, Microsoft Word or Notepad (for text) or Paint (for images).

Select the application to create a file

To create a new file on your desktop, follow these steps: 1. Right-click on an empty area.

2. F rom the menu that appears, choose the New option. You’ll then see a list of file types and applications, like MS Excel, MS Word, OpenOffice Writer, or any other application. Pick the one you need. 3. Enter a file name where the cursor is and press Enter, and a new file will be generated. Chapter 8 • Operating Systems and File Organisation

Fig. 8.3: To create a new file

81


Creating a New Folder

Imagine a folder as a digital container where you can keep your files organised.

Click here

To create a new folder on your desktop, follow these steps: 1. Right-click on an empty area. 2. From the menu that appears, choose the New option. You’ll then see the option Folder. 3. Click on Folder, and a new folder will be generated.

Renaming a File/Folder

Renaming a file or folder can be done in various ways: 1. Right-click on the file or folder, choose the Rename option from the context menu, then type the new name and press Enter.

Fig. 8.4: To create a new folder

2. Open “This PC” by double-clicking the icon. 3. Navigate to the location of your file or folder in the left panel. In the right panel, select the file or folder, and then click on the “Rename” command in the “Organize” group on the Home tab. 4. Type the new name and press Enter.

Deleting a File/Folder

To delete a file or folder, there are several methods you can follow:

Click here

1. Select the file or folder you want to delete and press the Delete key. 2. Right-click on the file or folder, then choose the Delete option from the context menu. 3. Use the This PC icon method: • Double-click on the This PC icon to open it. • Navigate to the location of your file or folder in the left panel. • Select the file or folder in the right panel.

82

Fig. 8.5: To rename a file

Error Alert! Misconception—File Deletion is Permanent! It’s a common misconception that when you delete a file on your computer, it’s gone for good and there’s no way to get it back. But don’t panic just yet! Computers are smarter than that, and they have a special place called the “Recycle Bin” to give you a second chance.


• Click on the Delete command in the Organize group on the Home tab.

Click here Fig. 8.6: To delete a file

Restoring a File/Folder

Step 1: Locate the Recycle Bin. The Recycle Bin is like a digital safety net for deleted files. You can usually find it on your desktop or in your file explorer. Step 2: Double-click on the Recycle Bin icon to open it. Inside, you’ll see a list of files and folders that you’ve deleted. Step 3: Look through the Recycle Bin list to find the file you want to restore. It might be hiding among other deleted items. Step 4: When you’ve found your file, double-click on it. A dialog box will appear. Choose “Restore.” This action will your file back to its original location.

Click here

Step 5: Go back to where your file was originally saved (like, your “Documents” folder) and make sure it’s back in its rightful place.

Fig. 8.7: To restore the deleted file

Chapter 8 • Operating Systems and File Organisation

83


Permanently Deleting a File/Folder

To permanently remove all items from the Recycle Bin, you can take either of these actions: 1. Right-click on the Recycle Bin icon and choose Empty Recycle Bin. You will be prompted to confirm the permanent deletion of the files. Click on Yes to proceed. 2. Double-click on the Recycle Bin icon on your desktop to open it. Then, click on Empty Recycle Bin in the Manage group on the Recycle Bin Tools tab to permanently delete all deleted files and folders.

Click here to delete all the files of Recycle Bin

Fig. 8.8: To empty Recycle Bin

Moving or Copying a File/ Folder from One Drive to Another

Moving a file or folder involves relocating it from its original place (source) to another location (destination). Copying, on the other hand, means making a duplicate of the selected file or folder. To perform a move or copy action on a file or folder, follow these steps:

Options for copying/moving a file

1. Double-click on the “This PC” icon on your desktop. 2. Choose a location from the left pane where you want to move or copy the file/folder. 3. Select the specific file or folder you wish to move or copy from the right pane.

84

Fig. 8.9: To copy/move a file


4. Use one of the following methods to move or copy your file/folder: • Select Copy and choose the destination to copy the file to. • Right-click the file/folder and select Cut to move it or Copy to make a duplicate. Then, right-click an empty area in the right pane and choose “Paste” from the menu to select your desired location. • You can also press Ctrl+X to move or Ctrl+C to copy the selected file/folder and then press Ctrl+V at the destination where you want to move or copy it.

Importance of Managing Files and Folders

Managing files and folders is crucial for maintaining order, efficiency, and data security in the digital age. It’s a fundamental skill that can save you time, prevent headaches, and ensure your digital assets remain accessible and protected. 1. Organisation: Proper file and folder management helps you keep your digital life organised. It’s like tidying up your room or arranging your books on a shelf. When files are well-organised, you can quickly find what you need without wasting time searching. 2. Efficiency: An organised file structure boosts productivity. You can work more efficiently because you know where to locate your documents, photos, or projects. This reduces frustration and helps you complete tasks faster. 3. Preventing Data Loss: Good file management reduces the risk of losing important data. When you organise files into folders and regularly back up your files, you have a safety net in case of computer crashes, hardware failures, or accidental deletions. 4. Accessibility: Properly organised files and folders make your data accessible from various devices and locations. You can access your work documents, photos, or music whether you’re on your computer at home, on a work computer, or using a mobile device. 5. Collaboration: When working with others, an organised file system makes it easier to collaborate. You can share specific files or folders without confusion, and everyone involved knows where to find and save their contributions. 6. Data Security: Organised file management can enhance data security. You can protect sensitive files by placing them in password-protected folders or encrypting them. It also helps you keep track of what’s important and needs safeguarding. 7. Saving Space: Managing files and folders efficiently can help you save storage space. You can delete unnecessary files and keep your computer running smoothly. 8. Backup and Recovery: When you have a structured file system, it’s easier to back up your data regularly. In the event of data loss, you can quickly restore your files from backups.

Activity Time Activity 1: Taskbar Exploration and Icon Hunt

(Individual Work & Class Discussion)

Identify and list five icons on the taskbar and describe their functions. Participate in the discussion on the significance of the taskbar and icons based on the findings.

Activity 2: File and Folder Management Adventure

(Individual Work & Class Discussion)

Perform actions like creating a new folder, renaming a file, deleting a folder, and saving a file within a specific subfolder. Finally, share your experiences and troubleshoot challenges faced during the activity. Activity 3: Recycle Bin Rescue Challenge

(Individual & Group Work)

Delete a file from your computer and try to access and restore it from the Recycle Bin. Finally, in a group of four to five students, discuss the importance of the Recycle Bin in preventing permanent file deletion.

Chapter 8 • Operating Systems and File Organisation

85


Chapter Checkup A Select the correct option.

1 Which type of operating system allows multiple users to use a computer simultaneously from different terminals with the goal of minimising response times? a Real-Time Operating System c Batch Operating System

b Distributed Operating System

d Time-Sharing Operating System

2 Which action involves relocating a file or folder to a different location?

a Copying b Opening and Editing c Creating d

3 What makes a folder different from a file?

Moving

a It can store various types of data.

b It usually has a specific file extension.

c It contains files, subfolders, or both.

d

B Fill in the blanks with the most suitable words. 1 An operating system is like the smoothly.

2 The first operating systems emerged in operations.

It can be opened, edited, and deleted.

of a computer, directing all the programs and ensuring they work together , marking a significant step towards streamlining the computer

3 Real-time operating systems are used in scenarios where rapid responses are crucial, such as in medical devices.

or

4 To create a new folder, right-click on a file explorer window or on your desktop, choose “New,” and then select

.

C State whether the following statements are True or False. Correct the statements that are false. 1 Files can store various types of data, including text, images, music, and programs.

2 The taskbar helps manage open programs and allows quick switching between them.

3 File operations include actions like creating, opening, saving, copying, moving, and deleting files.

4 File organisation involves arranging files within folders and drives to make them easier to find and manage. D Answer the following questions. (Solved)

Q1. What is the purpose of a file system structure in an operating system?

A1. The purpose of a file system structure in an operating system is to govern how files and directories are stored and accessed on a computer’s storage device. It defines the rules for organising, naming, and managing files. Different operating systems have their own unique file systems, ensuring efficient storage and retrieval of data.

Q2. Explain the role of the Recycle Bin in managing deleted files on a computer.

A2. The Recycle Bin is a digital safety net for deleted files. When a file is deleted, it is not permanently removed but moved to the Recycle Bin. Users can open the Recycle Bin, locate the deleted file, right-click on it, and choose “Restore” to return the file to its original location. This feature helps prevent accidental data loss and provides a second chance to recover deleted files.

Q3. Rohan is using his uncle, Mr Rakesh’s desktop, when he notices the poor manner in which his uncle organises his files containing personal and professional details. Rohan decides to explain to his uncle that organising his files would lead to data security. What should Rohan say to his uncle?

A3. Rohan should educate his uncle that proper file organisation can enhance data security by enabling users to categorize and protect sensitive files within password-protected folders or encrypted storage areas, thereby reducing the risk of unauthorized access.

Answer Key A 1. d

2. d

3. c

B 1. boss

2. 1956

3. aviation

4. Folder

C 1. True

2. True

3. True

4. True

86


Unit 3 • Information and Communication Technology Skills II

9 Care and Maintenance of Computer T

aking proper care of our things, whether they are books, clothes, furniture, or electronic gadgets, is of extreme importance. It is important to ensure the smooth operation of electronic devices, such as computers and mobile phones. As we maintain our personal hygiene through daily routines like bathing, brushing our teeth, and eating, we must also realise the importance of the regular maintenance of our machines. Computers are complex devices with many delicate electronic components that require protection from dust and potential damage. Neglecting their maintenance can result in reduced efficiency. Considering the expense associated with computers and mobile phones, it becomes essential to take consistent and vigilant care of them.

Computer Maintenance

Computer maintenance means ensuring that computers are well-maintained to function properly. This maintenance can be categorised into two parts: Hardware maintenance and Software maintenance.

Hardware Maintenance

Hardware maintenance involves taking care of the physical parts of a computer, like the monitor, keyboard, CPU cabinet, mouse, and any additional devices connected to it. You need to ensure that these components work well by cleaning them, storing them correctly, and fixing them when needed. Cleaning of the Hardware Components Properly maintaining your computer is essential for its smooth operation. If you avoid cleaning and caring for your computer, dust can build up, which will lead to decreased performance. To keep your computer running well, stick to these guidelines for cleaning its different hardware parts. Monitor 1. Use a gentle and damp cotton cloth for cleaning. 2. Never spray any liquid directly onto the screen, and refrain from touching it with your hands. 3. Use a pointer or stylus to prevent potential damage to your computer screen.

87


Keyboard 1. You can use compressed air, a soft brush, or an anti-static vacuum cleaner to remove dust from the keyboard. 2. Avoid eating while using the computer to prevent food particles from getting stuck between the keys, which could harm it. 3. In cases of severe dirtiness, you might have to physically remove and clean the keys. 4. To clean the top surface of the keys, a soft, damp cloth is suitable for removing oil and dirt. Mouse 1. When dealing with a mechanical mouse that contains a ball beneath it, it is more prone to gathering dust. 2. In such cases, you might have to open the mouse and take out the ball. Dip it in isopropyl alcohol to eliminate dust, oil, or grease. 3. For an optical mouse, a simple wipe from both above and below using a clean cotton cloth is sufficient. CDs and DVDs 1. Always store CDs and DVDs in their appropriate cases to keep them safe against scratches. 2. Avoid touching the surfaces with your hands. 3. To clean the CD surface, you can apply a specialised cleaning solution to a cotton cloth and gently wipe the CD. CPU Cabinet 1. Make sure to clean both the exterior and interior parts of the CPU cabinet. 2. Use a soft cotton cloth to wipe the outer surface, and do not forget the back. 3. Inside the cabinet, use a blower to remove dust, but be cautious not to touch the small components on the motherboard. Digital Camera 1. Avoid touching the lens of the camera. 2. Use a soft brush or dry cotton cloth to eliminate dust. 3. You can also use a specific cleaning solution for the lens, but never directly apply it to the lens.

Software Maintenance

Software maintenance refers to the cleaning of computer programs. This includes tasks like scheduled disk cleaning, protection against viruses, removing temporary and unnecessary files, creating backups regularly, updating software, and checking for security threats. Virus Computers and data are crucial for any organisation’s operations. If something goes wrong with computers or data, it will cause business activities to stop, resulting in the loss of many hours of hard work and research. A computer virus is a program or set of programs that interrupts a computer’s normal functioning and can infect or destroy data. It enters a computer without the user’s permission or knowledge, at times through infected storage devices like CDs or pen drives, and can even enter while browsing the internet. To avoid detection, these viruses hide silently. They can remain undetected and inactive for a long time, waiting for a specific signal or event to activate them.

88


Signs of Virus Attack Signs of a virus attack on a computer can be identified in several ways:

Did You Know? The full form of Virus is Vital Information Resources under Siege.

1. Slowing down the computer by consuming memory 2. Causing unusual movements or patterns on the screen 3. Displaying strange messages like “Your PC is stoned,” and more 4. Increasing disk space usage and file sizes as the virus attaches itself to many files 5. Resulting in frequent system freezes 6. Showing abnormal ‘write protect error’ messages 7. Changing data in the directory against the filename when a virus modifies a file 8. Formatting the hard disk 9. Deleting or damaging files Protecting Computer Against Virus Virus attacks can harm not only your data but also the functioning of your computer. Malware attacks can result in modified files, frequent disruptions, reduced speed, and more. Therefore, it is important to ensure your safety online. 1. Use Security Software: Install trustworthy antivirus software and keep it updated. Set it to regularly scan and isolate potential threats. 2. Employ Firewalls: Configure your web browser settings to block access to unwanted websites. 3. Be Cautious Online: Exercise caution when sharing information online. Use secure websites for financial transactions, avoid saving personal data on websites, and restrict yourself from downloading software from unauthorized sources. 4. Update Software: Keep your computer’s software and applications up-to-date to patch security vulnerabilities. 5. Beware of Spam: Delete emails from unknown sources without opening them or downloading attachments. 6. Backup Your Data: Regularly back up your data to protect against loss and use encryption software to secure it. 7. Scan Portable Devices: Before using USB drives or other portable storage devices, scan them for viruses. 8. Disable Cookies: To protect your personal information, consider disabling cookies in your web browser. Using Antivirus Software Antivirus software is a set of computer programs that are created to find, prevent, and delete viruses from a computer. They perform these tasks: 1. Check computer files for known viruses by comparing them to a virus dictionary. 2. Recognise unusual behaviour in computer programs that could indicate an infection.

Chapter 9 • Care and Maintenance of Computer

Think and Tell Which is the largest and most complex virus known?

89


However, merely installing antivirus software does not guarantee complete protection because it cannot detect new virus programs. To stay safe, you should regularly update your computer with the latest antivirus software versions. Most antivirus companies allow users to download these updates from their websites. Some well-known antivirus programs include Quick Heal, Norton Antivirus, Avast One, and AVG Antivirus. Process of Cleaning Virus Given below is the process that is followed to scan a system for various kinds of viruses and malwares.

Scanning and Cleaning Virus The steps to use an antivirus software are as follows: We will study the steps for McAfee antivirus software here, but you can use any antivirus software that you have, like Norton, AVG, Avast One, etc., on your computer. To open McAfee antivirus, follow these steps: 1. Go to Start and search for McAfee Security Scan Plus. 2. The McAfee window appears.

Did You Know? The first antivirus software was invented in 1987 by Andreas Luning and Kai Figge.

Think and Tell Can Antivirus programs detect every virus?

3. Click on the Scan option, and it will scan your system within a minute. 4. If it detects any threat, then it will also ask for your permission to fix the issue.

Preparing a Maintenance Schedule Maintaining a computer system is often overlooked, which can lead to equipment damage and even accidents. To prevent this, it is important to create a maintenance schedule covering daily, weekly, monthly, and yearly tasks. Disk Defragmentation and Optimisation When you save files on your computer, they may not be stored in contiguous memory locations, resulting in fragmented data that slows down your system. To address this issue, regularly run the Disk Defragmenter utility program.

90


To start defragmentation: 1. Click on Start > All Apps >Windows Tools > Defragment and Optimize Drives.

2. In the Optimize Drives dialog box, select the partition you want to optimise (e.g., Drive C:). 3. Click Optimize to improve your computer’s efficiency.

You can also schedule disk optimisation by following these steps:

1. Click on the Change settings button in the Optimize Drives dialog box. 2. The Optimization Schedule window appears. 3. Check the box next to “Run on a schedule (recommended).”

4. Choose the frequency for running the Optimize Drives program: Daily, Weekly, or Monthly.

5. Click the Choose button in the Drives option to select the disk you want to optimise, or you can choose all partitions.

6. Click OK and then Close to save your Optimize Drives settings. Your computer will now run the optimised schedule based on this schedule, so make sure it is powered on during these times. Chapter 9 • Care and Maintenance of Computer

91


Removing Temporary Files Sometimes you may have noticed that your computer is working very slowly. It can happen due to the temporary internet files that need to be deleted from your computer regularly. To delete these files, follow these steps: 1. In the Search box on the taskbar, type “disk cleanup”, and select Disk Cleanup from the list of results. 2. Select the drive you want to clean up, and then select OK. 3. Under Files to delete, select the file types to get rid of. To get a description of the file type, select it. 4. Select OK. If you need to free up more space, you can also delete system files: 1. In the Disk Cleanup dialog box, select Clean up system files. 2. Select the file types to get rid of. To get a description of the file type, select it. 3. Select OK. By following these steps, you can effectively set up an optimisation schedule for your computer and remove unnecessary temporary files to keep it running smoothly. To delete temporary files using an alternate method: 1. On the taskbar, enter %temp% in the Search box. 2. Click on the %temp% file folder that appears. 3. The b folder with temporary files will open. 4. Highlight all the files by using the Ctrl+A key combination. 5. Hit the Delete key. 6. This action will remove all the files from this folder. Removing Spam from an Email Account Spam, or unwanted emails, arrive from unknown senders, and they are generally related to advertising, spreading harmful software, attempting phishing, and sometimes containing inappropriate content. If you open these spam emails, there’s a risk of your system getting infected by a virus or your personal information being compromised. To protect users, nearly all email services offer a filter feature that stops spam messages from reaching your main inbox. Now, let us talk about how to use a filter in your Gmail account. Creating a Filter To make a filter in your Gmail account that automatically moves suspicious emails to the spam folder, follow these steps: 1. Log in to your Gmail account. 2. In the Search bar at the top, click the Filter option. 3. A pop-up box will appear. 4. Set the criteria for creating the filter. 5. Click on the Create filter option. Another pop-up box will show different choices. 6. Choose the relevant option and click the Create filter button.

92


Creating a Filter for a Particular Email Account To create a filter for a specific email account in Gmail, use these steps: 1. Log in to your Gmail account. 2. Select the checkbox next to the email for which you wish to create a filter. 3. Above, click on the More icon, which will open a pop-up menu. 4. Choose the option Filter messages like these.

Chapter 9 • Care and Maintenance of Computer

93


5. A pop-up box will appear where you can specify the filter criteria. 6. Select the relevant options and click the Create filter button. Deleting Spam To remove spam messages from your Gmail account, follow these steps: 1. Access your Gmail account. 2. On the left-hand pane, click the More option and select Spam from the drop-down list of folders. 3. At the top, click on the “Delete all spam messages now” link. 4. A confirmation dialogue box will appear. 5. Click OK. 6. This will delete all the spam messages from your email account.

Activity Time Activity 1: Divide yourself into groups of four or five and create a chart showing the step-by-step process of how scanning is done in the system.

(Group Activity)

Activity 2: Imagine that Ramesh has a computer system, which he has been complaining about, that has become very slow. What action would you ask him to take in order to increase the speed of the computer? Activity 3: Aman is feeling frustrated due to the frequent spam emails he receives. What steps can he take to set up an email filter and eliminate these unwanted messages from his inbox?

94


Chapter Checkup A Select the correct option. 1 Which of the following is NOT a recommended method for cleaning a computer keyboard? a Using compressed air

b Using an anti-static vacuum cleaner c Submerging the keyboard in water

d Physically removing and cleaning the keys 2 What is the primary function of antivirus software? a Defragmenting hard drives

b Cleaning temporary files

c Detecting and removing viruses

d Creating backup copies of files

3 What is the purpose of disk defragmentation? a Deleting temporary files

b Cleaning the computer screen

c Organising fragmented data on the hard drive

d Scanning for viruses

4 Which of the following is NOT a recommended action to protect against spam emails? a Creating email filters

b Opening emails from unknown senders c Deleting spam messages

d Using a spam filter feature 5 What does the “Run on a schedule (recommended)” option refer to in the context of disk optimisation? a Running disk optimisation only once

b Running disk optimisation manually

c Scheduling regular disk optimisation at specified intervals

d Running disk optimisation in safe mode

B Fill in the blanks with the most suitable words. 1 To protect against virus attacks, it is important to regularly update

software.

2 Disk defragmentation helps organise fragmented data on the hard drive to improve 3 Creating an email

.

in Gmail can automatically move suspicious emails to the spam folder.

4 One of the signs of a virus attack is an increase in

space usage.

5 Temporary internet files should be deleted from your computer regularly to prevent it from working

.

C State whether the following statements are True or False. Correct the statements that are false. 1 Computer maintenance is essential for ensuring the smooth operation of electronic devices. 2 Hardware maintenance includes cleaning and caring for physical computer components. 3 Regularly updating antivirus software is not important to protect your computer from new virus programs. 4 Disk optimisation can help improve a computer’s efficiency by defragmenting data. 5 Creating filters in Gmail can help automatically scan suspicious emails.

Chapter 9 • Care and Maintenance of Computer

95


D Answer the following questions. (Solved) Q1. What are the key components of computer hardware maintenance, and why is it important? A1. C omputer hardware maintenance encompasses cleaning and caring for physical components like the monitor, keyboard, CPU, and more. Regular maintenance is crucial because neglecting it can lead to dust buildup and reduced performance. Cleaning, storing components correctly, and addressing issues promptly help ensure the smooth operation of electronic devices. Q2. How can users protect their email accounts from spam in Gmail? A2. Users can protect their Gmail accounts from spam by creating email filters that automatically move suspicious messages to the spam folder. Additionally, being cautious about opening emails from unknown senders and regularly deleting spam messages helps maintain a clean inbox and avoids potential security risks. Q3. Sharmila’s computer is behaving in a strange manner. What are the warning signs that her computer might have a virus, and how can she keep her computers safe from harmful software? A3. Signs of a virus attack include slowed performance, unusual screen behaviour, error messages, increased disk space usage, and file modification. To protect their systems, users should install reliable antivirus software, install firewalls, avoid suspicious websites, keep software updated, and practice safe online behaviour.

Answer Key A 1. c

2. c

3. c

4. b

5. c

B 1. Antivirus

2. Efficiency

3. Filter

4. Disk

5. Slowly

C 1. True

2. True

3. False. To stay safe, you should regularly update your computer with the latest antivirus software versions. 4. True

96

5. True


Unit Reflection

Key Terms Operating System: It is an important software that helps the computer do its job smoothly. There are many types of operating system: Single-User Operating System: These operating systems were designed to accommodate just one user, performing a single task at a time. Batch Operating System: In a batch operating system, there is no direct interaction between the user and the computer. Instead, an operator is responsible for grouping similar tasks into batches. Graphical User Interface: This operating system employs a graphical interface that encourages user interaction. Within this system, menus and icons facilitate all tasks, simply requiring a click to execute. Multi-user Operating System: Multi-user operating systems enable multiple users to utilise the same computer, simultaneously. Multitasking Operating System: A multitasking operating system can manage multiple processes using shared resources like the CPU. Multithreading Operating System: These are operating systems that enable the various components of an application or program to operate concurrently. Real-Time Operating System: Real-time operating systems are super quick. They process the user commands, with minimal delay. Time-Sharing Operating System: This type of operating system allows multiple users to use a computer, simultaneously from different terminals. The goal is to minimise the response time for users. Distributed Operating System: They connect multiple systems, allowing them to share the resources and work together. They use multiple central processors to serve real-time applications. Desktop: The Windows desktop displays icons such as shortcuts, documents, and disk drives for easy access. Icons: Icons are the small graphical symbols you see on your computer screen, and they allow the users to perform various tasks by double-clicking on them. Each icon corresponds to a specific program. Menu: In a Graphical User Interface (GUI), menus are used to help users find information and execute the program’s functions. A menu is a structured collection of options related to a particular operation. Taskbar: The taskbar is a horizontal bar usually located at the bottom of the desktop. It has several sections including the start button, the middle section, and the notification area. File: A file is like a digital document that can store information, data, or programs on a computer. It can hold text, images, music, and more. Folder: A container used to organise and store files and other folders. File operations: They are actions you can perform on files, like creating, opening, saving, copying, moving, or deleting them.

Unit Reflection

97


File organisation: It refers to how files are structured and arranged on a computer’s storage, like in folders and drives. Directory Structure: A directory structure is the way folders and subfolders are organised on a computer to create a hierarchy. File System: It is the underlying software that manages how files and directories are stored and accessed on a computer’s storage device. Computer Maintenance: Computer maintenance means ensuring that computers are well-maintained to function properly. There are two types of computer maintenance: • Hardware Maintenance: Hardware maintenance involves taking care of the physical parts of a computer, like the monitor, keyboard, CPU cabinet, mouse, and any additional devices connected to it. • Software Maintenance: Software maintenance refers to the cleaning of computer programs. This includes tasks, like scheduled disk cleaning, protection against viruses, removing the temporary and unnecessary files, creating backups regularly, updating the software, and checking for security threats. Virus: A computer virus is a program or set of programs that interrupts a computer’s normal functioning and can infect or destroy data. Anti–Virus Software: They are the computer programs that are created to find, prevent, and delete viruses from a computer.

Things to Remember • Various functions of an Operating System are: processor management, memory management, device management, file management, security, error detection, and job scheduling. • Maintaining files and folders is crucial for maintaining order, efficiency, preventing data loss, accessibility, collaboration, data security, saving space, backup, and recovery. • Regular cleaning of both the hardware and software components of a computer is very important, as it helps in the smooth working of the system. • When a virus attacks a computer, it slows down the system, causes unusual movements on the screen, displays strange messages, increases disk space usage, changes data in the directory against the file name, formats the hard disk and deletes or damages files. • Malware attacks can result in modified files, frequent disruptions, reduced speed, and more. Therefore, it’s important to ensure your safety online by using security software, employing firewalls, updating software, being cautious of spam, backing up your data, scanning portable devices, and disabling cookies. • An antivirus helps in checking computer files for known viruses by searching for them in a virus dictionary and recognising unusual behaviour in computer programs that could indicate an infection. • Some well-known antivirus programs include Quick Heal, Norton Antivirus, Avast One, AVG Antivirus.

98


Test Your Knowledge A. Select the correct option. 1. Accumulation of dust on the computer may result in

.

a. virus

b. slow performance

c. software malfunction

d. filled-up disk space

2. Which of the following is a single-user operating system? a. Microsoft DOS

b. Linux

c. Mac OS

d. Unix

3. Which method cannot be used to clean a keyboard? a. Using a soft brush to remove dust

b. Physically removing and cleaning the keys

c. Using a damp cloth to remove dirt

d. Eating while using a keyboard

4. Windows 11 was launched in which year? a. 2022

b. 2021

c. 2023

d. 2020

5. Which operating system is used in scenarios where rapid responses are crucial? a. Multi Operating system

b. Multitasking Operating system

c. Multithreading Operating system

d. Real Time Operating system

B. Fill in the blanks with the most suitable words. 1. It is important to make sure to

any programs and files that you no longer use.

2.

are the small graphical symbols you see on your computer screen.

3.

are usually created to steal information and important data from various users.

4. The

is a horizontal bar usually located at the bottom of the desktop.

C. State whether the following statements are True or False. Correct the statements that are false. 1. A menu is a structured collection of options related to a particular operation. 2. To rename a file, left-click on the file or folder and choose the Rename option from the context menu. 3. Computer maintenance means ensuring that computers are well-maintained to function properly. 4. Email services do not have a feature to stop spam messages from reaching your email inbox.

D. Short answer-type questions. 1. What is the need for the care and maintenance of computers? 2. Differentiate between Single-user and Multi-user Operating System. 3. What is the importance of managing your files and folders?

Unit Reflection

99


E. Long answer-type questions. 1. What are the functions of an operating system? 2. What is a computer virus and how is it harmful to computers? 3. Differentiate between Menu, Icon and Taskbar.

F. Competency-based questions. 1. Smita is facing several issues with her computer. Lately, she has not been able to perform any task on her computer because a virus has attacked her system. It is running very slowly and many duplicate files have been created on their own on the desktop. Suggest some ways in which Smita can avoid this situation in the future.

2. Mukesh is 50 years old and he is learning to operate computers. He needs to create a new file to store his official documents but he is not familiar with the steps. List the steps by which Mukesh can create a new file on his computer.

100


Unit 4 • Entrepreneurial Skills II

10 Exploring Entrepreneurship A long time ago, in a busy neighbourhood in Indianapolis, America, there lived a lady named Sarah. She worked hard and washed clothes for a living. Sarah had a dream, and it all started with talking to her neighbour, Addie. Sarah told Addie about her hair troubles. She wanted her hair to look as beautiful as those of the women in magazines, but there weren’t many good hair products for black women back then. Addie who knew a lot about hair care gave Sarah some advice. She told Sarah about natural things that could make her hair healthy and pretty. Sarah was excited and decided to try them. Sarah worked hard and made special hair products just for black women. She called her products “Madam C. J. Walker” after herself. Sarah travelled around the country, teaching other black women how to use her products and take care of their hair. What started as a casual conversation between neighbours led to a successful entrepreneurial venture. Madam C. J. Walker changed how people took care of their hair and helped black women feel confident and independent. Sarah’s journey is truly inspiring, isn’t it? It is a wonderful example of someone recognising a need and then taking the initiative to create a business that addresses that need. But what is truly amazing is that Sarah’s story is just one of many that highlight the entrepreneurial spirit.

S

arah and many like her possess the passion to be self-employed and start a new venture with a sense of ownership. These people are called entrepreneurs. An entrepreneur can be an individual or a small group of partners striving to venture into an unknown territory to establish a business, work hard to succeed, and take complete ownership of their failures. These people aim to create an ‘Enterprise’ by taking the initiative to develop innovative ideas, products, or services and then bringing them to the market. They leave no stone unturned in this journey. Entrepreneurship is the process of transforming an idea into a bigger business enterprise by identifying the opportunity and creating the market through thorough planning and management skills, typically with the goal of achieving financial profitability and long-term success. In today’s world, entrepreneurship is a subject of great discourse, particularly in India. It is a form of self-employment where individuals manage a business to meet people’s needs while continually seeking ways to innovate their business and generate profits.

101


Entrepreneurship and Society

The relationship between entrepreneurship and society is direct. An entrepreneur needs society to build a business; and the society needs entrepreneurs to identify its problems and come up with ideas, products, and services to solve them. Entrepreneurship and society share a dynamic and mutually influential relationship. Entrepreneurship, the process of identifying, creating, and pursuing opportunities, has far-reaching impacts on various facets of society. They contribute to the economic growth of the country, leading to development and growth in the society by generating employment opportunities. When there is an exchange of goods and services, it is not just beneficial for the entrepreneurs but for everyone involved. The buyers get what they need, and the sellers earn a living. Entrepreneurship plays a crucial role in the flow of money and generation of work opportunities enabling the growth and prosperity of local regions, communities, and society at large. Let us look at an example of Arjun who is a young entrepreneur in your neighbourhood. Arjun noticed something interesting—everyone in his community loved fresh, homemade snacks, but they were often hard to find. One day, while chatting with his friends, they mentioned how they wished they could enjoy delicious homemade snacks more often. Arjun saw an opportunity here. He decided to start a small business of making and selling homemade snacks. He began experimenting with recipes in his kitchen, creating mouthwatering snacks like crispy kachoris, flavourful mathris, and crunchy potato chips. Arjun’s business grew quickly! Soon, his snacks became popular in the neighbourhood. But here is the twist: Arjun did not do it all alone. He hired a group of local cooks, mostly homemakers looking for part-time work. This not only helped him meet the growing demand but also provided much-needed employment to people in his community. As Arjun’s business became more popular, he regularly started donating a portion of his earnings to support a local charity that fed underprivileged children. Thus, entrepreneurship is not just about making money but also about making a difference. So, what do entrepreneurs like Arjun do when they run their businesses? For example, Arjun noticed the demand for homemade snacks and created a solution by making and selling them.

Fulfill Customer Needs

Entrepreneurs are like problem solvers. They pay attention to what people need or want but cannot easily find in the market. Then, they come up with innovative ideas to meet those needs.

Support Local Talent

In Arjun’s case, he employed local cooks, Entrepreneurs often collaborate with people in their empowering them to showcase their community who have special skills or talents. This collaboration provides opportunities for local talent to culinary abilities. shine and earn a living.

Benefit Society

Arjun, for instance, donated a Successful entrepreneurs feel a responsibility to portion of his earnings to help feed give back to their communities. They may support underprivileged children. charities, contribute to building schools or hospitals, or engage in environmental initiatives. By doing this, they help address social issues and improve the overall well-being of the society in which they operate.

Create Jobs

As entrepreneurs’ businesses grow, they need more hands to help. This leads to the creation of jobs. When more people in the community have job opportunities, it reduces unemployment rates and enhances economic stability.

Arjun hired local cooks to keep up with the demand of snacks, thereby providing employment.

(continued...)

102


Share Wealth

Entrepreneurs do not keep all their earnings for themselves. They reinvest in communities, which can include paying fair wages to their employees and contributing to local development. This sharing of wealth improves the living standards of those in the community.

Arjun did not just make money; he used some of his profits to make a positive impact on the lives of others.

Lower Prices

Entrepreneurs introduce or increase competition in markets. When they offer new and better products or services, it forces other businesses to improve and lower their prices to remain competitive. This benefits consumers, as they get better products at more affordable rates.

Arjun’s success may have encouraged others to offer similar snacks, potentially leading to competitive pricing in the neighbourhood.

Qualities of a Successful Entrepreneur

Successful entrepreneurs possess a combination of personal qualities, skills, and traits that enables them to navigate the challenges of starting and running a business. While there is no one-size-fits-all formula for success, here are some common qualities and characteristics often found in a successful entrepreneur: Vision Successful entrepreneurs have a clear vision of their business. They can see opportunities and future possibilities. For example, successful Indian entrepreneur Ratan Tata had a vision for Tata Group to become a global business. Under his leadership, Tata Group expanded its presence and diversified into various industries, including automobiles, steel, and information technology. Passion Entrepreneurs are deeply passionate about their work. They are not motivated by money alone; they love what they do and are willing to work hard and dedicate extra hours to make their business successful. For example, N. R. Narayana Murthy, cofounder of Infosys, is known for his passion for technology and entrepreneurship. He was instrumental in building Infosys into one of India’s leading IT services companies. Risk-taking Entrepreneurship involves calculated risk-taking. Successful entrepreneurs are willing to step out of their comfort zones and take risks when they believe in their ideas. For example, Mukesh Bansal and Ashutosh Lawania, the cofounders of Myntra, are prime examples of entrepreneurs who took significant risks in the e-commerce industry by pioneering online fashion in India in the year 2007. Adaptability Successful entrepreneurs adapt to changing circumstances. They are flexible and open to change. They can change their strategies based on their learnings and changing market conditions. For example, Mukesh Ambani, chairman and managing director of Reliance Industries, transformed the company from a textile-focused business to a diversified company with interests in telecommunications, retail, and digital services. Innovative Thinking Entrepreneurs seek creative solutions to problems and constantly look for ways to improve their products, services, or processes. For example, Kunal Shah, the founder of CRED, is an Indian entrepreneur known for his innovative thinking in the financialtechnology sector. Kunal Shah launched CRED as a platform that rewards credit card users for paying their bills on time. This innovative approach transformed the traditional process of credit card bill payments into a rewarding experience.

Ratan Tata

N.R. Narayan Murthy

Mukesh Bansal and Ashutosh Lawania

Mukesh Ambani

Kunal Shah

Self-motivation Entrepreneurs are self-starters. They are intrinsically motivated to work and succeed. For example, Ritesh Agarwal, the founder of OYO Rooms, displayed self-motivation by starting as a teenager and building OYO into one of India’s largest hospitality companies. Ritesh Agarwal

Chapter 10 • Exploring Entrepreneurship

103


Resilience and Persistence Entrepreneurs bounce back from setbacks and failures. Entrepreneurship is full of ups and downs, and the ability to persevere in the face of adversity is crucial. For example, Kiran Mazumdar-Shaw, founder of Biocon, faced numerous challenges in the biotechnology industry but persevered to make Biocon a global biopharmaceutical company.

Kiran Mazumdar-Shaw

Leadership Entrepreneurs must lead their teams and inspire others to share their vision. Effective leadership and communication skills are essential. For example, Adi Godrej, chairman of the Godrej Group, has shown effective leadership in directing the diversified business through various industries such as consumer goods, real estate, and agribusiness. Networking Building a strong network of contacts can provide valuable resources, advice, and opportunities. Successful entrepreneurs often have excellent networking skills. For example, Kishore Biyani, founder of Future Group, used his extensive network to establish Future Group as a major player in the retail sector in India. Customer Focus Entrepreneurs prioritise understanding customer needs and delivering value to them. Customer feedback is essential for product or service improvement. For example, boAt’s products are often praised for their sleek and trendy designs. The founders, Aman Gupta and Sameer Mehta understood that customers not only wanted great sound but also stylish accessories.

Adi Godrej

Kishore Biyani

Aman Gupta

Time Management Entrepreneurs need to juggle multiple responsibilities. Effective time management skills help them prioritise tasks and stay organised. For example, N. R. Narayana Murthy emphasised time management and a disciplined work culture at Infosys, which contributed to its success as an IT services leader. Decision-making Successful entrepreneurs make well-informed decisions, often relying on data and analysis. They are not afraid to make tough choices when necessary. For example, Binny Bansal, cofounder of Flipkart, one of India’s largest e-commerce companies, took significant strategic decisions that shaped the company and when required, didn’t hesitate to step down from his role as CEO in 2018. Problem-solving Entrepreneurship involves solving a variety of problems, from operational challenges to strategic dilemmas. For example, Shiv Nadar, founder of HCL Technologies, excelled in problem-solving by providing innovative IT solutions to global clients and building HCL into a multinational IT services company. Open-mindedness An open-minded trait is essential for entrepreneurs, as it allows them to be receptive to new ideas, feedback, and various perspectives. They see every event and situation as a business opportunity. For example, Nithin Kamath, cofounder of Zerodha, applied his open-mindedness for embracing innovation, user feedback, and a customer-centric approach and transformed the Indian stock brokerage industry. He continues to be a catalyst for positive change in the financial services sector.

104

Binny Bansal

Shiv Nadar

Nithin Kamath


Ethical Conduct Maintaining high ethical standards is crucial. It involves adhering to a set of moral principles, rules of conduct and values in all business activities, interactions, and decisionmaking processes. Ethical entrepreneurship contributes to long-term success, trust from stakeholders, and a positive impact on society. For example, Anita Roddick, the founder of The Body Shop, built her business on principles of ethical consumerism and sustainability. Disciplined While adaptable, entrepreneurs often have a well-structured business plan. They take a disciplined approach in their work and take steps every day towards achieving their objectives. For example, Dhirubhai Ambani, the founder of Reliance Industries, adhered to a well-structured business plan while expanding his empire, which laid the foundation for the huge success of his organisation.

Anita Roddick

Dhirubhai Ambani

Entrepreneurs possess a unique blend of qualities that set them apart from the crowd. These qualities not only drive their own success but often inspire those around them.

Think and Tell COVID-19 saw the rise of many small businesses that helped solve the problem of hygiene and sanitization. Mention a few quality traits that these entrepreneurs displayed.

Main Functions of an Entrepreneur

Entrepreneurs can drive innovation, economic growth, and societal change. Entrepreneurs’ function encompass a wide range of activities and responsibilities. These functions play a crucial role in their journey towards success. Decision-making Entrepreneurs are like the captains of their ships, making choices that steer their businesses. Entrepreneurs are the chief decision-makers in their enterprises. They need to make decisions about the products or services they offer, the production policy, the purchase and sale of the goods and services, and the marketing strategy their organisation employs. Management Control Entrepreneurs are responsible for managing and controlling their businesses. They are responsible for overseeing the day-to-day operations of their businesses, ensuring that resources are used efficiently and goals are timely met. It is crucial for them to have good management skills and employ people with good management skills as well.

Decision Making Bearing Uncertainties

Innovation Main Functions

Division of Income

Risk-taking Management Control

Division of Income Entrepreneurs need to divide the total revenue among various factions of production like rent, interest, and purchase of raw material. Entrepreneurs also decide how profits and incomes are to be distributed among stakeholders, including employees, investors, and themselves. Risk-taking Entrepreneurs are inherently risk-takers. They identify opportunities and are willing to invest time, effort, and resources into pursuing these opportunities, even if success is uncertain. They understand that taking calculated risks is often necessary to achieve significant gains and create value.

Chapter 10 • Exploring Entrepreneurship

105


Bearing of Uncertainties Entrepreneurs operate in environments characterised by ambiguity, incomplete information, and unpredictable market conditions. They must make decisions and take actions in the face of uncertainties. Uncertainty-bearing involves making informed judgments, adapting to changing circumstances, and being resilient in the face of setbacks. Innovation Entrepreneurs are change-makers who drive economic growth, improve quality of life, and shape the future through their innovative efforts. Whether it is a small business owner introducing a new product to a local market or a tech startup disrupting entire industries, innovation is at the heart of entrepreneurial endeavours. These functions form the foundation of entrepreneurship, and it is the skill with which entrepreneurs balance these functions that often determine their success in the world of business.

Role and Importance of an Entrepreneur

Entrepreneurship benefits the entrepreneur and plays a crucial role in making communities and regions prosper. Entrepreneurs contribute to innovation, economic growth, job creation, and overall progress. Their importance cannot be overstated, and their roles encompass various aspects that benefit individuals, communities, and nations. Helps in Wealth Creation Successful entrepreneurs have the potential to accumulate wealth, which can be reinvested in their businesses or new businesses. Such reinvestments can result in the creation of more jobs, stimulating economic activity and benefiting the broader community. Adds to National Income Entrepreneurs drive economic growth by identifying and exploiting opportunities, introducing innovative products and services, and contributing to increased productivity. They contribute to national income by earning revenue and paying taxes. Creates Employment Opportunities Entrepreneurs are significant job creators. They start and expand businesses, which in turn hire employees, thus reducing unemployment and stimulating economic activity. For example, Elon Musk, the entrepreneur behind companies like SpaceX, has significantly impacted job creation in the aerospace industry. SpaceX, founded in 2002, has been at the forefront of commercial space exploration and transportation. Improves Standard of Living Entrepreneurs enhance the standard of living by introducing products or services that enhance convenience. They help improve the standard of living not only by providing income to many families through job opportunities but also by fostering new products and services that enhance the living standards of all the stakeholders. Creates Social Change Social change denotes significant alterations in societal norms, behaviours, or structures. Entrepreneurs drive social change by introducing innovations that challenge existing practices. For example, Harish Hande, an Indian social entrepreneur, cofounded SELCO India in 1995 with the mission to provide sustainable energy solutions to rural and underserved communities in India. Harish Hande’s vision and SELCO India’s initiatives have demonstrated the transformative power of social entrepreneurship. By providing sustainable and clean energy solutions to rural communities, SELCO has not only improved the standard of living but also empowered individuals and communities to take control of their own development and related environmental impact. Community Development Community development refers to initiatives aimed at enhancing the well-being of a local community. Entrepreneurs contribute by supporting local causes, schools, and charities. For example, the Tata Group invested heavily in building infrastructure and amenities for the community. This includes hospitals, schools, housing complexes, sports facilities, parks, and cultural centres. Tata Steel’s community development programs aim to enhance the quality of life for its employees and residents of the city. The Role of Government Government policies have a significant impact on encouraging entrepreneurship. The economy may benefit from a government-regulated, balanced approach to fostering entrepreneurship. Uncontrolled entrepreneurship may result in undesirable social effects like unethical business practices, corruption, financial crises, and criminal activity.

106


Myths About Entrepreneurship Let us look into some of these myths. Myths

Expectation

Reality

Example

Every Idea Must Be Unique

This myth suggests that to be an entrepreneur, you need to develop a groundbreaking idea that has never been used before.

Many successful entrepreneurs succeed by adding a unique twist to existing concepts.

Priya wanted to start a bakery in her neighbourhood, where several bakeries were already operating. Instead of creating entirely new products, she focused on adding a unique cultural touch by incorporating traditional Indian flavours and spices into her baked goods. This innovative approach helped her stand out and attract a loyal customer base.

You Need Lot of Money

Another misconception is that launching a business requires a substantial amount of money or capital.

Although capital is essential, it is not always the determining factor for success.

Ravi dreamt of opening a technology repair service in his town but had limited funds. He started small, offering his repair services from a small kiosk. As his reputation grew, he reinvested his earnings into expanding his business, eventually opening a proper repair shop. Ravi’s business success was built over time, starting with modest resources.

Only Big Business Owners Are Entrepreneurs

Many people believe that entrepreneurs exist only in the world of big corporations.

Entrepreneurship can thrive in small and medium-sized businesses too.

Sita runs a small tailoring business from her home, creating custom dresses for local customers. While her business is not at a large scale, she is an entrepreneur because she identified a market need, established her business, and steadily grew her customer base through her tailoring skills and excellent customer service.

Entrepreneurs Are Born, Not Made

This misconception suggests that entrepreneurship is an innate talent and you either have it from birth or you don’t.

In truth, anyone can develop entrepreneurial skills and mindsets.

Rahul, a high school student, organised a charity event to raise funds for a local orphanage. He came up with creative fundraising ideas, organised volunteers, and managed the event effectively. Rahul’s entrepreneurial spirit shone through his ability to identify a need, plan, and execute a successful project, showing that entrepreneurship can be nurtured and developed at any age.

Entrepreneurship as a Career Option

Countries are making a shift from ‘managerial’ to ‘entrepreneurial’ economies. India is known to be a land of ideas. Since a long time, we have had craftsmen, artisans, farmers, and traders working outside the formal employment structure. From a small departmental store owner to a prominent industrialist, business sense flows through the Indian society.

Think and Tell List a few myths that you have heard about entrepreneurs.

1. E ntrepreneurs are being recognised as role models in our country. Webinars, seminars, videos, blogs, and books are being used as the media of motivation and encouragement. 2. Online courses are being offered to help youth take up entrepreneurship as a serious career option. 3. Educational institutes are providing courses on entrepreneurship. 4. Institutes are inviting alumni to meet for mentoring and career guidance sessions.

Chapter 10 • Exploring Entrepreneurship

107


5. The government has gauged the shift and has taken many initiatives.

• Startup India: Launched in 2016, it aims to promote entrepreneurship and innovation in the country. This initiative provides various benefits to startups, including tax exemptions, funding support, and simplification of regulatory procedures. • Make in India: Make in India is a campaign launched in 2014 to encourage manufacturing and production within India. This campaign seeks to transform the country into a global manufacturing hub by promoting ease of doing business, simplifying regulations, and attracting foreign investments. • Stand-up India: This scheme, launched in 2016, aims to promote entrepreneurship among women and underprivileged sections of society by offering loans and support.

• Mudra Yojana: The Pradhan Mantri Mudra Yojana (PMMY) was initiated to financially support small businesses and micro-enterprises. This scheme offers loans at various stages of business development, from startup to growth and expansion. • Atal Innovation Mission (AIM): Launched in 2016, this scheme focuses on promoting innovation and entrepreneurship among students and startups. It includes initiatives such as Atal Tinkering Labs in schools and Atal Incubation Centres to support startups. • Entrepreneurship and Skill Development Program: It is run by various agencies, including the Ministry of Skill Development and Entrepreneurship, and offers training and skill development programs to aspiring entrepreneurs.

• Pradhan Mantri Employment Generation Programme (PMEGP): PMEGP aims to generate employment opportunities in rural and urban areas by providing financial assistance for setting up micro-enterprises. This programme supports various sectors, including manufacturing and services.

• Research and Development Grants: The government offers grants and incentives to startups and businesses engaged in research and development activities to promote innovation and technology advancement. 6. In today’s digital age, entrepreneurship has become more accessible than ever. The internet has opened up countless opportunities for online businesses, making it easier for aspiring entrepreneurs to reach a global customer base. 7. In the world of entrepreneurship, your success is not limited by titles or corporate hierarchies. The effort you put into your business directly correlates with the outcomes you achieve. Entrepreneurs often find that their income potential is limited only by their ambition and hard work. In conclusion, entrepreneurship offers a career path that combines passion, creativity, independence, and the potential to make a meaningful impact. It is a journey filled with challenges and rewards, making it an attractive option for those with vision and the determination to pursue their dreams.

ActivityTime Time Activity Activity 1: Writing a Note on Entrepreneurship as a Career Option

(Group Work and Independent Work)

In a group of four to five students, discuss the importance of entrepreneurship as a career option. You may highlight the key points from the chapter, emphasising how entrepreneurship nurtures creativity, offers independence, and has a positive impact on society. After the discussion, write down a short note on ‘Entrepreneurship: An Appealing Career Option’ in about 150 to 200 words. Activity 2: Researching Success Stories of First-Generation and Local Entrepreneurs

(Pair Work)

Get in pairs for the research-based project. Research on the success stories of two first-generation and local entrepreneurs. Your research should include the following: 1. About the founder(s) 2. Business idea 3. Role towards the society Present your findings to the whole class.

108


Activity 3: Analysing Strengths and Weaknesses

(Individual Work)

Reflect and introspect yourself as a budding entrepreneur. Create a list of the entrepreneurial qualities that you hold. Assess yourself based on the qualities you have listed to identify your areas of strength and weakness. You can use a simple scale, rating yourself from 1 to 5 for each quality (1 being the lowest and 5 being the highest). Get in pairs to share your qualities, strengths, and weaknesses. Take feedback and suggestions from your partner to help improve the areas of weakness. Activity 4: Listing Entrepreneurial Qualities

(Group Work)

Divide yourselves into small groups, each consisting of four to five members. Within your groups, engage in a lively discussion to compile a list of qualities you believe are necessary for entrepreneurs to succeed. Feel free to draw from your personal experiences or share anecdotes that illustrate these strategies. Each group should nominate a spokesperson who will present your list of qualities and provide real-life examples or stories to support them. After all the groups have presented, reflect on the presentations as a class. Discuss any common qualities that multiple groups mentioned and whether there were any differences in perspectives among the groups. This collective insight can be enlightening. Activity 5: Data for a Business

(Group Work)

Form a group of five students. Imagine each member of the group to be a cofounder of a business venture. As a team, brainstorm and conceive a business idea that can solve an existing problem in the society. Collect data and information about your business idea, the future scope of growth and the market where your business can thrive. Map out a business setup plan. Imagine your class to be a room full of investors. Present your findings and the business setup plan to them. After all the groups have presented, as a class, discuss the best business idea you liked and why. Activity 6: Guest Speaker Session

(Group Work)

Imagine you need to invite a successful entrepreneur for a guest lecture. Your teacher has provided you a list of business ventures and their entrepreneurs. Form a group of four to five students each and select a business venture with the mutual consent of your group. 1. Myntra

2. Nykaa

3. Mamaearth

4. Zomato

5. Uber

6. Lenskart

7. BharatPe

8. Zepto

9. MakeMyTrip

10. PharmEasy

Now, as a team, research the success story of the founder(s) of the selected business, the reason behind starting the business, and their contribution to the community. Present your findings to the class while trying to convince them why should your chosen entrepreneur be invited as a guest speaker.

Chapter Checkup A Select the correct option.

1 What inspired Sarah to start her own business? a She wanted to become famous. c She inherited a business.

b Her neighbour, Addie, suggested it. d She had a lot of free time.

2 Which of the following qualities is NOT typically associated with successful entrepreneurs? a Innovation b Resilience c Delaying things

Chapter 10 • Exploring Entrepreneurship

d Confidence

109


3 What is the one way in which entrepreneurs can contribute to society? a By hoarding their wealth

c By avoiding risks

B Fill in the blanks with the most suitable words. 1 Entrepreneurs often take calculated

b By creating job opportunities d By keeping their ideas secret

in the pursuit of their goals.

2 The standard of living in a community can be improved by introducing convenience.

and

3 Entrepreneurs contribute to the national income by earning revenue and paying 4 One myth about entrepreneurship is that every idea must be

.

that enhance .

C State whether the following statements are True or False. Correct the statements that are false. 1 Entrepreneurship can thrive only in big corporations.

2 The impact of entrepreneurship on society is limited to economic growth. 3 Entrepreneurs are always born with innate talents for doing a business.

4 Wealth creation involves generating assets, income, or value by using resources effectively. D Answer the following questions. (Solved)

Q1. Explain one quality that entrepreneurs often possess and provide an example of how this quality can benefit their business.

A1. One quality that entrepreneurs often possess is “creativity”. Creativity allows entrepreneurs to think out of the box and develop innovative solutions to problems. For example, a cloth designer can use their creativity to design unique and eye-catching clothing, setting their business apart from competitors. Q2. Discuss the role of entrepreneurship in creating employment opportunities and its impact on the overall well-being of a community or a region. A2. Entrepreneurship plays a crucial role in creating employment opportunities within a community or a region. When entrepreneurs set up or expand their businesses, they often hire residents of the neighbouring areas, thus reducing unemployment rates and improving economic stability. This job creation not only benefits individuals by providing them with a regular income but also enhances the overall well-being of the community. It can further lead to better living standards, increased access to goods and services, and a stronger sense of community pride. Additionally, as businesses grow and succeed, they contribute to the economic growth of the region, attracting further investment and development. Therefore, entrepreneurship is a driving force behind both individual and community prosperity.

Q3. Meet Raj, a Craft Innovator. Raj is a young and spirited entrepreneur who hails from Jaipur, Rajasthan. In his vibrant city, traditional artistry is treasured, and one craft that stands out is block printing on fabric. Raj recognised a growing interest in handcrafted, eco-friendly clothing not only in Jaipur but also across India.

With a vision to blend traditional craftsmanship with current fashion trends, Raj started his business, “Rajrang Apparel”. He sources organic cotton from local farmers and employs skilled artisans from his community. Raj personally designs unique block patterns that reflect the rich heritage of Rajasthan. Initially, he worked with a small team of artisans, but as the demand for his beautifully crafted clothing grew, so did his team. Raj provided employment opportunities to more artisans, empowering them to showcase their talents while earning a sustainable income. Raj’s efforts not only benefited his team but also the local farmers who supplied him with organic cotton. With increasing orders, he purchased larger quantities of cotton, contributing to the farmers’ income. As Rajrang Apparel thrived, Raj made sure that everyone involved shared in the success. Moreover, Raj was conscious of his responsibility to the environment. He implemented eco-friendly practices in his production process, such as natural dyeing techniques and minimal water usage. He also supported his community by supporting local charities and sponsoring education programs. Raj not only created beautiful clothing but also contributed to a positive change. His journey showcases how entrepreneurship can uplift not only individuals and communities but also honour age-old traditions in the modern world. What roles of an entrepreneur do you think Raj fulfilled?

110


A3. Raj is a successful entrepreneur who identified a potential opportunity in the market and is working hard to generate employment and fulfil his responsibilities towards the environment, society, and nation. •

•

• • •

Helped in Wealth Creation: Successful entrepreneurs have the potential to accumulate wealth, which can be reinvested in their businesses. Raj showed the potential in the market, and now he is using the earned revenue to expand and upscale his business. He is making sure to share the success with all the stakeholders.

Added to the National Income: Entrepreneurs drive economic growth by identifying and exploiting opportunities. Raj saw an opportunity gap, and his idea and production have been able to fulfil the market need. His small business has ensured the flow of money in the economy as his business sources organic cotton from local farmers and employs skilled artisans from his community. Created Employment Opportunities: Entrepreneurs are significant job creators. Raj provided employment opportunities to more artisans, empowering them to showcase their talents while earning a sustainable income.

Improved Standard of Living: Entrepreneurs enhance the standard of living by bringing sustainable fashion to the people of their community and globally.

Created Social Change: Raj is conscious of his responsibility to the environment. He implemented eco-friendly practices in his production process, such as natural dyeing techniques and minimal water usage. He also supported his community by supporting local charities and sponsoring education programs.

Answer Key A 1. b

2. c

3. b

B 1. risks

2. product; services

3. taxes

4. unique

C 1. False. Entrepreneurship can thrive not only in big corporations, but also in small and micro-businesses. 2. False. The impact of entrepreneurship on society includes economic growth, job opportunities, and community development. 3. False. Entrepreneurs are not born; entrepreneurship is a skill that can be developed. 4. True

Chapter 10 • Exploring Entrepreneurship

111


Unit Reflection

Key Terms Community Development: It refers to initiatives aimed at enhancing the well-being of a local community. Entrepreneurs: They are individuals or small groups of partners striving to venture into unknown territories to establish a business, willing to work hard to succeed, and take complete ownership of their failures. Entrepreneurship: It is the process of transforming an idea into a big business enterprise by identifying the opportunity, and creating a market through thorough planning and management skills, typically with the goal of achieving financial profitability, and long-term success. Social Change: It denotes significant alterations in societal norms, behaviours, or structures.

Things to Remember • Entrepreneurship and society share a dynamic and mutually influential relationship. When entrepreneurs run their businesses, they fulfil customer needs, support local talent, benefit society, create jobs, offer products and services at lower prices, and share the wealth. • Successful entrepreneurs have a clear vision, passion for work, ability to take risks, and can also adapt and innovate. They are self-motivated, resilient, and persistent individuals with leadership skills and a vast network of people. Their approach is customer-focused and they maintain ethical conduct and discipline. • An entrepreneur’s role includes decision-making, management control, division of income, risk-taking ability, bearing of uncertainties, and innovation. • Entrepreneurs help in wealth creation as they add to the national income by creating employment opportunities, and improving the standard of living. They may be the torchbearers of social change, and community development. Government policies play an important role in encouraging entrepreneurship. • Entrepreneurs’ ideas may not necessarily be unique. They need not have lots of money or big businesses. Anyone can develop entrepreneurial skills and mindsets. • Countries are making a shift from ‘managerial’ to ‘entrepreneurial’ economies. • Entrepreneurs are being recognised as role models in India. • Online courses are being offered to help the youth take entrepreneurship as a serious career option. • Educational institutes are providing courses on entrepreneurship. • The Indian government has introduced many initiatives, such as Startup India, Make in India, Stand-Up India, MUDRA Yojana, Atal Innovation Mission (AIM), National Entrepreneurship Development Program (NEDP), Pradhan Mantri Employment Generation Programme (PMEGP), Research and Development Support, and so on, to promote entrepreneurship in India. • The internet has opened up countless opportunities for online businesses, making it easier for aspiring entrepreneurs to reach a global customer base.

112


Test Your Knowledge A. Select the correct option. 1. What is the nature of the relationship between entrepreneurship and society? a. Indirect

b.

Direct

c. Not related

d.

None of the above

2. How can a successful entrepreneur give back to his community? a. By supporting charities

b.

By keeping all the profit

c. By building own houses

d.

By investing in gold

3. Which of the following is not a trait of a successful entrepreneur? a. Decision-making

b.

Leadership

c. Adaptability

d.

Risk-fearing

4. Entrepreneurs contribute to the national income by earning revenue and paying a. Fines

b.

Money

c. Duties

d.

Taxes

a. Prime Minister Money Scheme

b.

Pradhan Mantri Money Yojana

c. Pradhan Mantri Mudra Yojana

d.

Pradhan Mantri Madad Yojana

5. The full form of PMMY is

.

.

B. Fill in the blanks with the most suitable words. 1.

is a campaign launched in 2014 to encourage manufacturing and production within India.

2. Entrepreneurs introduce

into the market.

3. Countries are making a shift from ‘managerial’ to 4. The

economies.

has opened up countless opportunities for online businesses, making it easier for aspiring

entrepreneurs to reach a global customer base.

C. State whether the following statements are True or False. Correct the statements that are false. 1. A person is considered an entrepreneur if they begin making chocolates at home and selling them to others. 2. Mudra Yojana, which was launched in 2016, focuses on promoting innovation and entrepreneurship among students and start-ups.

3. Only a big business owner is an entrepreneur. 4. Government policies have a big impact on encouraging entrepreneurship.

D. Short answer-type questions. 1. Explain the relationship between entrepreneurship and society. 2. Is it important to be passionate as an entrepreneur? 3. Mention any two government initiatives that promote entrepreneurship in India.

Unit Reflection

113


E. Long answer-type questions. 1. Define entrepreneurship. What is the role and importance of an entrepreneur? 2. ‘You need a lot of money to become a successful entrepreneur.’ It is a popular statement regarding entrepreneurship. Do you agree with this statement? Support your reasons with an example.

3. What are the different functions of an entrepreneur?

F. Competency-based questions. 1. Latika is an enthusiastic home baker who is famous for her delicious cakes, cookies, and pastries. She has decided to turn her passion for baking into a home-based bakery business. She started by selling her baked goods to her friends and family, and

they quickly gained popularity due to their taste and quality. What qualities of a successful entrepreneur does Latika possess? 2. Raj is a young entrepreneur in India who is passionate about clean energy solutions. He has developed a unique solar-

powered water purification device that can provide clean drinking water to rural communities with limited access to clean

water sources. Raj’s innovation has the potential to address a critical problem and improve the lives of many people. However, Raj is facing challenges in scaling up his business and bringing his invention to a wider audience. Name various Indian government schemes and initiatives that are available to support entrepreneurs like Raj.

114


Unit 5 • Green Skills II

11 Sustainable Development I

n the rapidly changing world that we all are a part of, our environment is also changing. From rising global temperatures to shifts in weather patterns and from the depletion of important natural resources to the alarming loss of biodiversity, it has become increasingly evident that our planet is facing unforeseen challenges. The once stable and predictable patterns of nature are being disturbed and demand our attention and action. We are responsible for taking care of our planet, which is full of life.

Sustainable Development

“Sustainable Development is development that meets the needs of the present without compromising the ability of future generations to meet their own needs.”1 Let us break this definition down to two parts:

Meeting Our Present Needs This means that we must ensure that presently, all people have access to things like clean water, food, shelter, education, and healthy living conditions. It’s about making sure that everyone has a chance to lead a decent life. Without Compromising the Future Needs This means that we should not meet our present needs in a way that harms the planet or uses up resources so quickly that there is nothing left for our future generations. We need to take care of the environment so it stays healthy and can provide for our children, their children, and so on. At its heart, sustainable development is about finding a balance which will not only enable us to optimally utilise the resources in the current times but also ensure that there is no scarcity in the future.

1

As per the Report of the World Commission on Environment and Development: Our Common Future (1987).

115


EVOLUTION OF

SUSTAINABLE DEVELOPMENT

THE CONCEPT HAS EVOLVED SIGNIFICANTLY OVER THE YEARS, RESPONDING TO THE CHANGING NEEDS AND CHALLENGES OF THE WORLD.

1960-1970 (EARLY ROOTS) The seeds were sown in 1960s when environmental concerns gained global attention. Early movements like Rachel Carson's "Silent Spring" and the first Earth Day in 1970 raised awareness about environmental issues.

1987 (BRUNDTLAND REPORT) The seeds were sown in 1960s when environmental concerns gained global attention. Early movements like Rachel Carson's "Silent Spring" and the first Earth Day in 1970 raised awareness about environmental issues.

1992 (RIO EARTH SUMMIT) The UN Conference on Environment and Development also known as the "Earth Summit," held in Rio de Janeiro, Brazil was an important milestone. It produced a comprehensive plan of action for sustainable development.

2000 - 2015 (MILLENNIUM DEVELOPMENT GOALS)

When we practise sustainable development, we become responsible caretakers of our planet. Sustainable development is a strategy for driving growth in an environmentally smarter way. It is about growing and being successful while also being kind to our environment and people. If development is not driven by keeping a particular need in mind, it will cause economic, environmental, and social issues. Hence, sustainable development means to meet the diverse needs of the present and the future generations by promoting wellbeing, social inclusion and the creation of equal opportunities.

Pillars of Sustainable Development

The international community focused on MDGs which included objectives like eradicating poverty and achieving universal primary education. Along with sustainability, it was recognised '!hat a more holistic approach is needed.

2015-PRESENT (SUSTAINABLE DEVELOPMENT GOALS) In 2015, !he world adopted !he SDGs. These 17 goals provided a comprehensive framework that addressed poverty, inequality, climate change etc. They emphasised on interconnectedness of social, economic and environmental issues.

Evolution of Sustainable Development Economic This means using assets and resources wisely and efficiently to ensure economic growth and produce profit. It aims to improve the standard of living of the public. The resources should be used responsibly to meet development goals and build a competitive economy. Social This is about making sure that the public is safe, healthy, and treated fairly. Also, it is about being inclusive and welcoming to people from different social and cultural backgrounds. The development needs to focus on creating accessible services for the community which cater to various aspects like health, security, education, etc.

116

It is like a roadmap for building a better future. It is an integrated approach to development which will prevent us from exhausting all the natural resources and damaging the environment to a point from where it cannot recover.

The three main pillars of sustainable development are:

Environmental This is all about protecting and being friendly to the environment. It includes reducing waste and pollution, using less energy, a wise usage of natural resources, and preserving our biodiversity. By doing these things, we can help solve issues like pollution, global warming, and climate change.


Sustainable Development Goals (SDGs) The concept of sustainability is accepted worldwide, and the United Nations General Assembly released a guideline for the world called the Sustainable Development Goals in 2015 for the year 2030. The Sustainable Development Goals, also called the SDGs, are like a global ‘to-do list’ for making the world a better place and addressing global issues like hunger, poverty, education, peace, global warming, environmental issues, inequality, and injustice.

There are seventeen SDGs and one hundred and sixty-nine targets in total, which are a part of this agenda. Each goal has a specific aim, like ending hunger, ensuring clean water, providing quality education, etc. These goals cover many different aspects of life, from taking care of the environment to ensuring everyone is healthy and has enough to eat. These goals aim to include people of all the countries to enhance economic growth and create a more prosperous world.

The Importance of Sustainable Development

By understanding the definition and evolution of Sustainable Development, we now know that it is a critical approach that shapes our future. But why is sustainable development so important? Read the table given below to understand its significance: The Importance of Sustainable Development 1. Ensuring Our Planet Remains Healthy

ur planet Earth is our only home, and its health directly O impacts our well-being. Sustainable development prioritises environmental protection and resource conservation. It’s a way to ensure that our natural resources, such as air, water, and fertile soil, remain clean and abundant for the current and the future generations. 3. Enhancing Quality of Life

Ultimately, sustainable development is about improving the quality of life for all individuals. It’s about clean air to breathe, safe and vibrant communities, and a world where future generations can look forward to their future without worrying about basic amenities. 5. Preserving Our Biodiversity

ustainable Development also aims at preserving the S ecosystem and the habitats of all birds and animals and, thus, helping to maintain our biodiversity.

Chapter 11 • Sustainable Development

2. Combating Climate Change

Sustainable development is a powerful tool to combat the looming threat of climate change. It encourages the reduction of greenhouse gas emissions, promotes renewable energy sources, and advocates for sustainable transportation; all crucial steps in mitigating the effects of global warming.

4. Leaving a Legacy

Sustainable development is about creating a legacy we can be proud of, one that reflects our values and commitment to a better world. It is about ensuring that our children and their children inherit a planet that is thriving and abundant. 6. Financial Stability

here is a continuous effort to stabilise the economies of all T countries and a promise of steady growth. The use of fossil fuels, which cannot be replenished easily, is being replaced by cost-effective renewable sources of energy.

117


Sustainable Practices

Sustainable practices are the actionable steps we take to achieve the objectives of sustainable development. They guide us in making everyday decisions that reduce negative environmental impact, promote fair practices, and contribute to economic well-being. Some key and popular sustainable practices are: educe, Reuse, Recycle This mantra covers R the essence of sustainable waste management. Reducing waste at the source, reusing items whenever possible, and recycling materials are fundamental practices that conserve resources and reduce landfill waste. nergy Efficiency Using energy more E efficiently is the cornerstone of sustainable practices. It includes strategies like insulated buildings, upgrading lighting systems, and investing in energyefficient appliances. Reducing energy consumption decreases our carbon footprint and lowers our energy bills. onservation of Water Sustainable water consumption practices involve using water wisely in domestic areas and C avoiding unnecessary waste in industrial sectors. This can be achieved through efficient irrigation methods, fixing leaks promptly, and adopting low-flow fixtures (water saving plumbing equipment to reduce the flow of water). Water conservation is crucial in regions prone to drought and in the face of growing global water scarcity. ustainable Transportation Choosing eco-friendly modes of transportation, such as walking, biking, carpooling, S or using public transit reduces greenhouse gas emissions and eases traffic congestion. Electric and hybrid vehicles are also increasingly popular sustainable options. ustainable Agriculture Sustainable agricultural practices promote soil health, reduce chemical inputs, and S prioritise biodiversity. Organic farming, crop rotation, and the use of natural fertilisers are examples of methods that maintain the long-term fertility of agricultural land.

Think and Tell Name any one sustainable practice that you follow in your daily life. Share why it is beneficial for our environment.

Eco-friendly Lifestyle

Eco-friendly is a term used to describe products and activities that are designed and carried out with minimal harm to the environment. This can include the production of materials, the use of renewable energy sources, and practices that reduce water, air, and land pollution. Eco-friendly practices are an integral part of sustainable development. They align with the principles of responsible resource use, environmental protection, and social equity. By adopting eco-friendly habits, individuals, businesses, and communities contribute to the broader goals of sustainability, fostering a world where the needs of the present are met without compromising the ability of future generations to meet their own needs. So, whether you reduce waste, conserve energy, or support sustainable products, every eco-friendly choice is a step towards a more sustainable and harmonious world. These are some eco-friendly products that are used worldwide:

118


BAG Reusable shopping bags are a great eco-friendly alternative to disposable plastic bags. They are durable, long-lasting, and can be used to reduce the amount of plastic waste.

PRODUCTS Recycle paper products are a great way to reduce the amount of trees being cut down. They are made from post-consumer paper and are an eco-friendly alternative to traditional paper products.

PRODUCTS Bamboo is a fast-growing and sustainable material that can be used to make a varietly of product. Bamboo products are durable. Lightweight and look great.

WATER BOTTLE Reusable water bottles are a great way to reduce plastic waste and save money. They are designed to be used for years and are made from durable materials like stainless steel, glass and aluminium.

Problems Related to Sustainable Development

Sustainable development requires resources, concentrated efforts, and a shift in society’s mindset to understand and adapt to a sustainable lifestyle. On the surface, the concept may sound simple to implement; however, it faces numerous issues. As responsible citizens, it is important to be aware of the challenges and complexities associated with sustainable development. Limited Resources One of the foremost challenges is the scarcity of vital resources. As the global population continues to grow, there is increased pressure on resources like freshwater, land, and energy sources. Sustainable development requires us to manage these resources carefully, which often demands innovation and conservation efforts. Short-term Vs Long-term Interests Balancing short-term economic interests with long-term sustainability goals can be challenging. Some policies and practices prioritise immediate gains over the well-being of future generations, making it crucial to shift this mindset. Lack of Awareness Not everyone is fully aware of the importance of sustainable development and its implications. Raising awareness and educating communities about the benefits and necessity of sustainable living is an ongoing challenge. Global Cooperation Many sustainability challenges are global in nature, such as climate change. Addressing these issues requires cooperation among countries, which can be complicated because of differing priorities and interests. Measuring Progress Tracking progress towards sustainable development is a complex task. Developing accurate metrics and indicators that consider economic, social, and environmental factors is a challenge in itself.

Did You Know? Corporate social responsibility (CSR) is a sustainable business practice where companies develop global programmes that help the surrounding communities and society at large. For example: ITC, Tata Steel, etc. The CSR departments in big companies often tackle significant global challenges such as climate change, poverty, and education.

Sustainable development demands innovation, commitment, and collaboration on a global scale.

Chapter 11 • Sustainable Development

119


Possible Strategies and Solutions for Sustainable Development

Strategising to solve problems is an important skill that we must learn. Here are a few possible strategies and solutions for sustainable development. Sustainable Resource Management 1. Resource Efficiency: Implementing resource-efficient practices in industries, agriculture, and households can help reduce the strain on natural resources. This includes recycling, reusing, and adopting eco-friendly products.

2. Conservation: Protecting and restoring natural habitats and ecosystems is vital. Conservation efforts can help safeguard biodiversity, promote clean water sources, and mitigate climate change. Social Equity 1. Education and Awareness: Promoting education about sustainable development and environmental conservation helps empower communities to make informed decisions. International Cooperation 1. Climate Agreements: Encourage international cooperation through agreements, like the Paris Agreement, which aims to limit global warming. Collaboration on a global scale is essential for addressing climate change. 2. Aid and Assistance: Developed countries can provide financial and technical assistance to developing nations to support their sustainable development efforts. Addressing the challenges related to sustainable development requires a multifaceted approach involving individuals, communities, governments, and businesses. By adopting these strategies and solutions, we can collectively work towards a more sustainable, equitable, and harmonious world. Each action, no matter how small, contributes to the greater goal of a better future for all.

Think and Tell If you were leading a country which was on a path to adopt sustainable practices, what strategies and solutions would you have suggested or implemented?

Activity Time Activity 1: Conservation of Cultural Heritage

(Group Work)

Get into groups of four and discuss how we can conserve our indigenous knowledge and cultural heritage. Guiding Questions: 1. Which indigenous knowledge and cultural heritage are you focusing on?

2. Why is it important to respect and conserve indigenous knowledge and cultural heritage?

3. How can indigenous knowledge contribute to sustainable development and environmental conservation? 4. What are some challenges indigenous communities face in preserving their knowledge and heritage?

5. What can individuals and society do to support and respect indigenous knowledge and cultural heritage? Activity 2: Save the Capital

(Pair Work)

Our country, especially our capital, New Delhi, has been facing a grave issue of air pollution. Delhi has consistently ranked among the most polluted cities in the world, primarily due to vehicle emissions, industrial pollution, and stubble burning.

Imagine you and your classmate are research analysts working at the New Delhi Air Pollution Control Centre. Work on this major problem related to sustainable development and brainstorm potential solutions.

120


Follow the given activity steps: • Brainstorming: Find out more information related to the issue or any other related issues.

• Research and Analysis: Gain information on the current state of the issue, its impact on people, and what the government has done to address this issue.

• Solution Brainstorming: Think creatively and list short-term and long-term approaches to solve the problem at hand.

• Presentation: Present your research, findings, and solutions to the class. Activity 3: Sustainable Technology Models

(Group Work)

Get into groups of five. Design and create a sustainable technology model on rainwater harvesting, drip/sprinkler irrigation, vermicompost, solar energy, solar cooker and/or any other technology of your choice.

Chapter Checkup A Select the correct option. 1 What does sustainable development aim to achieve? a Unlimited economic growth

b Immediate benefits for the present generation

c Balancing current needs with those of future generations

d Maximizing resource consumption

2 What do the Sustainable Development Goals (SDGs) represent? a A global to-do list for making the world a better place

b A set of economic policies for developed countries

c A set of guidelines for exploiting natural resources

d A list of challenges that cannot be solved

3 Which of the following is NOT a pillar of sustainable development? a Economic

b Environmental c Social

d Political B Fill in the blanks with the most suitable words. 1 The United Nations adopted the aspects of sustainability. 2

in 2015, which consists of 17 goals and 169 targets covering various

is a term used to describe products and activities that are designed and carried out with minimal harm to the environment.

3 Reduce, Reuse and Recycle covers the essence of sustainable

.

4 Eco-friendly practices align with the principles of responsible resource use, environmental protection, and

.

C State whether the following statements are True or False. Correct the statements that are false. 1 Sustainable practices, such as energy efficiency and water conservation, play a crucial role in reducing environmental impact and promoting responsible use of resources. 2 Sustainable development focuses only on economic growth and profit maximisation.

Chapter 11 • Sustainable Development

121


3 Developed countries should not provide financial or technical assistance to developing nations to support their sustainable development efforts. 4 The Sustainable Development Goals (SDGs) address various aspects of sustainability, including poverty, health, education, and climate action. D Answer the following questions. (Solved) Q1. Explain the concept of sustainable development. A1. According to the World Commission on Environment and Development, Sustainable Development is the “development that meets the needs of the present without compromising the ability of future generations to meet their own needs.” It is about finding a balance which will enable us to optimally utilise the resources in current times so that there will be no scarcity in the future. It is an integrated approach to development which will prevent us from exhausting all the natural resources and damaging the environment to a point from where it can’t recover. Q2. List any five ways in which sustainable development is important for us. A2. Sustainable Development is a critical approach essential for shaping our future in the following ways:

• Combating climate change: It is a powerful tool to combat the threat of climate change and global warming. It results in the reduction of greenhouse gas emissions and the use of renewable resources of energy. • Ensuring a healthy planet: It prioritises environmental protection and resource conservation. • Leaving a legacy: It wants to create a legacy that we all can be proud of and ensure that our children inherit a planet with abundant resources. • Enhancing biodiversity: It aims to preserve the ecosystem and the habitats of different birds and animals. • Providing financial stability: It promises steady economic growth and tries to stabilise the economies by optimum use of resources.

Q3. Read the case study given below and answer the questions in detail that follow.

The government of Madhya Pradesh has introduced a bicycle-sharing program to reduce traffic congestion and carbon emissions in the city. 1. How does promoting cycling contribute to sustainable transportation in a city? 2. What are some potential challenges for implementing such a program?

A3. 1. Cycling is an eco-friendly mode of transportation, and promoting its usage is a great initiative by the government. It will reduce traffic congestion and the carbon footprint of the city. By using such a sustainable mode, the amount of greenhouse gases like carbon dioxide will decrease considerably in the city. 2. Some potential challenges for implementing such a program are:

• Lack of funds and finances for creating such assets. • Inconsistent maintenance and availability of bikes. • Lack of infrastructure like proper streets and sidewalks, bike lanes etc which can threaten the safety of daily riders. • Lack of an existing cycling culture and health-oriented ecosystem. • Lack of awareness in people about sustainable transportation and its benefits.

Answer Key A 1. c

2. a

3. d

B 1. Sustainable Development Goals (SDGs)

2. Eco-friendly

3. waste management

4. social equity

C 1. True

2. False. Sustainable development does not only focus on economic growth and profit maximisation.

3. False. Developed countries should provide financial or technical assistance to developing nations to support their sustainable development efforts. 4. True

122


Unit Reflection

Key Terms Crop Rotation: Crop rotation is the practice of growing different types of crops in the same area in sequential seasons. Eco-friendly: It is a term used to describe the products and activities that are designed and carried out with minimal harm to the environment. Organic Farming: It is a sustainable way of producing crops without the use of artificial/ synthetic fertilizers and pesticides. It uses natural fertilizers, composts, and manure. Low-flow Fixtures: It is a water-saving fixture created to reduce the flow of water in order to save water. Sustainable Development: It is the development that meets the needs of the present without compromising the ability of future generations to meet their own needs. Sustainable Development Goals: The United Nations General Assembly published them in 2015 as a global ‘to-do list’ for the year 2030, with the goal of making the world a better place and addressing global problems like hunger, poverty, education, peace, global warming, environmental issues, inequality and justice. Sustainable Practices: These are the actionable steps we take to achieve the objectives of sustainable development.

Things to Remember • Sustainable development is about finding a balance which will enable us to optimally utilise the resources in current times so that there will be no scarcity in the future. • The three main pillars of sustainable development are: Environment, Economic, and Social. • There are 17 Sustainable development goals and 169 targets in total for the year 2030. • Sustainable development prioritises environmental protection and resource conservation. It encourages the reduction of greenhouse gas emissions, promotes renewable energy sources, and advocates for sustainable transportation. It also aims at preserving the ecosystem and the habitats of all birds and animals. • Reduce, Reuse, and Recycle are fundamental practices that conserve resources and reduce landfill waste. • Sustainable practices that can promote reduce, reuse, and recycle at individual level may include: reducing the use of single use plastics, reducing food wastage, reusing containers, repurposing things, separating biodegradable and non-biodegradable wastes, and recycling electronic wastes. • Energy Efficiency includes implementing strategies like insulated buildings, upgrading lighting systems, and investing in energy-efficient appliances. • Sustainable water practices involve using water wisely and avoiding unnecessary waste. • Choosing eco-friendly modes of transportation, such as walking, biking, carpooling, or using public transit, reduces greenhouse gas emissions and eases traffic congestion.

Unit Reflection

123


• Sustainable agricultural practices promote soil health, reduce chemical inputs, and prioritise biodiversity. • By adopting eco-friendly habits, individuals, businesses, and communities contribute to the broader goals of sustainability. • Limited resources, short-term vs. long-term interests, lack of awareness, lack of global cooperation, and improper measures to track progress are the various problems related to sustainable development. • Efficiency of resources, conservation of resources, education and awareness among people, climate agreements between countries, and aid and assistance are the possible strategies and solutions for sustainable development.

124


Test Your Knowledge A. Select the correct option. 1. What are the three main pillars of sustainable development? a. Environment, Government, Social

b. Environment, Social, Economic

c. Social, Economic, Finance

d. Political, Social, Economic

2. Sustainable Development Goals were released in which year? a. 2016

b. 2020

c. 2015

d. 2014

3.

is an eco-friendly mode of transportation. a. Electric vehicles

b. Trucks

c. Diesel cars

d. Airplane

4. Which of the following is not a sustainable practice? a. Reuse, Recycle, Reduce

b. Energy Efficiency

c. Conservation of water

d. Use of plastic products

5. Which of the following is not an example of sustainable farming? a. Organic farming

b. Crop Rotation

c. Use of natural fertilisers

d. Deforestation

B. Fill in the blanks with the most suitable words. 1. Sustainable development meets the diverse needs of present and future generations by promoting wellbeing, and creating of equal opportunities.

2. Sustainable development helps to preserve the habitats of birds and animals, thus helping to maintain our 3. The

.

General Assembly released a global ‘to-do list’, called the Sustainable Development Goals (SDGs).

4. Eco-friendly is a term used to describe products and activities that are designed and carried out with minimal harm to the .

C. State whether the following statements are True or False. Correct the statements that are false. 1. Reduced chemical use and biodiversity preservation will damage the health of the soil. 2. Eco-friendly practices are an integral part of sustainable development. 3. Developing countries can provide financial and technical assistance to developed nations to support their sustainable development efforts.

4. Protecting and restoring natural habitats and ecosystems is vital.

D. Short answer-type questions. 1. Give a few examples of sustainable water practice. 2. What is the importance of sustainable development in enhancing our quality of life? 3. Mention ways to follow the sustainable practice of ‘reuse, reduce, and recycle’ at your home.

Unit Reflection

125


E. Long answer-type questions. 1. Explain the three pillars of sustainable development. 2. What are the sustainable practices that we can follow to achieve SDGs? 3. What are the different challenges associated with sustainable development?

F. Competency-based questions. 1. Rakesh is working as an engineer for a government-owned company. He uses his car every day to make the hour-long

commute to work through congested traffic. He occasionally rides in his colleague’s car. How can Rakesh change his means of transportation to promote sustainable development?

2. Kanha is a farmer in Saharanpur district of Uttar Pradesh. He possesses a lot of land for farming, but in order to boost his

income, he over-irrigates, uses chemicals, and grows numerous crops on the same plot of land despite the depletion of the soil. What are the methods that he can follow to maintain the long-term viability of his agricultural land?

126


Part-B

Artificial Intelligence


Unit 1 • Introduction to Artificial Intelligence

1 Foundational Concepts of AI Y

ou must have seen that while texting a friend using your smartphone, the predictive text fills in the rest of the phrase even before you get to the end of the sentence. Similarly, while shopping online, you get product recommendations based on your shopping history. Or when you are out for a jog, your smartwatch helps you track your fitness goal by giving useful information like the number of steps and your heart rate. All of this is possible because of Artificial Intelligence (AI), a technology that has transformed how we live, work, and interact with machines. But have you ever wondered how machines can become intelligent when intelligence is the trait of human beings? Let us understand the concept of intelligence and how machines, too, can become intelligent.

What Is Intelligence?

Being intelligent means being good at learning, problem-solving, thinking, remembering, communicating, and making choices or decisions. It also involves being creative and managing emotions well. Intelligence can be defined as a trait or ability to learn and use information to solve problems and adapt to new situations. For example, a person can apply intelligence to solve complex problems efficiently and effectively. Another person can be creative and can come up with unique ideas to create thought-provoking pieces of art that challenge viewers’ perspectives. Through these examples, you can infer that there can be various forms of intelligence. Let us have a look at all these types.

Types of Intelligence

According to the Theory of Multiple Intelligences, developed by the psychologist Howard Gardner in 1983, there are several distinct types of intelligence that individuals possess in varying degrees. Gardner’s theory suggests that individuals have a unique mix of these intelligences, which can explain their diverse talents and ways of learning. This perspective encourages educators to recognise and nurture all types of intelligences, rather than focusing solely on a single trait. Let us learn about the nine main types of intelligence.

129


Mathematical and Logical Intelligence Mathematical and logical intelligence refers to the ability to analyse problems logically, carry out mathematical operations, and investigate issues scientifically. It involves the capacity to discern logical or numerical patterns from abstract concepts. This type of intelligence is often associated with fields such as mathematics, computer science, engineering, and the natural sciences. Musical Intelligence Musical intelligence is the capacity to think in musical notes and to be able to hear patterns, recognise them, and manipulate them. Individuals with high musical intelligence have a good sense of rhythm, pitch, melody, and harmony. They are often adept at composing, playing musical instruments, singing, and understanding the structure and components of music. This intelligence allows them to create, communicate, and understand meanings made of sound. Linguistic Intelligence Linguistic intelligence is the ability to effectively use language to express oneself rhetorically or poetically. It involves a sensitivity to the meaning of words, the order among words; the sounds, rhythms, inflections, and meter of words; and the ability to use language to achieve certain goals. People with high linguistic intelligence are typically skilled at reading, writing, storytelling, and memorising words and dates, as well as having the capacity to understand and speak multiple languages. Intrapersonal Intelligence Intrapersonal intelligence is the capacity to understand oneself, including one’s emotions, motivations, inner states, and self-reflection. People with high intrapersonal intelligence are often introspective, aware of their strengths and weaknesses, and capable of self-discipline and goal-setting. Interpersonal intelligence Interpersonal intelligence is the ability to understand and interact effectively with others. It involves effective verbal and nonverbal communication, the ability to note distinctions among others, sensitivity to the moods and temperaments of others, and the ability to entertain multiple perspectives. People with high interpersonal intelligence are often good at working in teams, resolving conflicts, and empathising with others. Naturalist Intelligence Naturalist intelligence is the ability to recognise, categorise, and draw upon certain features of the environment. It involves a sensitivity to nature, the ability to nurture and interact with animals, and the capacity to discern patterns in the natural world. People with high naturalist intelligence often excel in fields such as environment, conservation, and agriculture. Existential Intelligence Existential intelligence is the capacity to tackle deep questions about human existence, such as the meaning of life, why we die, and how we got here. It involves a tendency to think deeply about the fundamental questions about the nature of existence and the universe. People with high existential intelligence often engage in philosophical thinking and may be drawn to fields like philosophy, theology, and cosmology. Spatial and Visual Intelligence Spatial and visual intelligence is the ability to think in three dimensions. It involves the capacity to visualise and manipulate objects, understand maps and graphs, and create mental imagery. People with high spatial visual intelligence often excel in fields such as architecture, engineering, graphic design, and the visual arts. Kinaesthetic Intelligence Kinaesthetic intelligence, also known as bodily-kinaesthetic intelligence, is the ability to use one’s body effectively to solve problems or create products. It involves a keen sense of body awareness, coordination, and dexterity. People

130


with high kinaesthetic intelligence are often skilled in physical activities such as sports, dance, acting, and crafts, and may excel as athletes, dancers, surgeons, or craftsmen.

Decision Making

We often need to make decisions for various situations in life. Decision making is fundamental to solve life’s complexities. It involves selecting a course of action from available options, which requires a complex interplay of cognitive abilities, emotions, and external factors. It involves various steps such as identifying a goal, gathering, and evaluating information, and choosing the best option to achieve that goal. A good decision considers all information, weighs potential consequences, and aligns with values and long-term goals. This continuous process often requires adaptation as new information emerges. Intelligence, self-awareness, emotional management, and learning from past choices are key components of effective decision-making.

How to Make Decisions

Suppose you want to pursue higher studies. How will you decide for this? You will assess personal interests, career goals, and financial considerations. Researching universities or institutions that offer relevant programs, considering factors like reputation and curriculum, is also crucial. Ultimately, the decision should align with long-term career goals and personal growth objectives, ensuring that the investment in higher education supports future aspirations effectively. Having knowledge, experience, or insights about a situation helps us predict what might happen and make better decisions. Using all the available information lets us handle complex situations with more confidence and accuracy, resulting in more successful and dependable decisions. Consider a scenario where a business manager must decide whether to launch a new product or not. If the manager has access to market research data, previous product performance, customer feedback, and competitor analysis, they can make a well-informed decision. This information helps them visualise potential outcomes, such as market acceptance or potential risks, and plan strategies to maximise success or mitigate failures.

Make Your Choices

Let us consider some example situations where you need to decide based on the given information. Scenario 1

Suppose you want to purchase a new car. On what factors will you decide to purchase a car?

1. Purpose and Usage: If you frequently drive long distances or need a car for family trips, then you should give preference to the performance and comfort of the car.

2. Budget: This is another important factor. If you have saved enough money and are willing to invest in a car with better features and performance, then you can consider an expensive car. However, if you are tight on budget, then you can go for a cheaper option.

3. Fuel Efficiency: If your usage is for long daily commutes, then you must consider the fuel efficiency of the car. If you drive very infrequently, then you can ignore this factor.

4. Maintenance and Reliability: If you give preference to this factor, then you may purchase a car with these features to ensure long-term performance and lower overall costs. 5. Resale Value: If you plan to keep the car for a long time, then the resale value of the car becomes important, ensuring you get a good return if you decide to sell it.

After carefully considering all the factors given here, you can decide to buy your dream car. Chapter 1 • Foundational Concepts of AI

131


Scenario 2 Look at the given picture and find the solution. An adventurer finds a chest of treasure guarded by a pirate who offers him an iron key, a silver key, and a golden key. Only one of them can open the treasure chest, and he has one chance to choose the right key. Behind the pirate, he sees a cipher reading “TGK HOE ELY DEN.” Which key does he choose?

TGK HOE ELY DEN

he adventurer applies his intelligence and deciphers the code written on the board. He rearranges the letters and T the code says, “THE GOLDEN KEY.” So, the correct key to open the treasure is the golden key.

Artificial Intelligence Similar to how humans apply their intelligence to solve certain problems, machines can also possess intelligence. This ability of machines to mimic human intelligence is called artificial intelligence. AI (Artificial Intelligence) is a branch of computer science that deals with the study of the principles, concepts, and technology of building machines that enable those machines to think, act, and learn like humans. Let us see how machines become intelligent and how they apply this intelligence in solving problems.

How do machines become Artificially Intelligent?

Humans learn gradually in their lives. We start small, like learning to crawl, then learning to walk and then finally build up to bigger things, like running and jumping. It is the same with learning to talk. We begin with simple sounds, then words, and finally full sentences. Another example can be of students learning a subject. For example, they learn mathematical concepts through lessons, practice problems, and exams. This step-by-step process helps our brains grow stronger. Humans continually expand their knowledge, develop new skills, and adapt to changing environments. On the other hand, machines become artificially intelligent through a process that involves training them with vast amounts of data and sophisticated algorithms. Machines learn from data. For example, to train a machine to recognise images of cats, thousands of labelled images of cats are fed into the system. This data serves as the foundation for learning patterns and features that define what a cat looks like. Machine Learning Process

TRAINING DATA

Algorithm

Applications of AI in Daily Life

Learning

Trained model

Results

AI has become an essential part of our daily lives, making certain tasks more efficient, personalised, and entertaining. Let us explore some amazing applications of AI that we experience in our daily lives.

132


Virtual Assistants

Amazon’s Alexa, Apple’s Siri, and Google Assistant are all examples of virtual assistants that use AI to understand and respond to our voice commands. They can set reminders, answer questions, play music, provide weather updates, and even control smart devices in our homes.

Personalised Recommendations

Streaming services like Netflix and music platforms like Spotify use AI algorithms to analyse our preferences. They recommend films, shows, or songs based on the time spent watching or listening to certain types of content, frequently played songs, and feedback given through ratings, making content suggestions as per the user’s preferences.

Facial Recognition

The facial recognition technology on our smartphones is powered by AI. It makes use of computer vision to recognise our faces using the front camera, allowing us to unlock our phones with ease and security.

Gaming AI plays a significant role in the gaming industry. Many video games use AI to control the behaviour of the computer-controlled characters to make them act intelligently and adjust to your strategy. AI can also create dynamic environments, improving the gaming experience.

Healthcare Applications

AI is used in medical diagnostics, helping doctors analyse medical images like X-rays and MRIs (Magnetic Resonance Imaging) more precisely. It assists in the early detection of diseases and leads to more effective treatment procedures.

Autonomous Vehicles

Autonomous vehicles are self-driven vehicles. The AI algorithms in them analyse data from their sensors and cameras to build an understanding of the vehicle’s surroundings. This helps in navigating and making real-time decisions on the road, ensuring safe and efficient transportation.

Chapter 1 • Foundational Concepts of AI

133


Language Translation AI-powered translation apps, like Google Translate, are used to understand and translate text instantly, enabling us to communicate in different languages.

Hi!

101010

AI has seamlessly integrated into our everyday routines, improving various aspects of our lives. From entertainment and communication to healthcare and transportation, the applications of AI continue to evolve. This promises a future where technology plays an even more significant role in making our lives easier and more convenient.

Hello!

100101

NLP

Did You Know? Sophia is a highly advanced humanoid robot, renowned for being the first robot to receive citizenship, showcasing sophisticated AI capabilities in human-like interaction.

What is not AI?

The term “AI” is often thrown around liberally, many technologies are mistakenly termed as such. The boundaries between AI and non-AI technologies can sometimes be blurry, as the field is constantly evolving. It is important to distinguish between automation and true AI. To clarify the distinction, let us explore some common examples of what is not AI:

Assembly line robots: These machines follow pre-programmed instructions without learning or adapting, making them examples of automation rather than true AI. They execute tasks repeatedly but lack the ability to improve or make independent decisions.

Automated systems: Systems like traffic lights or thermostats operate based on fixed rules, not AI.

School Bus

Expert systems: While they can mimic human decision-making to a degree, they rely on predefined rules rather than learning from data. As a result, they cannot adapt or improve beyond the knowledge initially programmed into them.

Fully automatic washing machine: A fully automatic washing machine depends on human input to choose the washing settings and prepare the load before it can start. This human intervention for configuring each wash cycle highlights that it functions through automation, not AI, as it doesn’t learn or adapt based on past washes. Instead, it performs tasks based on pre-set instructions.

134


Air Conditioners: An air conditioner can be operated remotely through internet connectivity, but it still requires human input to set its functions. This capability exemplifies the Internet of Things (IoT), where devices are connected and controllable via the internet, but they do not possess autonomous decision-making abilities or learning capabilities. Sensor-based Automation: Numerous systems automate our surroundings using sensors. For instance, motion-activated lights adjust illumination based on detected movement, and automatic sprinkler systems use soil moisture sensors to manage watering schedules. They perform specific tasks based on sensor input but cannot learn from new data or adapt their behaviour independently.

Error Alert! All machine learning is AI: While machine learning is a subset of AI, not all machine learning systems exhibit true intelligence or can learn independently.

Activity Time (Group Activity)

Activity 1: AI vs. Human Intelligence Debate

Ask your teacher to divide the class into two teams. One team will argue that AI can surpass human intelligence in various

domains, while the other team will argue that human intelligence is superior due to its creativity, emotional understanding, and adaptability. Each team will present their arguments, followed by a rebuttal session.

(Group Activity)

Activity 2: Role Play

Present a skit that demonstrates various AI applications in daily life. Scenarios could include a smart home assistant

helping with daily tasks, an autonomous vehicle navigating city streets, or a virtual assistant assisting with online shopping. (Group Activity)

Activity 3: Decision-Making Simulation

Divide the class into various small groups. Give them a decision-making scenario, for example, choosing a new school,

launching a new product, and so on. They will gather information, discuss potential outcomes, and make a group decision. Each group will present their decision-making process and justify their final choice.

Chapter Checkup A Select the correct option. 1 Which of the following is NOT a type of intelligence according to Howard Gardner’s theory? a Musical Intelligence

b Digital Intelligence

2 Which among the following best represents true AI?

c Interpersonal Intelligence

d Intrapersonal Intelligence

a A fully automatic washing machine

b An air conditioner that can be controlled remotely

c A sensor-based system that adjusts lighting based on motion detection

d A virtual assistant that learns from user interactions

3 Which intelligence is most closely associated with the ability to visualise and manipulate objects, understand maps and graphs, etc.? a Linguistic Intelligence b Spatial Intelligence c Logical-Mathematical Intelligence

Chapter 1 • Foundational Concepts of AI

d Musical Intelligence

135


4 The ability to understand and manage one’s own emotions is related to: a Intrapersonal Intelligence

b Interpersonal Intelligence

c Linguistic Intelligence

d Naturalistic Intelligence

B Fill in the blanks with the most suitable words. 1 The ability of machines to mimic human intelligence is called ....................... 2 ...................... is essential for machines to learn from data and improve their performance. 3 ...................... intelligence involves understanding and interacting with others effectively. 4 The capacity to think logically and solve problems is associated with ...................... intelligence. c

State whether the following statements are True or False. Correct the statements that are false. 1 All humans possess all types of intelligence to the same degree. 2 Machine learning is a key component of artificial intelligence. 3 Linguistic intelligence is primarily about mathematical skills. 4 Decision-making is not influenced by emotions.

D Answer the following questions. Q1. Explain the difference between artificial intelligence and human intelligence. A1. Humans learn through experiences and interactions. They gather their intelligence by acquiring knowledge, which is a continuous process. On the other hand, artificial intelligence is machine-simulated intelligence, learning from data. Humans possess consciousness, emotions, and creativity, while AI lacks these qualities. Another distinction between human intelligence and artificial intelligence is that humans have intelligence in inheritance due to genetics, which is impossible in machines.

Q2. Discuss the role of artificial intelligence in the field of healthcare.

A2. AI is used in medical diagnostics, helping doctors analyse medical images like X-rays and MRIs (Magnetic Resonance Imaging) more precisely. It assists in the early detection of diseases and leads to more effective treatment procedures.

Q3. Imagine you are developing a new educational app for children. How would you incorporate the concept of multiple intelligences to make the app engaging and effective for learners with different strengths?

A3. Artificial Intelligence (AI) is the simulation of human intelligence processes by machines, especially computer systems. The app should typically incorporate diverse learning activities to cater to different intelligences. Text, visuals, audio, and interactive elements can be added. Activities can be given for practice, group collaboration, and creative expression.

AI Activities 1 Explore the given link to know what is artificial intelligence: https://www.youtube.com/watch?v=xR6j9TLZdAw 2 To know how the machines learn, visit the link: https://www.youtube.com/watch?v=ukzFI9rgwfU

Answer Key A

1. b

B

1. Artificial Intelligence

C

1. False. All human posses varied degrees of intelligence.

2. d

3. b

4. a 2. Training

3. Intrapersonal

2. T rue

3. False. Linguistic intelligence is about the ability to use language.

4. False. Decision-making is influenced by emotions.

136

4. Mathematical and Logical


Unit 1 • Introduction to Artificial Intelligence

2 Basics of AI

I

n the previous chapter, you learned about artificial intelligence and how machines can exhibit smartness similar to humans. For instance, when Google Maps suggests the quickest route or streaming services like Netflix or YouTube recommend content based on your viewing habits, that’s AI in action. In this chapter, we will take a closer look at the differences between AI, machine learning, and deep learning, and explore the various domains of AI.

Introduction to Artificial Intelligence

Just like how we use our intelligence to do everyday tasks and become better at them, similarly machines become increasingly smart through Artificial Intelligence (AI). AI can be defined as a branch of computer science concerned with creating intelligent machines that can learn from data, solve problems, and make decisions. It involves the study of principles, concepts, and technologies that enable machines to exhibit human-like intelligent behaviour. AI involves using special programs and techniques that will allow computers to learn and perform tasks. AI gives machines the ability to think smartly, solve issues, and perform a variety of activities. John McCarthy, who is regarded as the father of AI, defined AI as “the science and engineering of making intelligent machines.”

AI vs Machine Learning (ML) vs Deep Learning (DL) Artificial Intelligence deals with the study of the principles, concepts, and technology for building machines that can think, act, and learn like humans. Machines possessing AI should be able to mimic human traits, i.e., making decisions, predicting outcomes based on certain actions, learning, and improving on their own. An example of this is self-driving cars. It integrates various components, such as sensors, cameras, GPS, as well as decision-making algorithms to mimic human-like driving behaviour.

Artificial Intelligence Machine Learning Deep Learning

Machine Learning is a subset of AI that enables machines to improve at a task. It enables machines to learn from experiences using the provided data and make accurate algorithms for predictions or decisions. In the self-driving car example, these algorithms analyse data collected from cars’ sensors and cameras to learn about traffic behaviour, pedestrian movement, etc. This helps the cars improve their driving capabilities over time through experience.

137


Deep Learning is a subset of machine learning in which a machine is trained with vast amounts of data. These machines are capable of creating their algorithms. It is an AI function that mimics the working of the human brain, processing information for tasks, like object detection, speech recognition, language translation, and decisionmaking. Deep learning processes information using neural networks. In self-driving cars, deep learning is often used for tasks such as object detection, lane detection, pedestrian recognition, and traffic sign recognition, thereby enabling safe navigation. Deep Learning represents the most advanced level of Artificial Intelligence among the three. Following that is Machine Learning, which has a moderate level of intelligence. Artificial Intelligence, in general, encompasses all the concepts and algorithms that, in various ways, imitate human intelligence.

Introduction to AI Domains

AI can help computers play sports like chess, recognise faces in pictures, respond to our voice commands, etc. AI is an umbrella term that has different domains or areas where it can be used. The three main domains of AI are Data Science, Computer Vision, and Natural Language Processing (NLP). Let us learn about these domains.

Data Science

Data is a collection of raw facts that can be transformed into useful information. It can be in the form of text, images, audio, or video. Data science is a vast and interdisciplinary field that involves extracting knowledge and insights from data. AI enhances computer performance by learning from data. The more the data, the more intelligent the machine becomes. AI can process and analyse data, and identify patterns and trends based on its goals. For example, when you play games online, AI adapts and learns from your gameplay to make the experience more engaging and challenging. Applications of Data Science Across various industries, data science provides valuable insights that can help you in making strategic decisions. Here are some examples: Marketing: Understanding customer demographics, preferences, and online behaviour allows companies to develop targeted marketing campaigns and optimise their marketing budget. Public Health: Analysing disease outbreaks and tracking vaccination rates helps public health officials make informed decisions about resource allocation and disease prevention strategies. Scientific Research: Data science allows researchers in various fields to analyse massive datasets, leading to new discoveries and advancements in medicine, science and technology, and other areas. Compare Prices Online: There are various websites which help you to compare prices of numerous items from different web stores. These sites use extensive datasets to provide the convenience of comparing product prices across multiple vendors in one place. Examples include PriceGrabber, PriceRunner, Junglee, Shopzilla, and DealTime.

Activity Impact Filter

Let us perform the following activity to understand how AI learns from data.

Objective: The Impact Filter experiment has huge data of images of various species. While performing this experiment, one can experience how rising temperatures impact the survival of various species and how it would affect our daily lives. Let us perform the activity. • •

Visit the link https://artsexperiments.withgoogle.com/impactfilter/ The following screen appears.

138


•

Click on the CLICK TO START button.

•

You will be redirected to a tutorial on how to explore this experiment. If you wish to take the tutorial then follow the steps given in the tutorial. Otherwise, you can exit the tutorial.

•

Now, from the top bar, select any of the given options of various species categories, such as insects, birds, reptiles, amphibians, and so on.

• • •

Let us click on the INSECT category.

Another web page with an option to select from an insect will appear. Click on any of the insects, for example, BUMBLEBEE.

Chapter 2 • Basics of AI

139


•

The web page showing the population of bumblebees will open. This number of bumblebees is presented at the current global temperature, which has already increased by 1.20 ºC.

•

On this web page, you can see a bar on the right side, displaying the temperature.

•

Move the slider upwards by dragging the mouse pointer to increase the temperature bit-by-bit.

•

You can observe the impact of rising temperature on the population of bumblebees that decreases as you increase the temperature.

•

Similarly, you can try the same with the other species as well and understand the impact of rising global temperatures on these species.

Computer Vision

Computer Vision is another important domain of AI which uses cameras to see and understand visual information. For example, by using cameras to monitor the environment and keeping an eye on the activity at the front door, a smart home security system makes use of computer vision. It detects familiar faces to unlock the door for family members and sends alerts for unfamiliar faces. Applications of Computer Vision Computer vision has numerous applications across various fields. Some of the most common applications include: Autonomous Vehicles: Computer vision enables vehicles to perceive and understand their surroundings, identifying objects like pedestrians, traffic signs, and other vehicles to navigate autonomously.

Healthcare: In medical imaging, computer vision aids in diagnostics by analysing images from X-rays, MRIs, and CT scans to detect anomalies and assist medical professionals in making accurate diagnoses. Retail: Computer vision powers applications, such as automated checkout systems in retail stores, where cameras identify and track items selected by shoppers, enabling seamless transactions without the need for manual scanning. Security and Surveillance: Video surveillance systems use computer vision to monitor environments in real-time, detecting suspicious activities, recognising faces, and alerting authorities to potential threats.

Activity AutoDraw

Let us perform the following experiment to understand how AI uses computer vision to see and understand visual information. Objective: AutoDraw is a fun and free online drawing tool based on computer vision. It uses AI to guess your drawing and provides suggestions to turn your scribbles into complete drawings.

140


Follow the given steps to explore how this application works. 1. Visit the link: https://www.autodraw.com/ 2. The following window appears.

3. Click on the Start Drawing button. 4. Now, select the AutoDraw

tool from the left panel.

5. As soon as you begin to scribble in the drawing area, the AutoDraw tool will make use of computer vision to guess your drawing.

6. Choose the drawing from the list of suggestions provided in the top bar that most closely resembles the one you plan to create.

Chapter 2 • Basics of AI

141


7. You may further customise your drawing by using the Shape tool to draw a circle for the eyes and fill in colours using the Fill tool.

Fill Tool Shape Tool

Natural Language Processing

Natural Language Processing (NLP) is a domain of AI that enables computers to understand human language and generate appropriate responses when we interact with them.

Hi!

101010

It allows computers to talk to us in a way that feels natural to us. Popular examples of NLP applications include Google Assistant, Apple’s Siri, Amazon’s Alexa, Google Translate, etc.

Hello!

100101

NLP

Applications of Natural Language Processing Natural Language Processing (NLP) has several key applications across different domains. Here are some of the common applications:

Language Translation: NLP is used extensively in translation applications like Google Translate, where it processes and translates text from one language to another, preserving context and meaning. Sentiment Analysis: NLP techniques analyse text data to determine the sentiment or opinion expressed. This is used in social media monitoring, customer review analysis, and market research to gauge public opinion and sentiment towards products or brands.

Chatbots and Virtual Assistants: NLP powers chatbots and virtual assistants like Siri, Alexa, etc. These systems understand and generate human-like responses to user’s queries, providing information, assistance, and help in performing tasks.

Information Extraction: NLP is used to extract structured information from unstructured text sources such as documents, articles, and emails. This includes named entity recognition (identifying names of people, organisations, and locations) and relationship extraction. This helps in tasks like summarisation and knowledge base construction.

Did You Know? Email filters are one of the most basic and initial applications of NLP online. It started with spam filters, uncovering certain words or phrases that signal a spam message.

Think and Tell

Which app can identify and provide information about objects and landmarks using your camera?

Activity Wordtune

Let us perform the following experiment to understand how AI makes use of NLP.

Objective: Wordtune is an AI-powered writing assistant that helps users improve their writing in various ways. It suggests alternative ways to phrase sentences, offer synonyms, different sentence structures, and maintain the

142


original meaning. When prompted, Wordtune can generate additional text to elaborate on ideas and create new content that aligns with the existing text. Let us explore wordtune. •

Visit https://www.wordtune.com/ in your web browser. The following window appears. Click on the Get started button.

•

You will be prompted to sign in with your Google, Apple, or Facebook account. Choose any option and login to the portal.

•

Next, you will be asked about your purpose of using the Wordtune portal. You can select “Study”.

•

Select the language by entering your preferred language.

Chapter 2 • Basics of AI

143


•

The Wordtune portal opens. You have two options: {

{

Copy and Paste: Copy the text you want to improve and paste it into the large text box on the Wordtune homepage. Write Directly: You can directly write your text in the text box if you have not already copied it.

•

If you want to adjust the writing style, choose from options like “Formal”, “Casual”, “Expand”, “Shorten”, etc., located above the text box.

•

Click the blue “Rewrite” button above the text box.

•

Wordtune will display several suggestions for rephrased sentences or expanded text (depending on your input) alongside your original text.

•

Click on the suggestion you prefer to see it replace the original text in the main text box.

•

Once you are happy with the revised text, you can copy it to your clipboard or download it as a document.

144


Activity Time Activity 1: Let’s Discuss

(Group Work)

As a class, participate in a discussion on the topic ‘AI vs Machine Learning vs Deep Learning’. Activity 2: Let’s Play

(Individual Work)

Using the internet, find out some interesting links for the games related to the domains of AI. Share the links in the class and play the games to understand about the domains of AI.

Chapter Checkup A Select the correct option. 1 Which of the following is a domain of AI?

a Computer Vision b NLP

c Data Science d All of these

2 ...................... is a collection of raw facts that can be transformed into useful information. a Data b Deep Learning c Machine Learning d NLP 3 Which among the following is an application of NLP? a Google Translate b AutoDraw c Alexa d Both a and c 4 ...................... enables a computer system to learn from experience using the provided data and make accurate algorithms for predictions. a Computer Vision b NLP c Machine Learning d Deep Learning B Fill in the blanks with the most suitable words. 1 ...................... is an AI function that mimics the workings of the human brain in processing data for use in detecting objects. 2 ...................... is a domain of AI that uses cameras to see and understand things. 3 ...................... is the father of AI. 4 Wordtune is an AI-powered writing assistant based on the ...................... domain of AI. C

State whether the following statements are True or False. Correct the statements that are false. 1 AI can help recognise faces in pictures. 2 AI learns from data fed into algorithms. 3 Computer vision helps computers understand and respond when we talk to them. 4 NLP techniques analyse text data to determine the sentiment or opinion expressed.

Chapter 2 • Basics of AI

145


D Answer the following questions. Q1. Define deep learning. A1. Deep Learning is a subset of machine learning in which a machine is trained with vast amounts of data. It is an AI function that mimics the working of the human brain, processing information for tasks, like object detection, speech recognition, language translation, and decision-making. Q2. What is Natural Language Processing? List any two applications of NLP. A2. Natural Language Processing (NLP) is a domain of AI that enables computers to understand human language and generate appropriate responses when they interact with humans. Two applications of NLP are: Language Translation: NLP is used extensively in translation applications like Google Translate, where it processes and translates text from one language to another, preserving context and meaning. Sentiment Analysis: NLP techniques analyse text data to determine the sentiment or opinion expressed. Q3. Explain any three applications of data science. A3. Three applications of data science are: Marketing: Understanding customer demographics, preferences, and online behaviour allows companies to develop targeted marketing campaigns and optimise their marketing budget. Public Health: Analysing disease outbreaks and tracking vaccination rates helps public health officials make informed decisions about resource allocation and disease prevention strategies. Scientific Research: Data science allows researchers in various fields to analyse massive datasets, leading to new discoveries and advancements in medicine, science and technology, and other areas. Q4. Yash recently installed a smart home security system that uses facial recognition technology. Name the domain of AI that this security system uses. A4. The domain of AI that is used by the security system is Computer Vision.

AI Activities 1 V isit the link: https://tenso.rs/demos/fast-neural-style/ to edit digital images by transferring the visual style from the source image to an uploaded image or an image captured through webcam. 2 V isit the link: https://transformer.huggingface.co/doc/distil-gpt2 to see how AI autocompletes your thoughts as you type. 3 V isit the link: https://artsandculture.google.com/experiment/blob-opera/AAHWrq360NcGbw?cp=e30 to create amazing operatic music.

Answer Key A

1. d

B

1. Deep Learning

C

1. True

2. T rue

2. a

3. c

4. c

2. Computer Vision

3. John McCarthy

4. NLP

3. False. Natural Language Processing helps computers understand and respond when we talk to them.

4. True

146


Unit 1 • Introduction to Artificial Intelligence

3 AI Ethics

I

n 2019, ProPublica, a non-profit organisation, conducted a study on an AI algorithm used by Upstart, a startup that provides personal loans. The study found that African Americans were more likely to be denied loans or offered higher interest rates compared to white borrowers, even when their credit profiles were similar. This highlights an important concern about biased algorithms and their potential impact on discriminatory practices. Ethical practices are crucial in AI development to ensure fairness and prevent unjust outcomes. AI ethics directly addresses these issues by providing a set of fundamental values for ethical AI development.

Ethics can be defined as the set of rules that direct our actions so that we make the best possible decisions for the benefit of everyone. Ethics deals with questions about what is morally right and wrong, good and bad, fair and unfair. It involves the study of principles, standards, and systems that guide human conduct and the moral consequences of human actions.

Moral Issues: Self-Driving Cars Scenario 1:

Imagine it’s the year 2030. Self-driving cars, which are currently just a concept, have become a reality and are now common on the roads. These cars, equipped with advanced features, are expensive but offer significant convenience, prompting people to purchase them for their daily commutes.

Now, let us assume that one day, your father is on his way to the office in his self-driving car, comfortably seated in the back as the car navigates itself. Suddenly, a small boy comes in front of the car. What should the car do? Should it prioritise the safety of the passenger, pedestrian, or both? These are tough decisions. During the development of a car’s algorithms, the car developer faces various dilemmas. The moral judgements of the developer directly impact the car’s decision-making processes. In other words, the choices made by the developer—whether consciously or unconsciously—get embedded into the car’s programming.

In this scenario, the self-driving car must make a split-second decision that involves potential harm to either the pedestrian or the passenger. The developer’s ethical standpoint becomes critical because it dictates the car’s response. Some might argue that preserving human life is paramount, thus prioritising the boy’s safety over property. However, the passenger is also a human, which complicates the decision. Some might also contend that the car should protect its occupants, as they have entrusted their lives to its technology. This situation mirrors If you were the developer and had to choose between these two outcomes the classic “trolley problem” in ethics, where one must choose between with no other alternatives, which two harmful outcomes. The developer’s choice in programming the car’s would you prioritise and why? responses will reflect deep-seated ethical beliefs about the value of life, responsibility, and the role of technology in making moral decisions.

Think and Tell

147


Scenario 2:

Now, let us assume that the car hits the boy who came in front of it. In this situation, who should be held responsible for the accident, and why? 1. The owner of the car

2. The manufacturing company

3. The developer who created the car’s algorithm

4. The small boy who unexpectedly came in front of the car and got injured ............................................................................................................................................................................................................................................. ............................................................................................................................................................................................................................................. ............................................................................................................................................................................................................................................. .............................................................................................................................................................................................................................................

In this scenario, opinions on responsibility may vary, and it is essential to recognise that different perspectives exist. Each person might make a decision based on their moral reasoning, and no single perspective is definitively right or wrong. Understanding the varied viewpoints is crucial in addressing the ethical complexities of self-driving technology.

Activity Moral Machine

The Moral Machine is an online platform developed by researchers at the Massachusetts Institute of Technology (MIT). It presents users with scenarios where they must make decisions about how self-driving cars should prioritise lives in various hypothetical crash situations. In the end, you can see how your responses compare with those of other people. Objective: To understand more about the impact of moral concerns. Follow the steps to use the Moral Machine platform: 1. Visit the link: https://www.moralmachine.net The Home page of the website appears.

2. Select your preferred language.

148


3. Click on the Start Judging button. The screen shows different scenarios of self-driving cars. 4. Click on the Show Description button for both scenarios. You will then be able to see the descriptions of different scenarios that the self-driving cars may have to face while travelling on the road. Each scenario is depicted as the two possible outcomes of the inevitable deaths of passengers or pedestrians, young or old, male or female, pedestrians following or not following traffic rules, etc. Make the best judgement about these inevitable ethical problems and guide the self-driving car to what it should do by clicking on either of the two images.

5. Continue answering the questions until you see your results.

The following are some of the conclusions based on your results:

• You may identify which characters you liked better based on the results of the scenarios.

• Saving more lives is important to you. You consistently chose to save as many people as possible in the given scenarios. • You are more concerned with protecting pedestrians than passengers. • You are committed to strictly upholding the law. Chapter 3 • AI Ethics

149


Ethical Issues Around AI

Though AI technologies can significantly improve human capabilities, they also come with several risks and difficulties. As AI becomes increasingly integrated into various aspects of our lives, it raises ethical questions that require careful consideration. To ensure that AI maximises advantages while reducing potential harm, these ethical problems must be addressed.

Ethical Issues around AI AI Access

AI Bias

Data Privacy

In the digital age we live in today, data is both a great asset and a liability. For example, companies collect vast amounts of data on consumer behaviour, preferences, and demographics. This data is an asset because it allows businesses to tailor their products and marketing strategies to meet consumer needs more effectively, potentially increasing sales and customer satisfaction. However, data also represents a liability. If a company experiences a data breach, sensitive customer information, such as credit card numbers, addresses, and personal identification, can be exposed. This can lead to financial loss for customers, legal consequences for the company, and damage to its reputation. Therefore, we must comprehend and prioritise data privacy. Both individuals and organisations can protect their private data and maintain trust in the technology world by implementing strong privacy practices and staying informed about new regulations and threats. By using strong passwords, enabling two-factor authentication, regularly updating software, and being cautious when sharing personal information, individuals can secure their data. Organisations can enhance security by encrypting data, conducting regular security audits, training employees on data protection, and complying with current privacy laws. One major source of data is smartphones. Smartphones are an integral part of our daily lives. They offer conveniences like online food ordering, shopping, ticket booking, and streaming. Smartphones also provide customised recommendations and notifications based on user behaviour. Let us understand this with the help of some examples: •

If you talk about buying a bag with a friend, you will soon receive notifications from shopping sites suggesting bags.

•

If you do a Google search for a trip to Goa, it will trigger travel package advertisements across your apps or web pages.

•

Even if your phone is locked and you are discussing a book face-to-face with your friends, it will send notifications about similar books or the same book once you unlock it.

Think and Tell

Are we comfortable sharing our data with the external world?

How do smartphones know this? When you install apps, they request permission to access your phone’s data. Without granting these permissions, the app won’t function. Users often grant these permissions without a second thought, allowing apps to access various sensors on the smartphone and gather data. Smartphones come equipped with various sensors that remain active whenever the phone is on. It’s important to recognise that the data collected by various applications is gathered ethically, as smartphone users consent to it by granting permissions and accepting the terms and conditions. The appropriate management, collection, storage, and sharing of individual information is referred to as data privacy. It includes all of the procedures and policies that businesses and people must adhere to safeguard private data from misuse, unauthorised access, and security vulnerabilities. Some key aspects of data privacy are: •

Security of personal data: Anything that may be used for identifying a specific person, such as names, addresses, phone numbers, social security numbers, and online identifiers, is considered private data.

150


Enforcing safeguards to guarantee that personal data is used only for allowed activities and can only be accessed by those who have been granted access is known as data protection. •

Consent from the User: Users should have control over their personal information. This involves understanding the types of data being gathered, their purposes, and their intended applications. Consent from users is necessary before any data is collected or used.

•

Data minimisation: Companies should only gather data that is necessary for the particular goal they have stated. Excessive data collection increases the risk of misuse and security breaches.

•

Data security: Safeguarding personal information from cyberattacks and illegal access requires robust security measures, including antivirus programs, access controls, and cryptography.

•

Transparency: Organisations should be transparent about their data handling practices. This includes providing clear privacy guidelines and promptly alerting users of any data breaches.

Think and Tell

Why do we need to collect data?

AI Bias

Another critical aspect of AI ethics is bias. Biases are inherent in everyone, regardless of efforts to remain neutral. While biases are not always negative and can sometimes be useful for effective decision-making, in the realm of AI, bias poses unique challenges. We know that machines cannot think independently. While machines can possess intelligence, they do not inherently have biases. Any bias in an AI system arises from the choice made by the developers while developing the algorithms. Let us understand the concept of AI bias with the help of examples. Virtual Assistants and Gender Bias Most virtual assistants have traditionally been given female voices. Recently, some companies have started offering male voice options, but female voices have been predominantly preferred since the inception of virtual assistants. Possible reasons include societal stereotypes that associate female voices with helpfulness and approachability, which may influence user acceptance and comfort. Search Engine Results When searching for salons on Google, the top results are often for female salons. This assumes that the majority of people searching for salons are female. This is an example of a bias based on gender assumptions. While it may not seem harmful, it reflects and reinforces stereotypes that can be limiting and exclusionary. Facial Recognition Technology Facial recognition systems have been found to have higher error rates for people with darker skin tones compared to those with lighter skin tones, often resulting in two types of errors: false positives and false negatives. •

False Positives: This occurs when the system incorrectly identifies one person as someone else. For example, a facial recognition system might mistakenly identify two different individuals with darker skin tones as the same person. This could lead to unauthorised access or wrongful actions taken against the person identified, as the system mistakenly treats them as someone else.

Chapter 3 • AI Ethics

151


•

False Negatives: This happens when the system fails to recognise a person it should correctly identify. For instance, someone with darker skin might repeatedly fail to unlock their phone using facial recognition, despite being the rightful owner.

An example of these errors is the 2018 study by the National Institute of Standards and Technology (NIST), which found that facial recognition algorithms were significantly less accurate in identifying African-American and Asian faces compared to Caucasian faces (people with features commonly associated with European ancestry). This discrepancy can lead to serious consequences, such as biased policing and discrimination. Hiring Algorithms Some companies use AI to screen job applicants. However, these algorithms can inherit biases from historical hiring data. For instance, if a company has historically favoured male candidates for technical roles, AI might continue this trend, disadvantaging female applicants. This perpetuates gender bias and undermines diversity efforts. Loan Approval Systems AI systems used by banks to approve loans may exhibit bias if they are trained on historical data that reflects discriminatory lending practices. This can result in unfairly denying loans to certain demographics. Such biases can increase socio-economic disparities.

Error Alert! AI systems can inherit biases from training data, requiring careful design and oversight to ensure fairness.

AI Access

AI access refers to the increasing availability of AI tools and technologies for people and businesses across various fields. This means advanced computing power is becoming easier for everyone to use. For example, businesses are using AI for customer service with chatbots, and researchers are using AI to make important scientific discoveries. AI access is helping to bring high-tech solutions into everyday life, leading to more innovation and progress in society. However, AI is developing quickly, and not everyone has equal access to it. People who can afford AI-powered devices gain many benefits, while those who can’t are left behind, making the digital divide worse. This growing gap is a serious concern, especially as technology keeps advancing rapidly. Let us understand the concept of AI access with the help of various examples. AI and Unemployment AI is improving user convenience by streamlining numerous tasks. Many jobs that once required a great deal of human labour can now be automated with a few clicks. In the future, AI might replace a large number of manual tasks that people have historically completed by hand. While increased efficiency is promised, there are worries about widespread job losses as well. Employees with low skill sets may be more at risk of losing their jobs if they are unable to adjust to changing demands. However, in this changing environment, individuals who can keep up with the latest developments could prosper.

152


For example, in the manufacturing industry, AI-driven robots are increasingly doing assembly, packing, and quality monitoring tasks, which could lead to the displacement of factory humans that depend on these occupations. Although these developments save expenses and increase productivity, they also pose a danger to employment for those who might find it difficult to shift into new professions. The question of whether automation’s advantages exceed its potential to cause widespread unemployment is at the heart of the discussion surrounding AI and jobs. It makes us question if adopting technology that boosts productivity but upends employment markets is better than maintaining manual labour, even for the less skilled. AI for Kids Children nowadays readily adopt technology and frequently pick it up before adults do. However, the question remains if young kids should be given access to cutting-edge devices that may stunt their cognitive development. For example, teenagers using AI-driven apps for essay writing may benefit from grammar and style suggestions, but relying too heavily on such tools could hinder their ability to develop critical writing and thinking skills. Similarly, young kids who play instructional games with AI-powered features could find them engaging, but an overindulgence in technology could hinder their ability to solve basic problems. Whether exposing kids to technology in ways that could hinder their ability to develop normally or not is still debatable. Limiting technology use could ensure that kids gain the benefits of modern technology in moderation while still acquiring the necessary skills through traditional teaching techniques.

Activity Time (Individual Work)

Activity 1: Creating a Presentation

Assign students the task of developing a policy proposal addressing a specific ethical challenge posed by AI (e.g.,

algorithmic bias in hiring). They should conduct research on current policies, consult experts or stakeholders, and draft a detailed proposal outlining regulatory measures or guidelines. Each student will present their proposal, highlighting the ethical considerations and the anticipated impact on various stakeholders.

(Individual Work)

Activity 2: Research Work

Assign students the task of drafting an ethical code or guideline for the development and deployment of AI technologies.

They should research existing ethical frameworks and guidelines, identify gaps or areas of improvement, and propose their own set of principles. Each student can then justify their choices based on real-world examples of ethical lapses in AI.

Chapter Checkup A Select the correct option. 1 AI systems can potentially increase biases present in .......................

a development b training data

c implementation d user interaction

2 Data privacy involves:

a maximising data collection c ensuring data is accessible to everyone

Chapter 3 • AI Ethics

b minimising data security measures

d safeguarding personal information

153


3 The digital divide in AI access refers to:

a differences in AI capabilities between countries c the need for AI regulation

b disparities in access to AI technologies d AI’s impact on unemployment rates

4 The ...................... is an online platform developed by researchers at MIT to present users with scenarios about decisions for self-driving cars in hypothetical crash situations. a Moral Machine b Car Machine

c Teachable Machine d Training Machine

B Fill in the blanks with the most suitable words. 1 The appropriate management, collection, storage, and sharing of individual information is referred to as ....................... 2 ...................... are the set of rules that direct our actions so that we make the best possible decisions for the benefit of everyone. 3 ...................... are inherent in everyone, regardless of efforts to remain neutral. 4 Data privacy involves protecting ...................... from unauthorised access. 5 In the digital age we live in today, ...................... is both a great asset and a liability. c

State whether the following statements are True or False. Correct the statements that are false. 1 People who can afford AI technologies benefit, while those who can’t are left behind, worsening the digital divide. 2 Most virtual assistants have traditionally been given male voices. 3 AI systems can gather and analyse personal data without the explicit permission of the subjects. 4 Some companies use AI to screen job applicants. 5 When you install apps, they request permission to access your phone’s data.

D Answer the following questions. (Solved) Q1. Define AI access. A1. AI access refers to the increasing availability of AI tools and technologies for people and businesses across various fields. This means advanced computing power is becoming easier for everyone to use. Q2. How do smartphones collect data about your activities and preferences? A2. Smartphones gather data by accessing various sensors that remain active whenever the phone is on. When users install apps, they are asked to grant permissions to access their phone’s data. Without granting these permissions, the app won’t function. Users often grant these permissions without much thought, allowing apps to collect data. This data is gathered ethically, as users consent by accepting the terms and conditions. Q3. List down the potential key aspects of data privacy. A3. Some key aspects of data privacy are: •

Security of personal data: Anything that may be used for identifying a specific person, such as names, addresses,

phone numbers, social security numbers, and online identifiers, is considered private data. Enforcing safeguards to

guarantee that personal data is utilised only for allowed activities and can only be accessed by those who have been granted access is known as data protection. •

Consent from the User: Users should be in charge of their personal information. This entails being aware of the types of data being gathered, their purposes, and their intended applications. Users’ express consent is required before any data is gathered or used.

154

•

Data minimisation: Companies ought to only gather data that is required for the particular goal they have stated. A

•

Data security: Safeguarding personal information from cyberattacks and illegal access requires the implementation

lot of data collection raises the possibility of abuse and security breaches.

of robust security measures including antivirus programs, access controls, and cryptography.


•

Transparency: Organisations need to be open and honest about how they handle data. This entails offering transparent privacy guidelines and promptly alerting users to data breaches.

Q4. How can biases arise in AI systems, given that machines cannot think independently? A4. Biases in AI systems arise from the data and algorithms used during development. Since machines themselves do not think independently, the biases typically come from the choices made by developers, such as the selection of training data, how the algorithm is designed, or assumptions made during the process. If the data used is biased or unrepresentative, the AI system may learn and replicate these biases in its outputs. Q5. What ethical concerns does the traditional preference for female voices in virtual assistants highlight? How might this practice contribute to broader issues in AI? A5. The traditional preference for female voices in virtual assistants highlights ethical concerns related to AI bias. This practice can perpetuate the idea that women are more suited for supportive roles, potentially affecting societal perceptions and limiting gender diversity in technology. Q6. Jatin is a developer working on an AI system used for loan approvals in a bank. During testing, he noticed that the system consistently denied loans to applicants from certain demographic groups. How should Jatin address this issue from an ethical standpoint? A6. This scenario highlights potential bias in AI systems due to skewed training data. Jatin should review and diversify the training data to ensure it accurately represents all demographic groups. Implementing bias detection algorithms and continuous monitoring can help identify and mitigate such issues before deployment, ensuring fair and unbiased loan approval decision.

AI Activities 1 Visit the link: https://www.youtube.com/watch?v=NgaW_p7gsRc to learn more about ‘Ethics of AI Bias’. 2 V isit the link: https://www.youtube.com/watch?v=VqFqWIqOB1g to learn about ‘Ethics of AI: Challenges and Governance.’

Answer Key A

1. b

B

1. Data privacy

C

1. True

2. d

3. b 2. Ethics

4. a 3. Biases

4. Personal information

5. Data

2. F alse. Most virtual assistants have traditionally been given female voices. 3. True 4. True 5. True

Chapter 3 • AI Ethics

155


Unit Reflection

Key Terms • Intelligence: Intelligence can be defined as a trait or ability to learn and use information to solve problems and adapt to new situations. • Artificial Intelligence: AI (artificial intelligence) is a branch of computer science that deals with the study of the principles, concepts, and technology of building machines. It enables machines to think, act, and learn like humans. • Machine Learning: Machine Learning is a subset of AI that enables machines to improve at a task. It enables a computer system to learn from experiences using the provided data and make accurate algorithms for predictions or decisions. • Deep Learning: Deep Learning is a subset of machine learning in which a machine is trained with vast amounts of data. • Data: It is a collection of raw facts that can be transformed into useful information. It can be in the form of text, images, audio, or video. • Data science: It is a vast and interdisciplinary field that involves extracting knowledge and insights from data. • Computer Vision: Computer Vision is an important domain of AI which uses cameras to see and understand visual information. • Natural Language Processing (NLP): NLP is a domain of AI that enables computers to understand human language and generate appropriate responses when we interact with them. • Ethics: Ethics can be defined as the set of rules that direct our actions so that we make the best possible decisions for the benefit of everyone. • Data Privacy: The appropriate management, collection, storage, and sharing of individual information is referred to as data privacy. • Data Protection: Enforcing safeguards to guarantee that personal data is used only for allowed activities and can only be accessed by those who have been granted access is known as data protection. • AI access: AI access refers to the increasing availability of AI tools and technologies for people and businesses across various fields.

Things to Remember • There are several distinct types of intelligence that individuals possess in varying degrees. These are mathematical and logical intelligence, musical intelligence, linguistic intelligence, intrapersonal intelligence, interpersonal intelligence, naturalist intelligence, existential intelligence, spatial and visual intelligence, and kinaesthetic intelligence. • A good decision considers all information, weighs potential consequences, and aligns with values and long-term goals. • There are various applications of AI in daily life, such as virtual assistants, personalised recommendations, facial recommendations, gaming, healthcare applications, autonomous vehicles, language translation, etc.

156


• AI enhances computer performances by learning from data. The more the data, the more intelligent the machine becomes. • AutoDraw is a fun and free online drawing tool based on computer vision. It uses AI to guess your drawing and provides suggestions to turn your scribbles into complete drawings. • Wordtune is an AI-powered writing assistant based on NLP. It helps users improve their writing in various ways. • The Moral Machine is an online platform developed by researchers at the Massachusetts Institute of Technology (MIT). It presents users with scenarios where they must make decisions about how self-driving cars should prioritise lives in various hypothetical crash situations. • In the digital age we live in today, data is both a great asset and a liability. • Any bias in an AI system arises from the choice made by the developers while developing the algorithms. • Assembly line robots follow pre-programmed instructions without learning or adapting, making them examples of automation rather than true AI. • A fully automatic washing machine depends on human input to choose the washing settings and prepare the load before it can start. This human intervention for configuring each wash cycle highlights that it functions through automation, not AI. • An air conditioner can be operated remotely through internet connectivity, but it still requires human input to set its functions. This capability exemplifies the Internet of Things (IoT), where devices are connected and controllable via the internet, but they do not possess autonomous decision-making abilities or learning capabilities. • Machines become artificially intelligent through a process that involves training them with vast amounts of data and sophisticated algorithms.

Unit Reflection

157


Test Your Knowledge A. Select the correct option. 1. Which of the following best describes naturalist intelligence? a. The ability to solve mathematical problems and reason logically. b. The capacity to recognise, categorise, and understand patterns in the natural environment. c. The skill to compose music and understand rhythm and melody. d. The talent to express oneself clearly through language and writing. 2. A principal is deciding whether to implement a new learning platform. What should be their main focus? a. Popularity of the platform

b. Cost of the platform

c. Impact on student learning

d. Ease of integration

3. Which of the following is NOT a common application of computer vision? a. Enabling autonomous vehicles to identify objects and navigate. b. Assisting in medical diagnostics by analysing images from X-rays and MRIs. c. Powering automated checkout systems in retail stores. d. Enhancing audio quality in video conferencing systems 4. Which of the following is a key application of Natural Language Processing (NLP)? a. Enhancing video quality in streaming services. b. Extracting structured information from unstructured text sources. c. Automating financial transactions in banking systems. d. Improving the battery life of mobile devices. 5. What is the primary purpose of the Moral Machine platform developed by MIT? a. To test the efficiency of self-driving car algorithms. b. To allow users to make decisions on prioritising lives in hypothetical crash scenarios. c. To simulate different traffic conditions for autonomous vehicles. d. To evaluate the performance of vehicle sensors in real-world conditions. 6. Which of the following best explains why a fully automatic washing machine is considered automation and not AI? a. It learns from previous wash cycles to improve performance. b. It adapts to the type of fabric without human intervention. c. It follows pre-set instructions for each wash cycle without learning or adapting. d. It adjusts the washing settings based on user preferences over time.

B. Fill in the blanks with the most suitable words. 1. The appropriate management, collection, storage, and sharing of individual information is referred to as 2. In the manufacturing industry,

158

are increasingly doing assembly, packing, and quality monitoring tasks.

.


3.

is a subset of AI that enables a computer system to learn from experiences using the provided data and make

4.

is a vast and interdisciplinary field that involves extracting knowledge and insights from data.

accurate algorithms for predictions or decisions.

5. A

language queries.

is an example of a system that uses artificial intelligence (AI) to understand and respond to natural

C. State True or False. Correct the statements that are False. 1. The facial recognition technology on our smartphones is powered by AI. 2. People with high kinaesthetic intelligence are often skilled in physical activities such as sports, dance, acting, etc. 3. Video surveillance systems use computer vision to monitor environments in real-time. 4. Wordtune is an AI-powered writing assistant based on computer vision. 5. Organisations should be transparent about their data handling practices.

D. Short-answer type questions. 1. How do streaming services use AI to make content recommendations? 2. Why is a fully automatic washing machine considered an example of automation rather than AI? 3. How can AI algorithms used for screening job applicants cause gender bias?

E. Long-answer type questions. 1. What is a potential concern regarding young children using cutting-edge technology, and how might it affect their cognitive development?

2. What is computer vision? Explain any two applications of computer vision. 3. Differentiate between artificial intelligence, machine learning, and deep learning.

F. Competency-based questions. 1. Neelanjali is worried about job losses due to AI. What should she do to remain relevant in the changing job market? 2. Manish wants to explore ethical decision-making in self-driving cars. Which platform can he use to see how his decisions compare with those of others regarding prioritising lives in crash scenarios?

Unit Reflection

159


Unit 2 • AI Project Cycle

4 Introduction to AI Project Cycle

Y

ou are already aware of AI and its role in our daily lives. In this unit, we will learn about the AI project cycle, using an example to illustrate its stages.

Every project, from start to finish, goes through several stages or steps. These stages collectively form the project cycle. In the context of AI, the project cycle includes specific stages for developing and deploying AI solutions. By the end of this session, you will understand each stage of the AI project cycle and how they work together to complete an AI project. Let us consider a simple example of a project cycle: constructing a bridge.

Project Cycle

The following stages, or steps, are included in the construction of a bridge: Stage 1: Site Inspection and Planning: Identify the need for a bridge at a specific location. Study the site to understand the terrain, environmental impact, and any challenges that may arise. Stage 2: Collecting Resources: Collect all necessary information, such as environmental data, materials, labour, and equipment. Conduct surveys and gather data on soil stability, weather conditions, traffic patterns, etc. Stage 3: Analysing Site Data: Examine the gathered data to gain meaningful insights. Understand the site’s characteristics, such as soil type, load-bearing capacity, and potential environmental impacts. Stage 4: Designing the Bridge: Create detailed plans and models of the bridge structure. This includes designing the foundation, framework, structure, etc., using engineering software and simulations to predict performance. Stage 5: Testing and Quality Assurance: Evaluate its performance under various conditions by checking for weight capacity, stability, etc. to ensure the bridge meets overall safety and quality standards. The above steps are a simple example to illustrate how we plan to execute tasks in our daily lives. We need to create plans for every task we need to accomplish. This helps clarify our objectives. Similarly, when developing an AI project, the AI project cycle offers a structured framework that guides us towards achieving our goal.

AI Project Cycle

When a project is developed based on AI, it also goes through several stages, which are together known as the AI project cycle. This cycle represents the step-by-step process that an organisation or an individual should follow to develop and deploy an AI project while solving a problem. We can map the construction of a bridge to the five stages of the AI project cycle as follows:

160


Problem Scoping

Data Exploration

Data Acquisition

Problem Scoping

Evaluation

Modelling

AI Project Cycle

This is the initial stage that helps us understand the problems that need to be addressed and defines the goals to be achieved, with the help of an AI system. Identifying such a problem and having a vision to solve it is what problem scoping is about.

In the example of the construction of a bridge, problem scoping involves identifying the need for a bridge and understanding the site requirements by studying the terrain and potential challenges. It also includes understanding the goals of the project cycle, such as the type of bridge and its load capacity. Additionally, problem scoping assesses stakeholders’ needs and considers constraints like budgets, timelines, and environmental regulations.

Data Acquisition

Data acquisition means gathering or collecting data to solve the problem defined. Let us understand first what data is. Data is facts/figures/information collected for analysis purposes. Data may be in the form of numbers, text, forms, audio, videos, etc. For example, in an insurance policy project, the input data typically consists of numerical values, such as age, income, and policy details. In contrast, a social media project, such as those involving Instagram or Facebook, handles diverse input data types, including photos, text, audio, and videos.

Whenever we want any AI model to predict output, it must have a huge amount of data for its training. For an AI project to be efficient, authentic, and accurate, a huge amount of data collection is required. Data can be collected from surveys, blogs, laboratories, published articles/magazines, etc.

Remember

An AI model is an algorithm or a program that uses a set of data to make predictions from it or reach a conclusion.

Chapter 4 • Introduction to AI Project Cycle

Did You Know? Data for AI can come from your favourite apps, video games, and even the sounds around you.

161


Data Exploration

When we gather data from various sources, we cannot use it right away to train AI algorithms. We need to explore the data to clean it up and make it useful. This is done in the third stage of the AI project cycle, called data exploration. Data exploration helps us understand the data and determine if it is suitable for training AI models. Data exploration also leads to data visualisation, where we can identify patterns, trends, and relationships among the data values. Data visualisation helps to analyse the data in the form of pie charts, bar charts, scatter plots, histograms, etc. Thus, to analyse the data, you need to visualise it in some user-friendly format so that you can: •

Quickly get a sense of the trends, relationships, and patterns contained within the data.

•

Communicate the same to other team members in the project.

•

Define the strategy for which model to use at a later stage.

Modelling

When machines analyse the data, it needs the data in its most basic form (which is binary—0s and 1s). When it comes to discovering patterns and trends in data, machines rely on the mathematical representations of the collected data. Modelling means to model the data that will be used for prediction. Modelling is the process of creating various AI models based on visualised data from the previous step, enabling predictions and conclusions. To build an AI-based project, we need to work with AI models or algorithms. This could be done either by designing your model or using pre-existing AI models. Generally, AI models can be classified as learning-based models or rule-based models, which will be discussed in further chapters.

Did You Know? Some AI models are trained using super-powerful computers that can fill up an entire room!

Evaluation

Once the AI model is developed, it must be tested for its accuracy and performance using testing data. The developed AI model is tested with the help of the testing data (the testing data is separated from the acquired or gathered dataset at the data acquisition stage). Then the results are evaluated to decide if the model can be deployed in a real environment or if it needs any improvements. Evaluation is based on the outputs obtained by feeding data into the model and comparing these outputs with the actual answers.

162


AI PROJECT CYCLE

Problem Scoping

Data Acquisition

Data Exploration

Collecting data from different sources such as labs, sensors, surveys, etc. Identify problem and answer all questions to solve the problem.

Modelling

Evaluation

Developing algorithms, also called models which can be trained to get intelligent outputs.

Visualise data using bar graphs, pie charts, etc., to understand insights of data

Testing quality of developed model using some testing data to check accuracy.

Figure: AI Project Cycle in a Nutshell

Error Alert! There is a misconception that only computer experts are needed to make AI models. Creating AI models requires teamwork from people with different skills, like engineers, scientists, and business experts.

Activity Time Activity: Create a Weather Prediction Model

Have each student engage in a project focused on creating a weather prediction model.

(Group Activity)

Each student should prepare a presentation summarising their contributions to creating the weather prediction model.

They should also outline the stages of the AI project cycle they navigated, highlighting insights gained into weather prediction methodologies, challenges faced during data analysis and modelling, and key lessons learned throughout the project.

Chapter Checkup A Select the correct option 1 What is the first step in the AI project cycle?

a Teaching AI b Collecting Data c Problem Scoping

d Testing AI

2 Which step involves testing and quality assurance? a Evaluation b Collecting Data c Problem Scoping

d Data Exploration

3 What does the term “data acquisition” refer to in the context of AI? a Cleaning and preparing the collected data

b Identifying the problem to be addressed by AI

c Gathering or obtaining data for training AI models

d Assessing the performance metrics of the AI model B Fill in the blanks with the most suitable words: 1 ............................. is the process in which different AI models are created based on visualised data. 2 After training, AI system needs to be ..............................

Chapter 4 • Introduction to AI Project Cycle

163


3 Data exploration leads to .............................. 4 Testing how well AI works is known as .............................. C

State whether the following statements are True or False. Correct the statements that are false. 1 AI models do not need to be tested before being deployed. 2 Once an AI model is trained, it never makes mistakes. 3 The AI project cycle refers to the step-by-step process that needs to be followed to develop and deploy an AI project. 4 The last phase of the AI project cycle is data exploration.

D Answer the following questions. (Solved) Q1. Write the names of the missing stages in the given AI project cycle. Data Exploration

Data Acquisition

Modelling

A1. Problem Scoping and Evaluation.

Q2. What is data visualisation? Why is it important?

A2. Data exploration leads to data visualisation, where we can identify patterns, trends, and relationships among the data values. Data visualisation helps to analyse the data in the form of pie charts, bar charts, scatter plots, histograms, etc. Thus, to analyse the data, you need to visualise it in some user-friendly format so that you can:

• Quickly get a sense of the trends, relationships, and patterns contained within the data. • Communicate the same to other team members on the project. • Define a strategy for which model to use at a later stage.

Q3. Vanshdeep has been investing in the stock market for the past 10 months. He wants to analyse which shares have been profitable for him based on his investment history. Which phase of the AI project cycle is he in? A3. Data Exploration

AI Activities Visit the link: https://youtu.be/tLaLfaIJf-Y?si=I53jDu09iheZh4g4 to see the difference between training data and testing data.

Answer Key A

1. c

B

1. a. Modelling

C

1. a. False. AI models need to be tested before being deployed.

2. a

3. c b. Tested

c. Data Visualisation

d. Evaluation

b. False. Once an AI model is trained, it can still make mistakes. c. True.

d. False. The last phase of the AI project cycle is evaluation.

164


Unit 2 • AI Project Cycle

5 Problem Scoping and SDGs

P

roblem scoping is the first phase of the AI Project Cycle. During this phase, the project’s problem statement is defined. A well-defined problem statement is essential to set the direction for the entire project. Effective problem scoping leads to efficient use of resources and significantly increases the likelihood of successful outcomes. Now, let us learn about problem scoping in detail.

What is Problem Scoping?

Problem scoping involves defining and understanding the problem that needs to be solved using AI. During this phase, we aim to identify areas of concern, establish goals, and determine the objectives that these goals will achieve. Additionally, we consider any limitations that may exist in the project. Problem scoping is the process of identifying issues and envisioning solutions.

Choosing a Theme and Topic for the AI Project

The theme is the central subject of the problem. The theme helps in setting precise goals, understanding relevant challenges, and developing effective solutions. You can choose from one of the following themes to scope for your AI project: Environment

Agriculture

Traffic

Infrastructure

Health

Transport

Education

Digital Literacy

Women Safety

Disability

Entertainment

Cyber Security

165


Now, choose a topic that falls under this theme. Some examples of themes and their relevant topics are:

Theme: Transportation

Theme: Education

Theme: Agriculture

•

Smart traffic management

•

Ride-sharing platforms

•

Logistics and supply chain efficiency

•

Personalised learning

•

Student engagement

•

Remote education

•

Precision farming

•

Crop monitoring

•

Pest control

One can even choose a theme from the 17 SDGs (Sustainable Development Goals). Let us first understand what the SDGs mean.

Sustainable Development Goals (SDGs)

Sustainable Development Goals, often referred to as ‘Global Goals’, are a set of 17 goals adopted by the United Nations General Assembly in September 2015 to meet the needs of the world’s citizens without compromising the planet’s resources. The goal is to achieve these objectives by the end of 2030, a commitment that has been pledged by all the UN member nations.

The 17 Sustainable Development Goals

The 17 goals aim to address global challenges and enhance the lives and future prospects of people everywhere. The 17 SDGs are:

SDG 1: No Poverty Objective: To eradicate poverty everywhere by ensuring that everyone will have equal access to basic needs, economic opportunities, natural resources, and financial services.

166


SDG 2: Zero Hunger Objective: To end hunger and promote food security through sustainable agriculture. This SDG ensures that all people have access to sufficient, safe, and nutritious food all year round.

SDG 3: Good Health and Well-Being Objective: To ensure healthy lives and promote well-being for people of all ages by reducing mortality rates, preventing the deaths of newborns and children under five, and combating health-related issues such as communicable diseases, non-communicable diseases, and mental health challenges. SDG 4: Quality Education Objective: To ensure that all males and females complete primary and secondary education which is equitable and full of quality, with a focus on lifelong opportunities.

SDG 5: Gender Equality Objective: Treat everyone fairly, no matter if they are male or female. Gender equality means that boys and girls, men and women, should have the same rights, opportunities, and respect.

SDG 6: Clean Water and Sanitation Objective: To ensure health and well-being for people of all ages by providing access to clean drinking water and promoting adequate and equitable sanitation and hygiene. SDG 7: Affordable and Clean Energy Objective: To ensure and promote universal access to modern energy services for everyone, such as access to electricity and renewable energy resources. It will reduce greenhouse gas emissions and mitigate climate change. SDG 8: Decent Work and Economic Growth Objective: To promote decent employment opportunities for youth and adults, securing their socio-economic lives.

SDG 9: Industry, Innovation and Infrastructure Objective: This goal focuses on sustainable infrastructure, the growth of industries, and innovation. It will lead to economic development and improve the quality of life worldwide.

Chapter 5 • Problem Scoping and SDGs

167


SDG 10: Reduced Inequality Objective: To address and minimise income differences, cultural differences, and inequalities within and between countries and peers.

SDG 11: Sustainable Cities and Communities Objective: To promote urbanisation and development that aims to create safe and sustainable cities and human settlements.

SDG 12: Responsible Consumption and Production Objective: To spread awareness regarding the efficient use of natural resources so that it will lead to sustainable production and consumption.

SDG 13: Climate Action Objective: To address urgent actions to deal with climate change and its effects through awareness and mitigation strategies.

SDG 14: Life Below Water Objective: To reduce marine pollution, protect marine ecosystems, and reduce the impact of ocean acidification.

SDG 15: Life on Land Objective: To promote the conservation of plants, forests, mountains, deserts, and all creatures that inhabit these environments on Earth. Life on land encompasses all the plants, animals, and ecosystems that thrive on our planet. SDG 16: Peace, Justice and Strong Institutions Objective: It focuses on promoting peaceful and inclusive societies, ensuring access to justice for all, and establishing effective, accountable, and transparent institutions at all levels.

SDG 17: Partnerships for the Goals Objective: To promote partnerships among individuals, groups, and countries to work together to achieve a common goal through teamwork and cooperation.

Implementing AI projects that integrate SDGs not only addresses specific problems but also contributes to broader global development objectives.

168


Error Alert! There is a misconception that SDGs are meant only for large projects and large organisations. But in reality, SDGs are meant for everyone, including small businesses, local communities, and student-oriented projects.

Identifying Problems Around the Selected Topic

We can select a theme for the AI project based on SDG 6: Clean Water and Sanitation. After selecting the theme, we will choose the topic “Water Quality Monitoring” . Following are the issues related to the topic which AI systems can address: Water Quality Monitoring

Clean Water and Sanitation

Contaminated water can cause serious health problems, including diseases and infections.

Polluted water harms the environment, affecting wildlife and damaging ecosystems.

One AI-powered solution for addressing this issue is deploying AI-powered sensors to continuously monitor the quality of water in the supply system. If the AI detects something wrong with the water, it immediately sends an alert to the people in charge, so they can fix the problem right away. By leveraging AI, we can ensure safe and efficient water use.

Define Problem Statement and Set Actions

In problem solving, especially within the context of AI projects, it is essential to analyse the problem thoroughly before coming up with a solution. This analysis involves understanding how the problem impacts different stakeholders, identifying the core issue behind the problem, outlining the relevant context, and appreciating why it needs to be solved. The 4Ws Canvas is a strategic tool that focuses on four fundamental questions: Who, What, Where, and Why.

4Ws Canvas WHO? WHERE?

Problem Scoping

WHAT? WHY?

The 4Ws Canvas is a problem framing tool used to define and explain issues when solving a problem. 4Ws Canvas is useful for problem-analysis from different perspectives and helps gain a clear view of the problem that can be solved. The method involves collectively answering questions categorised into four sections:

WHO?

The ‘Who’ canvas helps identify the stakeholders who are affected directly or indirectly by the problem and those who would benefit from a solution. It allows us to understand who is impacted and how addressing the issue could benefit them. Chapter 5 • Problem Scoping and SDGs

169


WHAT?

In the ‘What’ canvas, we focus on understanding the problem we are dealing with and gathering evidence to confirm its existence. This involves defining the problem and verifying its reality through sources like newspaper articles, media reports, or other relevant information.

WHERE?

After identifying who is affected and understanding the nature of the problem, it is crucial to determine where the problem occurs. The ‘Where’ canvas examines specific situations or contexts in which the problem arises and identifies the locations where it is most prevalent. This helps us detail the scenarios and places where the problem is observed.

WHY?

Having gathered information about the problem, including who is affected, what it entails, and where it occurs, we now need to understand why it is important to solve it. The ‘Why’ canvas considers the benefits that stakeholders would receive from the solution and the positive impact on society. It details the advantages and societal benefits of addressing the problem.

Problem Statement Template

The outcome of problem scoping is the problem statement template. A problem statement template used in the problem scoping stage of an AI project cycle helps to clearly define the issue to be addressed. Using a problem statement template during problem scoping helps summarise all key points into one document. Now, let us create a problem statement template for our problem ‘Water Quality Monitoring’. Our • • •

Residents

Stakeholders WHO?

Businesses

Local Governments

Has a Problem Definition problem that Contaminants, pollutants, and changes in water conditions affect health and safety

WHAT?

When/ While

WHERE?

An ideal solution would be

Context/Location of the Problem In various water supply systems, including reservoirs, treatment plants, distribution networks, and consumer endpoints such as homes, businesses, and public facilities Reasons to Solve the Problem

• •

To protect public health by preventing waterborne diseases and contamination of water.

WHY?

To safeguard the environment by preventing harmful pollutants from damaging ecosystems

Did You Know? Problem-solving skills are highly valued by employers across industries because they demonstrate an ability to handle challenges and find solutions.

Activity Time Activity 1: Improving Recycling Programs in Your Community

(Team Work)

You are a group of students tasked with finding ways to improve the efficiency and effectiveness of recycling programs

in your community. The current recycling program often faces issues with low participation rates, insufficient educational outreach, etc. Create the 4Ws canvas on an A4 size sheet and fill in the required entries for each of the 4Ws. Also identify the SDG the program aims to achieve.

170


Activity 2: Enhancing Online Learning Experiences

(Team Work)

You are a group of students tasked with finding ways to enhance online learning experiences for students at your school. The current online learning platform often faces issues with engagement, technical difficulties, and a lack of interactive

content. Create the 4Ws canvas on an A4 size sheet and fill in the required entries for each of the 4Ws. Also identify the SDG the program aims to achieve.

Chapter Checkup A Select the correct option. 1 What is the primary objective of problem scoping? a To create a budget

b To define and understand the problem

c To hire project staff

d To buy new technology

2 How many Sustainable Development Goals were adopted by the United Nations General Assembly? a 10

b 15 c 17

d 20

3 Problem Scoping is the ...................... phase of the AI Project Cycle. a First

b Last

c Third d Second

4 Which of the following aspects is not directly covered by the 4Ws Canvas? a Who

b What c How

d Why

5 Which of the following SDGs focuses on ensuring access to affordable, reliable, sustainable, and modern energy for all? a SDG 3: Good Health and Well-being

b SDG 7: Affordable and Clean Energy

c SDG 12: Responsible Consumption and Production

d SDG 15: Life on Land

B Fill in the blanks with the most suitable words. 1 ...................... involves defining and understanding the problem that needs to be solved using AI. 2 Sustainable Development Goals are sometimes referred to as ....................... 3 The ‘Who’ canvas helps identify the ...................... directly or indirectly affected by the problem. 4 Using a ...................... helps summarise all key points into one document. c

State whether the following statements are True or False. Correct the statements that are false. 1 The outcome of problem scoping is the problem statement template.

2 Sustainable Development Goals aim to meet the needs of the world’s citizens without compromising the planet’s resources. 3 The theme is the central subject around which the problem is focused. 4 There is no SDG to address urgent actions to deal with climate change. D Answer the following questions. Q1. Define problem scoping. A1. Problem scoping is the first phase of the AI project cycle. Problem scoping involves defining and understanding the problem that needs to be solved using AI.

Chapter 5 • Problem Scoping and SDGs

171


Q2. What is 4W canvas? What is it used for? A2. The 4Ws Canvas is a problem framing tool used to define and explain issues when solving a problem. 4Ws Canvas is useful for problem-analysis from different perspectives and helps gain a clear view of the problem that can be solved. The method involves collectively answering questions categorised into four sections: Who, What, Where, and Why. Q3. A city is facing significant traffic congestion issues during peak hours. This problem leads to increased travel times, higher pollution levels, and a decreased quality of life for residents. The city council wants to implement an AI-based solution to manage and reduce traffic congestion. Identify the 4Ws for the mentioned problem definition. A3. The 4Ws (Who, What, Where, and Why) for the mentioned problem is as follows: Who?

What?

City residents, traffic authorities, and emergency services

Significant traffic congestion during peak hours Traffic reports, complaints, and feedback

Where?

Why?

Urban areas with high population density

Reduce travel time, improve traffic management, improve public safety, and decrease pollution

Q4. Niya noticed that in her village, many children are unable to attend school due to a lack of access to quality education. She plans to start a program that provides educational resources and teacher training to improve the learning environment for these children. Based on this scenario, identify the SDG that Niya is addressing. A4. SDG 4: Quality Education.

AI Activities Visit the link: https://experiments.withgoogle.com/voices-for-change and analyse how ‘Voices for Change —A Global Goals World’ brings to life thousands of voices in support of climate action.

Answer Key A

1. b

B

1. Problem scoping

C

1. True.

2. c

3. a

4. c

2. Global goals

5. b 3. Stakeholders

4. Problem statement template

2. T rue

3. True.

4. False. SDG 13 aims to address urgent actions to deal with climate change.

172


Unit 2 • AI Project Cycle

6 Simplifying Data Acquisition I

n our daily lives, we encounter various types of data, each serving a specific purpose such as healthcare data, meteorological data, transportation data, and finance data. Data can be a piece of information, facts, or statistics collected for a particular purpose. For example, consider determining the merit list for the 10th board exams. In this case, we need data related to students’ marks. Therefore, it is necessary to understand what kind of data is to be collected to work towards the goal.

The Importance of Data

Data serves as the backbone of AI systems, playing a crucial role throughout the AI project cycle in both quantitative and qualitative forms. AI models are trained based on the input data they receive. For example, if we want to predict the performance of a cricketer in the next match, this prediction can be made based on all of his or her previous performance records. The previous performance records are known as training data, while the next performance prediction data set is known as testing data. In this example, if the training data consists of records from a different cricketer instead, the machine would not predict the cricketer’s next performance correctly because the entire training process would be flawed. Similarly, if the previous performance data is not accurate, then the prediction could also be incorrect. Thus, for any AI project to be efficient, the training data should be authentic and relevant to the problem statement scoped.

Remember

Data is the fuel for AI: the more the data, the better the performance.

173


Characteristics of Data

As data is crucial for AI systems, data must be accurate to get correct output from AI system. Data should have the following attributes or characteristics: Accuracy: The information should be correct in all aspects.

Reliability: The data should come from trusted and reliable sources.

Relevance: The data must be pertinent to the project and useful for the AI system.

Timeliness: The data should be up-to-date.

Validity: The data should accurately represent what it is supposed to measure.

Completeness: There should be no missing or incomplete information.

Fig. Characteristics of Data

Data Features

Data features refer to the type of data that you want to collect. They are the building blocks that are used to train an AI model. They are individual measurable properties or attributes, extracted from data, that an AI model uses to learn and make predictions. Therefore, a careful selection of features plays a vital role in the quality of the output of an AI system. As discussed earlier in the example, an AI model predicts a cricketer’s performance in the next match based on their previous performances. In this example, data features would include runs scored, number of wickets taken, strike rate, batting average, bowling average, venue conditions, match formats, etc., in past matches. After identifying these data features, you will know what sort of data needs to be collected.

Data Acquisition

The process of collecting accurate and reliable data from various sources is called data acquisition. Before collecting data, you must determine the specific requirements by addressing certain questions: •

Why are the data features required?

•

Where can you get this data from?

•

How often does it take to get the data most of the time?

•

How frequently will the data be updated?

•

What will happen if there isn’t enough data available?

here can be several ways in which we can collect data. T Some of them are:

Think and Tell •

What type of data will you collect to predict the price of a newly built house?

•

What type of data is gathered in an online LUDO game to predict the next move?

1. Surveys: Surveys are used to collect data from a target audience to understand their preferences, opinions, choices, and feedback. For example, in a product feedback survey, companies ask customers about their experiences with a new product. This helps AI identify areas for improvement and suggest personalised recommendations. Surveys provide AI with valuable insights into consumer preferences and satisfaction. 2. Observations: The observation method of data collection involves essentially watching and meticulously recording things of interest. Unlike surveys, observation uses one’s senses to gather first-hand information on behaviours, events, or phenomena, offering valuable insights into real-world contexts. 3. Application Programming Interface (API): APIs (Application Programming Interfaces) are tools that enable different software applications to communicate and exchange data seamlessly. They offer a

174


standardised way for applications to request and receive information from other services or systems, making data acquisition more efficient and reliable.

Did You Know?

For example, when a weather app needs to display the current temperature, it can use an API from a weather service to fetch the latest weather data. This method is far more efficient and accurate than manually scraping data from websites.

Every time you use an app to check the weather mostly it is using an API.

4. Web Scraping Web scraping, or web harvesting, is a process of gathering information existing in websites or web pages. This method may necessitate the use of specific tools (known as web scraper) to acquire the required data. For example, if someone wants to track laptop prices on an e-commerce site, they can create a program to automatically browse the site, extract price information, and store the data. This method is efficient and timesaving, especially when large amounts of data are needed quickly. Gathering data from diverse and trustworthy sources enhances the performance and reliability of AI applications. Finding accurate information online can be challenging, as some websites may provide unreliable content. Therefore, it is important to rely on reputable sources, such as government websites, which often offer accurate, up-to-date, and freely available information. These sites act as a vast online library. Examples of data that can be obtained from such sites include statistical data, public health information, educational resources, and legal documents. Some examples of government websites are data.gov.in and india.gov.in. 5. Sensors Sensors are devices that collect real-time information and transform it into digital data, which can be analysed by computers. For instance, a heart rate monitor worn on a wristband tracks a person’s heart rate and converts it into digital data. This data is then analysed to monitor the individual’s health and provide insights or alerts about their cardiovascular condition. 6. Cameras Devices such as surveillance cameras help capture a large number of video and photographic data. For example, CCTV cameras are deployed for security reasons, to monitor traffic rule violations, to improve the management of parking spaces, etc.

System Maps A system map helps us understand how different types of data features are related to each other in an AI project. It shows what the relationship between two factors is and the effect of one on the other. By analysing the system map, we can see the positive and negative influences of different factors on the project. Let us look at the various factors to figure out the relationship between data features to predict the price of a house. Total area of the house

Total number of washrooms

Number of storeys

Access to public transportation

Number of rooms on each floor

Proximity to Busy Roads

Level of Pollution

Chapter 6 • Simplifying Data Acquisition

175


Now let us see how these factors are related to the problem statement using a system map: No. of Storeys Public Transport Access

Total Area

Pollution Lavel

House Price No. of Rooms

No. of Washrooms

Proximity to Busy Roads

In the above system map, you can see how the relationship of each factor is defined with the goal of the project. Here, the direct (positive) relationship of factors is represented with positive arrows, while the negative factors are represented with negative arrows to show inverse relationship. This means that if the positive factors will increase, the price of the house will increase. If the negative factors will increase, the price of the house will decrease.

Activity Time Activity: Testing Model's Accuracy

(Group Work)

Students can work in pairs. One gets a set of film ratings (numerical) and genres (categorical) for different films. They use

this to predict another student’s hidden ratings based on genre. Comparing these predictions to the actual ratings reveals the importance of unseen data for testing model accuracy.

Chapter Checkup A Select the correct option. 1

is a process of gathering information existing in websites/web pages.

a Surveys

b Web scraping

c Interviews

d Observation

2 Which of the following best describes a sensor? a A device that stores data in a digital format for future use b A device that captures live information and converts it into digital data for analysis c A software application that processes data from various sources d A method for manually entering data into a computer system 3

The process of collecting accurate and reliable data from various sources is called a Data Acquisition

176

b Evaluation

c Problem Scoping

.

d Data Exploration


B Fill in the blanks with the most suitable words. 1 In AI model, the 2

are tools that enable different software applications to communicate and exchange data seamlessly.

3 A

helps us to understand how different types of data features are related to each other in the AI project.

4 C

dataset is used to teach the model.

refer to the type of data you want to collect.

State whether the following statements are True or False. Correct the statements that are false. 1 Data features are used to train an AI model. 2 System maps are used to see the positive and negative influences of different factors on an AI project. 3 Completeness is not a necessary characteristic of high-quality data. 4 Surveys provide AI with valuable insights into consumer preferences and satisfaction.

D Answer the following: Q1. Define data acquisition. A1. The process of collecting accurate and reliable data from various sources is called data acquisition. Q2. What are the characteristics of data? A2. The various characteristics of data are: • • • • • •

Relevance: The data must be pertinent to the project and useful for the AI system. Accuracy: The information should be correct in all aspects. Completeness: There should be no missing or incomplete information. Timeliness: The data should be up-to-date. Reliability: The data should come from trusted and reliable sources. Validity: The data should accurately represent what it is supposed to measure.

Q3. Suppose you are part of a school project team working on a “weather forecasting station”. What types of data will your weather station need to collect? A3. The weather station will collect data on temperature, humidity, wind speed and direction, rainfall, etc., to predict the weather.

AI Activities 1 Visit the link: https://experiments.withgoogle.com/we-need-us to explore the project ‘we-need-us’. In this project, APIs are used to for data acquisition purposes. 2 Visit the link: https://ncase.me/loopy/ and ask them to use this tool to create system map for the project to predict the price of houses.

Answer Key A

1. b

B

1. Training

C

1. True.

2. b

3. a

2. APIs (Application Programming Interfaces)

3. System map

4. Data features

2. T rue.

3. False. Completeness is a necessary characteristic of high-quality data. 4. True.

Chapter 6 • Simplifying Data Acquisition

177


Unit 2 • AI Project Cycle

7 Visualising Data I

n our session on “Introduction to the AI Project Cycle,” we learnt that once the data acquisition is complete in an AI project, the next step is data exploration. Data exploration is an important step in the AI project cycle. It helps us understand the data we collected to build an AI project.

Data Exploration

Data exploration is the process of examining data to understand its characteristics before starting its analysis. It involves looking at the data in detail to understand what insights it can provide. Data exploration is important as it helps to do the following: 1. Find out the redundant and missing values in the data. 2. Understand patterns, trends, and relationships in the data. 3. Get insights to make better decisions in the later stages of the AI project cycle. Identifying redundant and missing values in the data is typically considered part of the initial data exploration phase. This prepares the data for subsequent cleaning and preprocessing steps. Data cleaning specifically involves rectifying these issues to ensure dataset accuracy. Data exploration uses various techniques such as data visualisation, summary statistics (mean, median, mode, standard deviation, etc.), and correlation analysis to understand and prepare the data for modelling, the next step in the AI project cycle. These insights help us choose an appropriate model for the AI project.

What is Data Visualisation?

Data visualisation is the graphical representation of information and data. You can use various data visualisation techniques like charts, graphs, and maps to see and understand trends, patterns, and relationships in the data. Data visualisation enables the identification of trends, outliers, and patterns within data. Importance of Data Visualisation •

Simplifies Complex data: Data visualisation transforms complex data into simple visuals, making it easier to interpret large dataset quickly. It also helps extract insights from the data that may not be apparent from raw numbers.

•

Identifies trends and patterns: Data visualisation allows us to spot trends, patterns, and relationships that might not be evident in raw data.

178


•

Facilitates Decision-making: It helps decision-makers make informed decisions based on clear and understandable visual data. It aids in proactive decision-making by highlighting potential risks and opportunities.

•

Aids in effective communication: Data visualisation techniques are more engaging and effective for communicating data insights to a wider audience.

Data Visualisation Techniques

Data visualisation techniques are methods used to represent data graphically to show trends, patterns, and relationships. Some common data visualisation techniques are explained below:

Bar Charts ar charts use rectangular bars to represent data values. The length of the bar in a bar chart is proportional B to the value it represents. Bar charts can be horizontal or vertical. Vertical bar charts are also known as column charts. Use Cases: Compare quantities across different categories. How to draw: •

List categories along one axis (the x-axis for a vertical chart, and the y-axis for a horizontal chart)

•

Draw a bar for each category. The height of the bar represents the value.

Example: Books Read by Students in Different Grades

Number of Books Read

40 30 20 10 0

Grade 1

Grade 2 Grade

Grade 3

Line Graphs Line graphs use points connected with lines to show changes in data over time. Use cases: Displaying trends over time, Comparing multiple data sets. How to draw: •

Draw a horizontal line representing time or a continuous value.

•

Plot points representing data values and connect the points with lines.

Chapter 7 • Visualising Data

179


Example: Plant Growth Over Five Weeks 25.5 22.5 Height (cm)

20.0 17.5 15.0 12.5 10.0 7.5 5.0 1.0

1.5

2.0

2.5

3.0

Week

3.5

4.0

4.5

5.0

Pie Charts Pie charts display data as parts of a circle where each part represents a proportion of the whole Use case: Show percentages and proportions of a whole, compare parts of a single dataset. How to draw: •

Draw a circle divided into different slices where each slice represents a category.

•

The angle of each slice is proportional to the category’s value.

Example: Favourite Fruits in Class Apple 40.0% Banana

Did You Know? William Playfair, a Scottish engineer and political

30.0%

economist, first introduced the bar chart and line chart in his book “The Commercial and Political

10.0% 20.0%

Date

Atlas”, published in 1786. He also invented the pie chart in 1801.

Cherry

Histogram Histograms use adjacent bars to show the frequency distribution of numerical data. Each bar depicts an interval of values. Use cases: Displaying the distribution of a dataset How to draw: •

Draw a horizontal axis for the value intervals called bins.

•

Draw vertical bars for each bin, showing the frequency of data values within the bin.

180


Example: Distribution of Test Scores 40

Number of Students

35 30 25 20 15 10 5 0

50

60

70 80 Score Range

90

100

Scatter Plots

Scatter plots are used to show the relationship between two variables. It uses points to show the value of two variables. Each point’s position represents the value of the two variables on the x and y axes. Use cases: Display the relationship between two numerical variables. How to draw: •

Draw a horizontal axis for one variable and a vertical axis for another variable.

•

Plot points represent the values of two variables on the x-axis and y-axis.

Example: Study hours vs Test Scores 90

Error Alert!

85

Test Scores

80

Selecting the wrong type of graph for the data

75

can misrepresent the information. For example,

70

using a pie chart to show trends over time

65 60

instead of a line graph can make it difficult to see

55

the trend.

50 1.0

1.5

2.0

2.5 3.0 3.5 Study Hours

4.0

4.5

5.0

Data Visualisation tools

There are many tools that help us create charts and graphs. Some popular tools are mentioned below: Microsoft Excel: A spreadsheet is a software application used for accounting and data entry, organising information in rows and columns. Microsoft Excel, a widely-used spreadsheet tool, enables users to generate various types of charts and graphs, including bar charts, line charts, pie charts, and scatter plots, to effectively visualise and analyse data.

Chapter 7 • Visualising Data

181


Google Sheets: Google Sheets is a web-based spreadsheet application for storing and analysing data. It runs in a browser and is integrated with Google Drive. This free tool supports real-time collaboration, allowing multiple users to work together simultaneously. Google Sheets also offers a variety of chart types, such as line charts, bar charts, pie charts, and scatter plots, making it easy to visualise your data. Tableau: Tableau is a software application that facilitates data comprehension by transforming data into interactive visualisations. With Tableau, you can easily drag and drop your data to create various graphs, charts, and maps without the need for coding. Additionally, it allows you to build dashboards that combine multiple visualisations, making it simpler to identify trends and patterns in your data.

Power BI: Power BI is a Microsoft application that is used to visualise data by creating dashboards and reports. It handles real-time data, updating visuals automatically as changes occur. Users can generate interactive charts and graphs, share their reports, and use natural language queries to gain insights from their data. Looker Studio: Looker Studio, previously known as Google Data Studio, is an online tool that converts data into informative reports and dashboards. It is free to use and easily integrates with other Google products, like Google Sheets. You can create a variety of charts, such as bar charts, line charts, area charts, pie charts, etc., using this tool. It also allows automatic updating of reports as the data changes. It allows you to easily share your findings with others online.

Remember Choosing the right type of visualisation ensures that the data will be well understood and communicated clearly to your audience.

Think and Tell

Have you explored Google Sheets in your Google Drive? Share your Google Sheet with your friend and ask him to make changes. Check and tell whether you are able to see the changes in real time.

Activity Time Activity 1: Collecting and Visualising Data

(Individual Work)

Have students create a Google Sheet to collect votes for their favourite sport. Encourage them to choose an appropriate chart to visualise the data effectively.

Activity 2: Analysing Country Data with Visualisations

(Group Work)

Divide students into groups and provide each group with datasets containing real-world country information, such as

population data. Instruct them to use tools like Excel or Google Sheets to create various visualisations based on the data.

182


Chapter Checkup A Select the correct option. 1 What is the primary goal of data exploration?

a Collecting data b Evaluating a model c Finding patterns and relationships

2 What does a scatter plot visualise?

a Distribution of categorical data c Relationship between two numerical variables

d Finding outliers

b Trends over time

d Proportions within a whole

3 Which chart type is best suited for showing trends over time?

a Bar chart b Line chart c Scatter plot d Pie chart

4 What is the primary purpose of Microsoft Power BI?

a To create written documents

b To visualise data through dashboards and reports

c To design websites d To create presentations

5 Which among the following is a data visualisation tool?

a Tableau b Power BI

c Microsoft Excel d All of these

B Fill in the blanks with the most suitable words. 1 ...................... helps to find redundant and missing values in the data. 2 Bar chart is used to compare ...................... between different categories. 3 ...................... charts display data as parts of a circle where each part represents a proportion of the whole. 4 Google Sheets is a ...................... application that allows you to store and analyse data. C

State whether the following statements are True or False. Correct the statements that are false. 1 Cleaning and preprocessing are not necessary in data exploration. 2 Data visualisation is the graphical representation of information and data. 3 Google Sheets does not support real-time collaboration. 4 Tableau requires extensive programming knowledge to use effectively.

D Answer the following questions. Q1. Identify the chart. What is the chart used for? A B C

A1. It is a scatter plot chart. This chart is used to display the relationship between two numerical variables.

Chapter 7 • Visualising Data

183


Q2. What is data exploration and why is it important? A2. Data exploration is the process of examining data to understand its characteristics before starting its analysis. It involves looking at the data in detail to understand what insights it can provide. Data exploration is important as it helps to do the following: i. Find out redundant and missing values in the data. ii. Understand patterns, trends and relationship in the data. iii. Get insights to make better decisions in the later stages of the AI project cycle.

Q3. What is Tableau? A3. Tableau is a software application that facilitates data comprehension by transforming it into interactive visualisations. With Tableau, you can easily drag and drop your data to create various graphs, charts, and maps without the need for coding. Additionally, it allows you to build dashboards that combine multiple visualisations, making it simpler to identify trends and patterns in your data. Q4. Neha is a parent who wants to analyse her daughter’s performance in different subjects over the past six years. She wants to represent her findings in a clear and informative way. Which data visualisation technique would be most suitable for use in this scenario and why? A4. A line chart would be the most appropriate technique to use in this scenario. Neha can plot the years along the x-axis and her daughter’s performance scores across the y-axis, with each subject represented by a different line. This approach will allow Neha to visually track how her daughter’s performance in various subjects has evolved over time. It helps in identifying trends, patterns, and comparisons between subjects, providing a clear and informative overview of her daughter’s academic progress across six years.

AI Activities 1 Visit the link: https://www.chartgo.com/en/chartpie.jsp to create various graphs and charts online. 2 Visit the link: https://www.data.gov.in/ to download publicly available datasets and use the datasets for creating visualisations.

Answer Key A

1. c

B

1. Data exploration

C

1. False. Cleaning and preprocessing are necessary for data exploration.

2. c

3. b

4. b

5. d

2. quantities/values

3. Pie

4. spreadsheet

2. T rue

3. False. Google Sheets support real-time collaboration.

4. False. Tableau does not require any programming knowledge.

184


Unit 2 • AI Project Cycle

8 Introduction to Modelling M

odelling is the fourth stage in an AI project cycle. This is the phase that comes after the phase of data exploration. After understanding the data and discovering trends, patterns, and relationships in the data, a model is created using the data so that it can be used for making predictions and decisions. In this session, you will learn about modelling in detail.

Modelling

AI modelling refers to the process of creating algorithms, known as models, that can learn from data and make predictions or decisions based on new data. The output of the modelling is a model that can make accurate predictions, classify information, or identify patterns in new datasets once the AI models are trained using historical data. Modelling involves the following: •

Selecting Algorithms: Choosing an appropriate algorithm(s) based on the nature of the problem (e.g., classification, regression or clustering).

•

Training the model: Training the model using pre-existing data to identify patterns and correlations between input and desired output.

•

Testing the model: Testing the model’s performance on a new dataset to assess how well the model predicts outcomes.

Types of AI Models

There are two main methods for building AI models: the rule-based approach and the learning approach. AI Systems

Rule Based

Learning Based

185


Rule-Based Approach

Rule-based AI, also known as expert systems, operates on a set of pre-defined rules created by developers. The machine is programmed with these rules and performs tasks according to the defined guidelines. For example, consider a dataset that specifies conditions for deciding whether a match will be played. The parameters or data features can include weather, team availability, pitch conditions, and location. You would consider various possibilities of these parameters to decide if the match will be played. For instance, if the weather is sunny, both teams are available, the pitch is fine, and the location is London, the match will be played. Conversely, if the weather is rainy or one team is unavailable or the pitch is waterlogged, or the location is unknown, the match will not be played. After considering all these parameters, you input this data into the machine along with the rules. The machine trains using this dataset. During testing, you input new data, and based on the rules, the machine determines whether the match can be played. This is known as a rule-based approach because we have fed the data along with rules to the machine and after training on them, the machine can now predict outcomes based on the same rules. Weather

Team Availability

Pitch Condition

Location

Play Match

Sunny

Both Teams Are Available

Fine

London

Yes

Rainy

Both Teams Are Available

Waterlogged

London

No

Sunny

One Team Is Unavailable

Fine

London

No

Cloudy

Both Teams Are Available

Fine

London

Yes

Sunny

Both Teams Are Available

Fine

Unknown

No

Rainy

One Team Is Unavailable

Fine

London

No

Sunny

Both Teams Are Available

Poor

London

No

Cloudy

Both Teams Are Available

Fine

Paris

Yes

Sunny

Both Teams Are Available

Waterlogged

London

No

Cloudy

One Team Is Unavailable

Fine

London

No

However, in a rule-based approach, the model may struggle with data that does not fit within the established rules. For example, consider a scenario where the dataset specifies conditions for deciding whether a match will be played, but an unforeseen condition arises, such as extreme fog. Since extreme fog was not included in the training dataset, the model may not be able to accurately decide whether the match should be played because it lacks specific rules for handling this new condition. Thus, the performance of rule-based AI models depends heavily on the accuracy and completeness of the rules defined by developers. Another example of a rule-based AI system is an automated diagnostic system in healthcare. The system uses a set of medical rules and logical reasoning to analyse patient symptoms and medical history to suggest potential treatments.

Learning-Based Approach

Learning-based AI empowers systems to learn patterns and make decisions from data without defining rules. As no pre-defined rules are framed, these approaches use algorithms that learn from data iteratively to improve their performance on a task. Learning-based approaches rely on the large datasets to learn patterns and relationships in the data. Once the model has learnt from the data during training, it can be tested to predict the output using new and unseen data. The major feature of learning-based approach is that the model updates itself with changes in the data, allowing it to improve its performance over time and adapt to new and unseen patterns. For example, you have a dataset of 100 images of cats and dogs. The images showing cats are labelled as “cat” and the images showing dogs are labelled as “dog”. An AI model is trained with this dataset, and the model is

186


programmed so that it can distinguish between images of a cat and a dog based on the various features of cats and dogs. Once the model is trained with the dataset, a testing dataset is fed to the model. The testing dataset may contain images of cats and dogs that are not exactly similar to the images with which the model is trained. But a learning-based AI model adapts itself to the features of a new image and predicts if the image is of a cat or a dog. learning based AI model Cat

Dog

Cat

Dog

Dog

Dog

Cat

Cat

Dog

Dog

Cat

Dog

Cat

Dog

Dog

Dog

Cat

Cat

Dog

Dog

Labelled Data Set

Machine trained using labelled dataset

Machine identifies the image as a dog

Testing using testing data

Testing Data

Other real-life examples of learning-based AI systems include recommendation systems and autonomous vehicles. The recommendation system used by streaming platforms like Netflix uses learning-based AI algorithms to analyse user preferences and recommend new films that the user might like. The AI algorithms in autonomous vehicles learn from vast amounts of data collected from sensors, cameras, and GPS systems to analyse the environment and make driving decisions.

Remember Rule-based AI systems are based on predefined rules and logic created by experts, and they make decisions based on instructions and conditions finalised in advance. However, learning-based AI learns from data to identify patterns and make decisions, gradually enhancing its performance through feedback and experience.

Chapter 8 • Introduction to Modelling

Think and Tell

Does the music recommendation system use a learning-based approach to continuously adapt and personalise recommendations based on user preferences?

187


Types of Learning-Based Approaches The learning-based approach can further be divided into three parts: Learning Based Approaches

Supervised Learning

Unsupervised Learning

Reinforcement Learning

Let us learn about these three learning-based approaches one by one. Supervised Learning Supervised learning is a machine learning method that uses well-labelled datasets to train models to predict outcomes and recognise patterns. In supervised machine learning, the developers are very familiar with the data. In other words, the dataset is known to the developer, which allows them to label the data accurately. They provide this labelled data to the machine learning model, which then learns from it. Once the model understands the relationship between the input and output data, it becomes capable of classifying new and unseen datasets as well as predicting outcomes. Types of Supervised Learning There are broadly two types of supervised learning models: Classification and Regression. •

Classification: The identification of apples and bananas as different fruits is a great example of supervised learning.

Since we knew the data really well, i.e., apples are spherical and red, while bananas are curved and yellow, we fed this data to the machine by providing a large number of images of both apples and bananas. This is then reasoned into the statements, “Given an image of an apple, we know it as an apple”, and “Given an image of a banana, we know it as a banana”. Thus, the machine learns this information and applies it to new images, thereby starting to make predictions. This model works on discrete datasets.

•

Regression: Regression is a type of supervised learning where the goal is to predict a continuous numerical value based on input data instead of predicting a label representing a category. While classification assigns data to various predefined categories, regression aims to predict a number.

188


Suppose you want to predict the price of a house in your town. The price of a house depends on various features like its size, number of bedrooms, and location. To create a house price prediction AI model, you must have a dataset containing features of each house and its actual price. You will train a regression model with this data. During training, the model learns the relationship between the features and the house prices. Once trained, the model can predict the price of new houses based on their features.

Remember

Discrete values are countable and separate, like the number of students in a class. There can be 20 students or 25 students, but not 22.5. Continuous values are measurable and can take any value within a range, like the height of students. It can be 5 feet, 5.7 feet, or 6.2 feet.

Activity Teachable Machine Objective: To use a web-based tool that helps to create machine learning models based on supervised learning in an easy and fast manner. You do not need to be a coding expert to use the application. This application helps train a computer to recognise images, sounds, and poses. Follow the given steps to learn how this application works:

Think and Tell

Can you give examples of real-world applications where supervised learning is particularly effective?

1. Visit the following link: https://teachablemachine.withgoogle.com/ 2. The following window will appear.

3. Click on the Get Started button. You will be directed to a web page, as shown.

Chapter 8 • Introduction to Modelling

189


4. From the window that appears, you can use any of the following options to teach your machines: •

Image Project: To teach a model to classify images using files on your system or your webcam.

•

Audio Project: To teach a model to classify audio by recording short sound samples.

•

Pose Project: To teach a model to classify body positions or poses using image files on your system or striking poses on your webcam.

5. Let us create a pose project. For this, click on the Pose Project option. 6. Collect images of random people’s sitting and standing poses, as shown. Here is the training data, in the form of images, of standing and sitting poses, for your reference.

Training Data for Sitting Poses

Training Data for Standing Poses

7. Click on the Upload button to upload the images related to these poses.

190


8. The results of any machine learning model depend on the examples or the sample data you give it. So, if it’s not working as you had intended, then add more samples to the training data that was provided to your machine. 9. After uploading the training data, click on the Train Model button.

10. Now, test your machine learning model by posing in front of the webcam and see what Output (standing or sitting pose) it displays in the Preview window.

Unsupervised Learning An unsupervised learning model operates on a dataset that lacks labels. This means the data provided to the machine is unstructured, and the person training the model might not have prior knowledge about it. These models are designed to discover relationships, patterns, and trends within the data. This process helps users gain insights into the data and identify key features that the machine detects. For instance, imagine you have a dataset of 1,000 random cat images and want to uncover patterns within it. You would input this data into an unsupervised learning model, which would then analyse and identify patterns after training. The model might detect familiar patterns, such as colour, or reveal something unexpected, like variations in the size of the cats. Types of unsupervised learning Unsupervised learning models can be further divided into two categories: Clustering and Dimensionality Reduction.

Chapter 8 • Introduction to Modelling

191


•

Clustering: Imagine a scenario where a developer feeds an unsupervised learning model a dataset consisting of various images of fruits, such as apples, bananas, and grapes. This dataset is unlabelled, meaning the model has no prior information about which images correspond to which fruit. The model’s task is to automatically identify patterns and similarities within the data.

For instance, during the training process, the model might detect that the images of apples tend to share certain features, like a red colour and a spherical shape. Similarly, it might recognise that bananas generally have a yellow colour and a curved shape, while grapes are typically small, round, and green. Based on these observations, the model organises the images into distinct clusters or groups. Once trained, the model can be tested with new, unlabelled images of apples, bananas, or grapes. It will then assign each new image to one of the pre-established groups based on the patterns it learnt during training. This process exemplifies how unsupervised learning models can automatically categorise data by identifying inherent patterns without explicit guidance from the developer.

Input Data

•

Model Output Data

Dimensionality Reduction: Dimensionality reduction is a technique used to reduce the number of features or dimensions of an item or dataset while preserving the most relevant information. Features in a dataset are various parameters that record information about a datapoint or item. For example, in a dataset related to house price prediction, dataset might contain numerous features such as size, number of rooms, locality, age of the house, distance to the nearest school, distance to public transport, and more. Not all of these features may be equally important for predicting house prices. Dimensionality reduction can help identify the most significant features and minimise the less important ones. For instance, after applying dimensionality reduction, you might find that size, number of rooms, and locality are the most critical features for predicting house prices. By focusing on these key features, you simplify the model, making it more efficient and faster to analyse the data, while still retaining the essential information needed for accurate predictions.

As we reduce the dimensions of an entity, the information it contains becomes increasingly distorted. Consider a three-dimensional object such as a cube. If you take a photograph of the cube, the data is reduced to two dimensions since the image is a flat, 2-dimensional representation. When you reduce one dimension, a significant amount of information is lost. For instance, you can no longer see the hidden sides of the cube, so you might not know if the cube’s back face has the same colour or texture, or if it’s even a complete cube rather than just a solid front face. If we continue to reduce the dimensions further, such as by representing the cube as a simple square, even more information is lost, and the original characteristics of the cube become increasingly obscure. Hence, to reduce the dimensions and still be able to make sense of the data, we use dimensionality reduction.

Dimensionality Reduction

192


Reinforcement Learning** Reinforcement learning is a type of machine learning where an AI model learns to take actions in an environment to maximise a cumulative reward. The model learns through trial and error, receiving rewards for good actions and penalties for bad ones. In our fruit recognition problem, the model learns to recognise fruits by identifying images. When the model correctly identifies a fruit, it receives a reward. However, if it guesses incorrectly, there is a penalty. With each attempt and its corresponding feedback, the model becomes ‘smarter’. It starts recognising the key features that distinguish different fruits. For example, it learns that apples are red and spherical, while bananas are curved and yellow. This process helps it understand which actions, like identifying specific features, are effective and which can be ignored.

Activity Infinite Drum Machine Objective: To see the working of an infinite drum machine which is an AI model based on unsupervised learning. This experiment uses machine learning to translate thousands of day-to-day sounds to create personalised music. Follow the given steps to learn how it works: 1. Visit the link: https://experiments.withgoogle.com/ai/drum-machine/view/. The following window opens.

2. Click on the START PLAYING button. You will be directed to a web page, as shown.

3. Click on the play button to enjoy the music created by the sounds of different objects like “CARD PLAYING”, “WINDOW CRANK”, “TOY BOARD GAME”, etc., marked in circles as shown. ** Note: This topic is optional as per the CBSE syllabus and may not be covered in assessments.

Chapter 8 • Introduction to Modelling

193


You can also click the shuffle button to change the sounds for creating music. Now, you can experiment with new sounds such as “TAPE RECORDER CASSETTE”, “HUMAN LAUGH”, etc. to create music.

Neural Networks

A neural network can be thought of as a smart system that can learn to perform a task by looking at examples. It mimics how the human brain works, using neurons connected to form a network.

Components of a neural network

1. Neurons: Neurons are small decision-making nodes. Each neuron takes some information, processes it, and passes it on. 2. Layers: There are three types of layers in a neural network: •

Input Layer: This is the layer where the neural network receives information. For example, if you are teaching a neural network to recognise images of birds, the input layer receives the value of the pixels of the images here.

•

Hidden Layers: These are intermediate layers between the input and output layers. These layers perform a lot of calculations to identify patterns and details. In a neural network, there can be many hidden layers.

•

Output Layer: This layer produces the output of the neural network. For example, it may say “Yes, this is a bird” or “No, this is not a bird”.

3. Weights and Biases: Weights can be designated as important levels. Each layer consists of many numbers of nodes called neurons connected with the nodes of other layers. Each connection between these neurons is assigned a weight that shows the importance of the connection. Biases are additional values that help to adjust the output to minimise the error in predictions during network training. 4. Activation Function: After processing the inputs, the neuron sends the result through an activation function which assists the network in learning complex patterns. It is similar to deciding whether a neuron will activate or not based on the information received by the neuron.

How does a neural network learn?

A neural network learns through a process called training. During training, a neural network is fed with a large amount of labelled data. For example, many images labelled as “bird” or “not bird” are given as input to the neural network during training. The training involves the following steps: Forward Propagation: The network processes the input data received at the input layer and passes through the network by hidden layers to the output layer to make a prediction.

194


Loss function: The network compares its output/prediction with the actual answer to see how wrong it is. The difference is measured using a loss function. Backward Propagation: The network adjusts its weights and biases based on how wrong it was (given by the difference measured by a loss function). This helps the network improve its predictions over time. The process of forward propagation, calculating the loss, and backward propagation occur many times, with a lot of examples. Each time, the neural network becomes better at making correct predictions.

Applications of Neural Networks

Neural networks are powerful because they can learn to perform complex tasks that are difficult for traditional computer programs. They can be used in many areas, such as identifying objects in photos (image recognition), understanding spoken words (speech recognition), understanding and generating human languages (natural language processing), and playing games.

Key Features of a Neural Network

Following are the key features of a neural network: 1. Scalability: A neural network can handle large and complex datasets. 2. Adaptability: A neural network learns and improves from data over time. 3. Fault Tolerance: The performance of a neural network is robust even with incomplete data. 4. High-dimensionality: It can handle large numbers of input features effectively. 5. Generalisation: It can make predictions on new and unseen data effectively. 6. Pattern recognition: Neural networks excel at identifying patterns and relationships in data. 7. Layered structure: A neural network organises computations in multiple layers.

Activity Time Activity 1: Supervised Learning Activity: “Guess the fruit”

(Group Work)

Divide the students into groups. Ask each group to collect photos of different fruits and list features of each fruit, like

colour, shape, and origin, on different cards. Show other groups a card containing the features of the fruit but not the

picture of the fruit. Students will guess the name of the fruit based on its features. This will help the students to explore how supervised learning makes use of features for classification.

Activity 2: Dimensionality Reduction: Simplifying Survey Data

(Group Work)

Ask the students to make groups. Each group will develop a survey with questions on any topic of their choice. Ask each

group to identify the most important questions in their survey. Explain how dimensionality reduction can help you focus on the most important features.

Activity 3: Reinforcement learning activity: “Maze Solver”

(Individual Work)

Instruct the students to create a maze on a piece of paper. Students will act as “agents” to find the shortest path to the exit. Each move is rewarded, like +1 for moving closer to the exit or penalised, like -1 for hitting a dead end. Students will learn how reinforcement learning based algorithms make decisions based on penalties and rewards.

Chapter 8 • Introduction to Modelling

195


Chapter Checkup A Select the correct option. 1 What type of data is used in supervised learning? a Only labelled data

c Both labelled and unlabelled data

b Only unlabelled data d No data is used

2 What is the key feature of a neural network? a These are rule-based systems b These do not need data for training c These consist of layers of interconnected neurons d These can perform only classification tasks 3

Which of the following is an example of a regression problem? a Predicting whether an email is spam or not b Grouping customers based on purchasing behaviour c Predicting the price of a house based on its features d Identifying objects in an image

4

What is the role of hidden layers in a neural network? a They serve as the input layer to collect data. b They perform calculations to identify patterns and details. c They act as the output layer to give final results. d They store data without any processing.

B Fill in the blanks with the most suitable words. 1 An

learning model operates on a dataset that lacks labels.

2 Rule-based AI systems make decisions using predefined 3 Classification and 4 C

.

are two main types of supervised learning.

helps to simplify complex data by reducing the number of features while preserving important information.

State whether the following statements are True or False. Correct the statements that are false. 1 Clustering is a type of unsupervised learning. 2 The regression model predicts only the discrete numerical values. 3 Learning-based AI models do not require any data for training. 4 In reinforcement learning, the AI model learns by maximising cumulative rewards through actions.

D Answer the following questions. Q1. What is the key difference between rule-based and learning-based AI? A1. Rule-based AI uses predefined rules to make decisions, whereas learning-based AI learns patterns and makes decisions from data without defining rules.

196


Q2. Differentiate between supervised learning and unsupervised learning. A2.

Supervised Learning

Unsupervised Learning

Learning from labelled data to make predictions or classifications

Learning from unlabelled data to find hidden patterns or groups

The major types are classification and regression.

The major types are clustering and dimensionality reduction.

The model is trained on input-output pairs.

The model is trained on input data alone.

Q3. What are the key features of a neural network? A3. Following are the key features of a neural network: i. Scalability: A neural network can handle large and complex datasets. ii. Adaptability: A neural network learns and improves from data over time. iii. Fault Tolerance: The performance of a neural network is robust even with incomplete data. iv. High-dimensionality: It can handle large numbers of input features effectively. v. Generalisation: It can make predictions on new and unseen data effectively. vi. Pattern recognition: Neural networks excel at identifying patterns and relationships in data. vii. Layered structure: A neural network organises computations in multiple layers. Q4. Aarav is developing a music recommendation system for an online streaming platform. Should he use a rule-based approach or a learning-based approach? Explain briefly. A4. Aarav should use a learning-based approach for his music recommendation system. Unlike rule-based methods that rely on predefined criteria, learning-based approaches use machine learning models trained on data such as user listening history, song characteristics, and user preferences. These models can adapt and improve over time, providing more accurate recommendations based on complex data patterns and user behaviour.

AI Activities 1 Visit the link: https://playground.tensorflow.org/ to learn and experiment with neural networks. 2 Visit the link: https://www.scaler.com/topics/artificial-intelligence-tutorial/rule-based-system-in-ai/ to learn more about rule-based AI. 3 Visit the link: https://developers.google.com/machine-learning/intro-to-ml to get an introduction to learning-based AI.

Answer Key A B C

1. a

2. c

1. Unsupervised 1. True.

3. c

2. Rules

3. c

4. b

3. Regression

4. Dimensionality reduction

2. F alse. Regression model predicts the continuous numerical values. 3. False. Learning-based AI models require data for training. 4. True.

Chapter 8 • Introduction to Modelling

197


Unit Reflection

Key Terms • AI project cycle: When a project is developed based on AI, it goes through several stages, which are together known as the AI project cycle. • Problem Scoping: This is the initial stage that helps us understand the problems that need to be addressed. It defines the goals to be achieved with the help of an AI system. • Data acquisition: Data acquisition means gathering or collecting data to solve the problem defined. • Data exploration: Data exploration is the process of examining data to understand its characteristics before starting its analysis. It involves looking at the data in detail to understand what insights it can provide. • Modelling: It is the process of creating various AI models based on visualised data from the data exploration step, enabling predictions and conclusions. • Evaluation: In the evaluation step, the developed AI model is tested for its accuracy and performance using testing data. • Data features: Data features refer to the type of data that you want to collect. They are the building blocks that are used to train an AI model. • APIs: Application Programming Interfaces, or APIs, are tools that enable different software applications to communicate and exchange data seamlessly. • Web scraping: Web scraping, or web harvesting, is a process of gathering information existing in websites or web pages. • Sensors: Sensors are devices that collect real-time information and transform it into digital data that can be analysed by computers. • Neural network: A neural network can be thought of as a smart system that can learn to perform a task by looking at examples. It mimics how the human brain works, using neurons connected to form a network.

Things to Remember • The five stages of the AI project cycle are problem scoping, data acquisition, data exploration, modelling, and evaluation. • Sustainable Development Goals, which are often referred to as ‘Global Goals’, are a set of 17 goals adopted by the United Nations General Assembly in September 2015 to meet the needs of the world’s citizens without compromising the planet’s resources. • The 4Ws Canvas is a strategic tool that focuses on four fundamental questions: Who, What, Where, and Why. • The outcome of problem scoping is the problem statement template. A problem statement template used in the problem scoping stage of an AI project cycle helps to clearly define the issue to be addressed. • The previous performance records are known as training data, while the next performance prediction data set is known as testing data.

198


• For any AI project to be efficient, the training data should be authentic and relevant to the problem statement scoped. • Data should have the following attributes or characteristics: accuracy, relevance, reliability, timeliness, validity, and completeness. • Surveys are used to collect data from a target audience to understand their preferences, opinions, choices, and feedback. • A system map helps us understand how different types of data features are related to each other in an AI project. • Data visualisation is the graphical representation of information and data. • Power BI is a Microsoft application that is used to visualise data by creating dashboards and reports. • Tableau is a software application that facilitates data comprehension by transforming it into interactive visualisations. • Looker Studio, previously known as Google Data Studio, is an online tool that converts data into informative reports and dashboards. • There are two main methods for building AI models: the rule-based approach and the learning approach. • Rule-based AI, also known as expert systems, operates on a set of pre-defined rules created by developers. The machine is programmed with these rules and performs tasks according to the defined guidelines. • Learning-based AI empowers systems to learn patterns and make decisions from data without defining rules. • The learning-based approach can further be divided into three parts: supervised learning, unsupervised learning, and reinforcement learning. • Supervised learning is a machine learning method that uses well-labelled datasets to train models to predict outcomes and recognise patterns. • There are broadly two types of supervised learning models: classification and regression. • An unsupervised learning model operates on a dataset that lacks labels. • Unsupervised learning models can be further divided into two categories: clustering and dimensionality reduction. • Reinforcement learning is a type of machine learning where an AI model learns to take actions in an environment to maximise a cumulative reward.

Unit Reflection

199


Test Your Knowledge A. Select the correct option. 1. How does an AI model learn in a reinforcement learning environment? a. By receiving feedback in the form of rewards for good actions and penalties for bad actions. b. By being programmed with a fixed set of rules and instructions. c. By analysing large amounts of data without any feedback mechanism. d. By imitating the actions of human experts without any trial and error. 2. What is the potential drawback of using dimensionality reduction on a dataset? a. It increases the complexity of the dataset. b. It may result in the loss of important information. c. It always improves the accuracy of predictions. d. It makes the dataset harder to analyse. 3. Which among the following is a data visualisation tool? a. Google Sheets

b. Tableau

c. Power BI

d. All of these

4. The following figure depicts a

. Distribution of Test Scores

Number of Students

40 35 30 25 20 15 10 5

0

50

60

70 80 Score Range

90

a. Scatter plot

b. Histogram

c. Line chart

d. Pie chart

5. When a travel app needs to display available flights, how might it efficiently obtain the necessary data? a. By manually searching for flights on airline websites. b. By asking users to input flight details manually. c. By using an API from an airline or travel service to fetch the latest flight information. d. By generating random flight options for users to choose from.

200


B. Fill in the blanks with the most suitable words. 1. The United Nations has established

to address various social, economic, and environmental challenges

globally.

2. Once the AI model is developed, it must be tested for its accuracy and performance using 3. For an AI model to be efficient, authentic, and accurate, it requires a large amount of 4. The

solving a problem.

data. for training.

represents the step-by-step process that one should follow to develop and deploy an AI project while

5. Neurons are small decision-making nodes that process and transmit information in a

.

C. State True or False. Correct the statements that are False. 1. In supervised machine learning, the developers are not familiar with the data. 2. Raw data already identifies trends and patterns, so there is no need for data visualisation. 3. Surveys are used to collect data from a target audience to understand their preferences, opinions, choices, and feedback. 4. There are 17 Sustainable Development Goals aimed at addressing global challenges. 5. The AI project cycle includes specific stages for developing and deploying AI solutions.

D. Short-answer type questions. 1. What is modelling? 2. Define SDGs. 3. What are sensors? 4. Look at the following graph and answer the following questions. i. Identify the type of graph.

Test Scores

ii. From the graph, 5 hours of study equals to what test score?

Study hours vs Test Scores

90 85 80 75 70 65 60 55 50

1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 Study Hours

E. Long-answer type questions. 1. Why is data visualisation important? 2. What are the components of a neural network? 3. Explain the learning-based approach of AI modelling.

F. Competency-based questions. 1. Vaibhav is tasked with presenting the distribution of different product sales in his store as percentages. What type of chart would be most suitable for Vaibhav to visually represent the proportions of sales for each product?

2. Nidhi is conducting a product feedback survey to understand customer experiences with a new product. In what ways can the data collected from this survey help an AI system?

Unit Reflection

201


Unit 3 • Advance Python (To be assessed through Practicals)

9 Jupyter Notebook I

n businesses and organisations everywhere, Jupyter Notebooks have become a must-have tool for data science. They help data scientists analyse data, explore new ideas, and share their results easily. Jupyter Notebooks are powerful because they enable users to perform multiple tasks within a single environment. Let us learn more about why Jupyter Notebooks are so important and how they are used in data science today.

Introduction to Anaconda The simplest method to install and use Jupyter Notebook is by using Anaconda. Anaconda is a free and opensource environment for writing and executing Python programs. It offers a significant benefit because it includes numerous pre-installed packages often used in machine learning and data science. This saves a significant amount of effort and time because each package does not need to be installed separately. With Anaconda, you can easily manage conda packages, environments, and channels using the desktop graphical user interface (GUI) called Anaconda Navigator. This eliminates the need for command line instructions when launching applications.

Installing Anaconda The Anaconda distribution is open source and available for Windows, Linux, and Mac OS. These are the instructions for downloading and installing Anaconda for Windows. 1. Download the latest version of Anaconda from: https://www.anaconda.com/download/success 2. Click on “Download” for the Windows operating system. 3. Double-click on the downloaded .exe file and follow the steps in the installation.

202


4. Click on “Next”.

5. Read the license agreement and click on “I Agree”.

6. Select the option install for “Just Me” unless you are installing for all users (which requires Windows Administrator privileges) and click “Next”.

Chapter 9 • Jupyter Notebook

203


7. Select the destination folder. Do not change anything in the path options and click on “Next”.

8. Wait for the installation to complete and click “Next”.

9. Click on “Finish”. Your Anaconda setup is complete.

204


What is Jupyter Notebook?

The Jupyter Notebook is an extremely effective tool for building and presenting AI projects in an interactive manner. The Jupyter project replaces the older IPython Notebook, which was released as a prototype in 2010. Although many different programming languages may be used in Jupyter Notebooks, Python is still the most popular. Jupyter Notebook is an open-source web-based application that allows you to create and share documents with live code, equations, visualisations, and text. Jupyter Notebook is widely used in a variety of applications. 1. Data cleansing and transformation 2. Numerical simulation 3. Statistical modelling 4. Data visualisation

Did You Know? A notebook integrates code and its output into a single document that combines visualisations, narrative text, mathematical equations, and other rich media.

5. Machine learning

Installing Jupyter Notebook

The simplest method to install and use Jupyter Notebook is using Anaconda. Anaconda is a command-line interface (CLI) tool, hence, it can only be used from the command line. Anaconda suggests that you work with conda on Windows using the Anaconda Prompt CLI. Users of MacOS and Linux can utilise the built-in command line programs. If you want a distribution with a large number of data science tools, you may install Anaconda, which contains Jupyter Notebook by default.

Kernels in Jupyter Notebook

Kernels are programs that execute interactive code written in a certain programming language and provide the user with output. A Jupyter Notebook’s code is run by computational engines called kernels. These kernels operate independently and are language-specific processes. Each kernel represents a certain programming language. For Python programming, IPython is the most widely used kernel; however, Jupyter supports a wide range of other languages via several kernels. Some common kernels in Jupyter Notebook are IPython, R, and Julia. It is thus necessary to install a kernel inside the environment where Jupyter Notebook will operate before we can use it in a virtual environment.

Virtual Environments

A virtual environment is a tool that allows you to have different dependencies and libraries for each project, preventing conflicts. This is one of the most useful tools for Python coders. For example: Suppose you are working on two web-based Python projects, one of which uses Python 2.6 and the other uses Python 3.9. To keep the dependencies between the two projects consistent in these situations, we need to develop a Python virtual environment.

Why is a Virtual Environment Necessary?

By default, every project on your system will store and fetch site packages in the same folders. As you can see, there are two versions of Python in the two projects given in the above example. Python is unable to distinguish between versions, which is a significant issue. To resolve this issue, we just need to construct two different virtual environments for each project. When working on any Python-based project, you should always use a virtual environment. It is often best to create a fresh virtual environment for each Python-based project you work on. As a result, each project’s dependencies are kept separate from the system and one another. The use of the Anaconda distribution makes virtual environment creation simple. Chapter 9 • Jupyter Notebook

205


How to Create Virtual Environment using Anaconda? 1. Open the Anaconda Prompt from the start menu.

2. When we open the Anaconda prompt, we can see the term ‘base’ is written at the beginning of the prompt. This is Anaconda’s default environment, as shown in figure.

3. To determine which version of Python will be installed, type python --version, as shown in figure.

4. We can now create our own virtual environment and use it without affecting the base. Let’s create a virtual environment called env. To create the environment, write ‘conda create -n env python=3.11.7’ as shown in figure.

206


5. This code will establish an environment called env and install some basic packages inside it, as shown in figure.

6. Following some processing, the prompt will ask whether we would want to continue with the installs or not. Type Y and press Enter. After we press Enter, the packages will begin to install in the environment.

Chapter 9 • Jupyter Notebook

207


7. After downloading and installing each package, we’ll see a message to activate or deactivate the environment, as shown in figure.

8. This indicates that our environment, env, was successfully built. When an environment is successfully built, we may access it by writing the following command: conda activate env

When the virtual environment is activated, as we can see, the phrase in brackets has changed from base to (env). Our virtual environment is now prepared for usage.

Working with Jupyter Notebook

1. To get started with a Jupyter Notebook, open the Anaconda prompt and type jupyter notebook, as shown in figure.

208


2. The Jupyter Notebook opens in the default browser at http://localhost:8888/tree. This will bring up a new tab in your web browser where you can create and manage notebooks.

3. Click on the “New” button. This will open a new tab in your web browser where you can write and execute code.

4. To choose a cell, simply click on it. Enter text or code into the cell. To execute a cell, click on the Run button or press Shift + Enter or Alt + Enter and go to the next cell.

5. The extension “.ipynb” is used for saving notebooks. You may use the File menu or Ctrl + S to save your notebook.

Notebook Interface

Jupyter Notebook is a Graphical User Interface (GUI), which implies that the Notebook interface provides a wide range of easily-accessible tools for making work simpler, many of which are a click away. Let us have a look at the Notebook’s features. Chapter 9 • Jupyter Notebook

209


Menu Bar

Jupyter Notebook includes its menu bar, with the following options—like File, Edit, View, Run, Kernel, Settings, and Help. 1. File Menu: You may open an existing Notebook or create a new one from the File menu. You may also click here to rename a Notebook. The Save and Checkpoint menu item is also available here. This enables you to create checkpoints from which you may roll back if necessary.

2. Edit Menu: You can use commands to cut, copy, and paste cells from the Edit menu. You may also use this menu to remove, split, or merge a cell.

210


3. View Menu: The View menu is helpful for changing the visibility of the header and toolbar. You can also toggle Line Numbers within cells on or off. You can also use the commands to work around with the cell’s toolbar.

4. Run Menu: This menu allows you to run selected cell or all the cells. The output will show immediately below the cell. You may also modify the type of a cell from here.

Chapter 9 • Jupyter Notebook

211


5. Kernel: The Kernel menu is used to interact with the kernel that is operating in the background. You may restart the kernel, reconnect to it, shut it off, or even change the kernel that your Notebook is now running.

6. Settings Menu: The Settings menu allows you to change the theme of Jupyter Notebook. User can also increase or decrease the font size of the terminal.

212


7. Help Menu: The Help menu allows you to learn about the Notebook’s keyboard shortcuts, take an overview of the user interface, and check lots of reference material.

In addition to the menu bar, the Notebook interface has a toolbar. Let us learn about each of the tools.

Chapter 9 • Jupyter Notebook

213


Let us now use the Jupyter Notebook to write a very simple Python program. Example: Write a Python code to multiply two given numbers.

Think and Tell

Remember

Which command is used to install Jupyter Notebook?

Keyboard Shortcuts: •

Esc + A: Insert a new cell above.

•

Esc + B: Insert a new cell below.

•

Esc + D: Delete the current cell.

•

Esc + Z: Undo cell deletion.

Did You Know? The name “Jupyter” comes from the three main programming languages it supports: Julia, Python, and R.

Activity Time Activity 1: Create your virtual environment.

(Group Activity)

Form groups of 4 students and create your virtual environment in the anaconda prompt and use it without affecting the base. Activity 2: Add two numbers using Python.

(Individual Work)

Open Jupyter Notebook using the Anaconda prompt and write a Python code to add two numbers.

Chapter Checkup A Select the correct option. 1 In a Jupyter Notebook, how do you run a code cell? a

214

Ctrl + C

b Ctrl + V

c Shift + Enter

d Ctrl + Shift + Enter


2 In Jupyter Notebook files, what is the default file extension? a .txt 3

b .pdf

d .docx

Which menu enables you to save a Jupyter Notebook? a File

4

c .ipynb

b Run

c Edit d View

Which of the following statements accurately describes Jupyter Notebook? a Jupyter Notebook is a command-line interface. b Jupyter Notebook is a Graphical User Interface (GUI). c Jupyter Notebook is a programming language. d Jupyter Notebook is a database management system.

B Fill in the blanks with the most suitable words. 1 CLI stands for

.

2 To determine which version of Python will be installed, type

C

.

3 A Jupyter Notebook’s code is run by computational engines called

.

4 The simplest method to install and use Jupyter Notebook is using

.

State whether the following statements are True or False. Correct the statements that are false. 1 Users of MacOS and Linux can utilise the built-in command line programs. 2 The Anaconda distribution is open source. 3 Julia is not a kernel in Jupyter Notebook. 4 When working on any Python-based project, you should always use a virtual environment.

D Answer the following questions. (Solved) Q1. What is a virtual environment? Explain with an example. A1. A virtual environment is a tool that allows you to have different dependencies and libraries for each project, preventing conflicts. This is one of the most useful tools for Python coders. For example: Suppose you are working on two web-based Python projects, one of which uses Python 2.6 and the other Python 3.9. To keep the dependencies between the two projects consistent in these situations, we need to develop a Python virtual environment. Q2. What is a Jupyter Notebook? Also write its applications. A2. The Jupyter Notebook is an extremely effective tool for building and presenting AI projects in an interactive manner. The Jupyter project replaces the older IPython Notebook, which was released as a prototype in 2010. Although many different programming languages may be used in Jupyter Note-books, Python is still the most popular. Jupyter Notebook is an open source web-based application that allows you to create and share documents with live code, equations, visualisations, and text. Jupyter Notebook is widely used in a variety of applications. i.

ii.

Data cleansing and transformation. Numerical simulation

iii. Statistical modelling iv. Data visualisation v.

Machine learning.

Chapter 9 • Jupyter Notebook

215


Q3. Explain kernel.

A3. Kernels are programs that execute interactive code written in a certain programming language and provide the user with output. A Jupyter Notebook’s code is run by computational engines called kernels. These kernels operate independently and are language-specific processes. Each kernel represents a certain programming language. For Python programming, IPython is the most widely used kernel. Q4. What are the advantages of using Anaconda to install Jupyter Notebook?

A4. The simplest method to install and use Jupyter Notebook is by using Anaconda. Anaconda is a free and open-source environment for writing and executing Python programs. It offers a significant benefit because it includes numerous pre-installed packages often used in machine learning and data science. This saves a significant amount of effort and time because each package does not need to be installed separately. Q5. How to activate and deactivate a virtual environment? A5. To activate virtual environment type conda activate env

To deactivate virtual environment type conda deactivate

AI Activities 1 Visit the link: https://docs.anaconda.com/ae-notebooks/user-guide/basic-tasks/apps/jupyter/ and start exploring the Jupyter Notebook. 2 Visit the link: https://realpython.com/jupyter-notebook-introduction/ and learn about Jupyter Notebook. 3 Visit the link: https://docs.jupyter.org/en/latest/projects/kernels.html and start learning about kernels.

Answer Key A

1. c

B

1. Command line interface

C

1. True

2. T rue

2. c

3. a

4. b 2. python --version

3. False. Julia is a kernel in Jupyter Notebook. 4. True

216

3. Kernels

4. Anaconda


Unit 3 • Advance Python (To be assessed through Practicals)

10 Introduction to Python L

et us revisit some of the key Python concepts we learned in grade IX, such as variables, data types, operators, and control structures. We will also explore how these fundamental ideas lay the groundwork for more advanced Python programming concepts in grade X. Python is a high-level programming language that is easy to learn and simple to use. It comes with a lot of pre-installed features. Python stands out from other programming languages due to its simplicity and readability, making it an ideal choice for beginners. It was created by Guido van Rossum and first released in 1991.

Features of Python

Here are some of the features of Python: 1. Easy to read: Python code is easy to read, just like English. 2. Quick to learn: Python has few keywords, a simple structure, and a clearly defined syntax. This makes it easier to learn and understand, even for beginners.

Did You Know? Python is named after a famous British comedy group called Monty Python.

3. Easy to maintain: Python source code is easy to maintain and update. 4. Dynamic typing: Python defines data type dynamically for the objects according to the value assigned. It also supports dynamic data type checking. 5. Portable: Python is a portable language because it can be used on a variety of hardware platforms. 6. Large database support: Python provides interfaces to all major commercial databases. 7. GUI application creation: Python also supports the creation of Graphical User Interface (GUI) applications.

Syntax

Like any language, programming languages have their own sets of rules for writing programs. These rules, called syntax rules, tell us how to write programs in that language. Python is not different; it has its own rules that we must follow when writing code. If we don’t follow the naming conventions or any syntax of a language, we may get syntax errors when executing our code.

217


Syntax errors are mistakes that happen when we don’t write our code correctly, such as using incorrect function names or missing quotes and brackets.

Data Types

In Python, every value has a data type. Data types define the type of data that a variable can store. There are two categories of data types in Python: Immutable and Mutable. •

Immutable data types are those whose values cannot be changed once declared.

•

Mutable data types are those whose values can be changed at any time. Python Data Types

Immutable

Mutable

Numbers 4, 7, 10.5

Strings ‘python@123’

Tuples (4,3.5, ‘b’)

Integer 4, 7, 10

Float 34.5

Complex 1+4j

Lists [4, ‘b’, 6.5]

Sets {2, 5, 7}

Dictionaries {1: ‘a’, 2: ‘b’}

Boolean (True, False) Look at the table. It shows the different data types and their descriptions. Look at the table. It shows the different data types and their descriptions. Name Name

TypeType

Description Description

Integer Integer

int

int

Whole numbers, both positive negative, like 15, -200, 0, etc. Whole numbers, like 15,and 200, and 275.

Floating point

Floating point

float

Numbers with a decimal point, like 4.3, 7.6, and 340.0.

String List

String

str

float

list

str

List

list

Dictionary

dict

Tuple

tuple

Dictionary

dict

Numbers with a decimal point, like 4.3, 7.6, and 340.0.

Ordered sequences of characters, like "Python", "hello", "1495", and "SV".

Ordered sequences of characters, like "Python", "hello", "1495", and "SV".

Ordered sequences of objects, like ["hello123", 40, 107.5].

Ordered sequences of objects, like ["hello123", 40, 107.5].

Unordered key-value pairs, like {"key": "value", "language": "Python"}.

Unordered key-value pairs, like {"key": "value", "language": "Python"}.

Ordered immutable sequences of objects, like (50, "python", 208.7).

Set Tuple

set tuple

Ordered immutable sequences objects, like (50, "python", 208.7). Unordered collections of unique objects,of like {"apple", "bird"}.

Set Boolean

bool set

Unordered collections ofFalse. unique objects, like {"apple", "bird"}. Logical value indicating True or

Boolean

bool

Logical value indicating True or False.

Variables

218A variable is a reference name given to a location in the computer’s

memory. It allows you to store a value in that location and refer to it as needed. Variables can be used to store numbers, strings,

num 5


Variables

A variable is a reference name given to a location in the computer’s memory. It allows you to store a value in that location and refer to it as needed. Variables can be used to store numbers, strings, lists, and other data types. They are just like a label that can be changed.

Creating a Variable

In Python, unlike some other programming languages, variable declaration and initialisation occur in a single step. You can simply assign a value to a variable’s name, and it will be automatically created. Syntax: variable_name = value The name of the variable is written to the left of the ‘=’ operator, and the value is written to the right. Code word = "Hi"

Output Hi 5

number = 5

print(word, number)

We can also initialise multiple variables in one line. Syntax: var1, var2 = value1, value2 Code word, number = "Hi", 5 print(word, number)

Output Hi 5

Rules of Naming a Variable

There are certain rules we need to follow while naming a variable. Some rules are:

Think and Tell

Will a syntax error prevent the program from running?

•

A variable name starts with a letter or the underscore character. It cannot start with a number or any special character like $, (, *, %, etc.

•

A variable name can only contain alpha-numeric characters.

•

Python variable names are case-sensitive, which means str1 and STR1 are two different variables in Python.

•

Python keywords cannot be used as variable names.

Variable Naming Styles in Python

As we have case styles for words in English, we have some case styles for naming variables. Below are the case styles you can follow to name variables in Python: Camel Case •

The first letter of the variable is lowercase.

•

Each subsequent word’s first letter is capitalised.

Chapter 10 • Introduction to Python

first word lowercase

Capitalise All Following Words

camelCase

219


•

No spaces or underscores.

•

Often used for variable and function names.

Example: “Nameofthecompany” can be written as “nameOfTheCompany”. As this represents the camel’s hump we call it Camel-Case. Code camelCaseExample = "Hello Camel" print(camelCaseExample)

Output Hello Camel

Snake Case •

All letters are lowercase.

•

Words are separated by underscores (_).

•

Often used for variable and function names.

Example: "name of the company" in snake-case is written as "name_of_ the_company". Code snake_case_example = "Hello Python" print(snake_case_example)

Output Hello Python

Creating a Variable with User Input

In Python, we can even create a variable with user input. To do so, we use a built-in function named input(). The input() Function The input() function in Python is used to allow input from the user. It is a built-in function. Syntax: name = input(“<message to be displayed>“) Code user_input = input("Enter your favourite colour: ")

Output Enter your favourite colour: blue

Solved Examples Example 1.1 The side of a square is 80. Use camel case to name a variable for the area of the square. Calculate the area. Print the result. Answer: Code side = 80

areaOfSquare = side * side

print("The area is: ", areaOfSquare)

220

Output The area is: 6400


Example 1.2 Given below are the average temperatures of different places. Store them in different variables. The temperature has increased by 0.5 in the afternoon. Display the updated temperature of all the places. Average Temperatures of Places Place

Temperature

Zo Hills

20

Met Town

25

Bay Area

26

Code

Output

Answer:

Zo_Hills=20

Updated Temperatures of Places

Met_Town=25

Zo Hills 20.5

Bay_Area=26

Met Town 25.5

print("Updated Temperatures of Places")

Bay Area 26.5

print("Zo Hills", Zo_Hills+0.5) print("Met Town",Met_Town+0.5) print("Bay Area",Bay_Area+0.5)

Simple Calculator

Let’s build a simple calculator project while learning the concepts in the chapter. We will be building this project by dividing it into various sub-tasks. Task 1: Take two numbers and an operator as input from the user. Let’s create three variables and use the input() function to allow input from the user. Code num1 = input("Enter first number: ") operator = input("Enter operator (+, -, *, /): ") num2 = input("Enter second number: ")

Now, before we execute the project, let us learn about dynamic typing.

Dynamic Typing

Dynamic typing is a feature of Python where the data type of a variable is not determined until runtime. This means that you can assign a variable to a value of any type, and the variable will automatically take on that type. The type() Function In Python, we use the type() function to check the dynamic data type assigned to a variable. It is a built-in function that returns the type of an object. The object can be a variable, a value, or an expression. Syntax: type(object_name)

Chapter 10 • Introduction to Python

221


Simple Calculator Task 2: Check the data type of user input. Code

Output

num1 = input("Enter first number: ")

Enter first number: 4

operator = input("Enter operator (+, -, *, /): ")

Enter operator (+, -, *, /): +

num2 = input("Enter second number: ")

Enter second number: 6

print(type(num1))

<class ‘str’>

print(type(num2))

<class ‘str’>

print(type(operator))

<class ‘str’>

The input() function always returns a string value, even if it takes a number, operator, or any other value as input. Since we have created variables with user input, all three variables are of string type.

Typecasting

Typecasting is the conversion of the data type of a value into another data type. We can typecast a data type using typecasting functions: 1. int()

2. float()

3. str()

4. bool()

The int() Function The int() function is used to typecast the value of a variable into an integer. It converts the following data type into an integer: 1. Float by removing the decimal point and everything after it. 2. String only if string represents a number.

Did You Know? If you try to convert a string type variable to int type, you will get an error.

3. Boolean by converting True to 1 and False to 0. Syntax: int(variable_name) Code

Output

str_to_int = int("8")

8 <class ‘int’>

bool_to_int = int(True)

1 <class ‘int’>

print(str_to_int, type(str_to_int)) print(bool_to_int, type(bool_to_int))

Code number=int("Hello")

222

Output ValueError: invalid literal for int() with base 10: ‘Hello’


The float() Function The float() function is used to typecast the value of a variable into float. It converts the following data type into float: 1. Integer by adding a decimal followed by a zero. 2. String only if the string represents a float or an integer. Syntax: float(variable_name) Code

Output

a=float(10)

10.0

b=float("10.2")

10.2

print(a) print(b)

Code c=float("Hello")

Output ValueError: could not convert string to float: ‘Hello’

print(c)

The str() Function The str() function is used to typecast the value of a variable into a string. It converts all the data types including float, integer, and boolean into a string. Syntax: str(variable_name) Code

Output

num_1 = str(5)

5 <class ‘str’>

num_2 = str(7.2)

7.2 <class ‘str’>

print(num_1, type(num_1)) print(num_2, type(num_2))

The bool() Function The bool() function is used to typecast the value of a variable into boolean. It converts the following data type into boolean: 1. Integer and prints False if the value of the variable is 0, otherwise prints True. 2. String and prints False if the string is empty, otherwise prints True. Syntax: bool(variable_name)

Chapter 10 • Introduction to Python

223


Code

Output

a=bool(0)

False True False True

b=bool(1)

c=bool("")

d=bool("Python") print(a,b,c,d)

Simple Calculator Task 3: Typecast the numbers that the user inputs into float. Code num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: "))

Next, we need to learn about operators we can use for various mathematical operations on numbers that the user inputs.

Arithmetic Operators

Arithmetic operators are the operators used with the integer or float values to perform mathematical operations on them. There are 7 arithmetic operators in Python: Operator

Name

Description

+

Addition

-

Example

Result

Adds two values together

4+2

6

Subtraction

Subtracts one value from another

7-5

2

*

Multiplication

Multiplies two values

5*2

10

/

Division

Divides one value by another

7/2

3.5

%

Modulus

Returns the remainder in a division operation

5%2

1

**

Exponent

Returns the exponent of a number

3**2

9

//

Floor Division

Returns floor value of the division

7//2

3

Example 1.3 Write a program to get the right answers to the questions given below. a = 23 b = 13 a. Addition of a and b. b. Multiplication of a and b. c. Division of a and b. d. Base a to the power b. e. Modulus of a%b

224

Think and Tell

Can we multiply a string by a float value in Python?


Answer: Code

Output

a,b=23,13

Addition of a and b is: 36

print("Addition of a and b is:",a+b)

Multiplication of a and b is: 299

print("Multiplication of a and b is:",a*b)

a divided by b is: 1.7692307692307692

print("a divided by b is:",a/b)

Base a to the power b is: 504036361936467383

print("Base a to the power b is:",a**b)

Remainder, when a is divided by b, is: 10

print("Remainder, when a is divided by b, is:",a%b)

PEDMAS Rule

Python follows the PEDMAS rule, which stands for: 1. Parentheses (P)

2. Exponents (E)

5. Addition (A)

6. Subtraction (S)

3. Division (D)

4. Multiplication (M)

This rule tells us the order in which operations are performed in an expression. Operations within parentheses are performed first, followed by exponents, division and then multiplication from left to right, and finally addition and subtraction from left to right. Example: 9 + 7 * (8 - 4) / 2 - 3**2

(First, the brackets are solved.)

= 9 + 7 * 4 / 2 - 3**2

(Then, the exponent is solved.)

=9+7*4/2-9

(Then, division is solved.)

=9+7*2-9

(Then, multiplication is solved.)

= 9 + 14 - 9

(Then, addition is solved.)

= 23 - 9

(Finally, subtraction is solved.)

= 14 Simple Calculator Task 4: Apply all four basic arithmetic operations ( +, - , *, / ) to the numbers the user inputs. Code num1 = float(input("Enter first number: "))

num2 = float(input("Enter second number: "))

Output Enter first number: 6 Enter second number: 8

add = num1+num2

Addition: 14.0

mul = num1*num2

Multiplication: 48.0

sub = num1-num2 div = num1/num2

Subtraction: -2.0 Division: 0.75

print("Addition: ", add)

print("Subtraction: ", sub)

print("Multiplication: ", mul) print("Division: ", div)

Chapter 10 • Introduction to Python

225


Control Statements

Control statements in Python are used to control the flow of execution of the program. They allow you to make decisions, repeat code, and skip code. There are three main types of control statements in Python: •

Conditional Statements

•

Loops

•

Jump Statements

Let us learn about these statements in detail.

Conditional Statements

Suppose you are going on a 3-day, 2-night school trip to Shimla during your summer holiday. What type of clothes will you pack? You will check the weather in Shimla and pack your clothes accordingly. Since you are visiting Shimla during the summer, you should pack light woollen clothes, as it will be pleasant during the day and a little cold at night. Similarly, we often find ourselves in situations where we need to make some decisions according to the given conditions. This skill we have is called decision-making ability. However, computers are machines. They cannot make decisions on their own. We need to make programs for them so that they can give the appropriate results according to the given conditions. This can be achieved with the help of conditional statements in Python. Conditional statements allow us to instruct the computer to check for a specific situation and make it do something if that situation occurs. A condition is set to establish criteria that require some form of comparison to be performed. Therefore, to define a condition, one must also understand the comparison operators.

Comparison Operators

Comparison operators are the symbols or expressions that allow us to compare two values or variables. They compare the value on the left-hand side with the value on the right-hand side and return either ‘True’ or ‘False’ as the result of the comparison. These operators are also known as Relational Operators. Below are the six comparison operators in Python. Operator

226

Name

Purpose

==

Equal to

Returns True if both operands are equal

x==y

!=

Not Equal to

Returns True if operands are not equal

x!=y

>

Greater than

Returns True if the left operand is greater than the right

x>y

<

Less than

Returns True if the left operand is less than the right

x<y

>=

Greater than or equal to

Returns True if the left operand is greater than or equal to the right

x>=y

<=

Less than or equal to

Returns True if the left operand is less than or equal to the right

x<=y

Example


Let us look at the following example to understand the usage of comparison operators. Johnny needs to determine whether the number of balls in box A is equal to, less than, or greater than the number of balls in box B. Box A contains 453 balls, and box B contains 454 balls. Using comparison operators, print whether the situations are ‘True’ or ‘False’.

Think and Tell

What is the difference between the greater than operator (>) and the greater than or equal to operator (>=)?

Answer: Code

Output

box_A=453

Are balls in box A equal to box B? False

box_B=454

Are balls in box A less than box B? True

cond1=box_A==box_B

Are balls in box A more than box B? False

print("Are balls in box A equal to box B? ", cond1) cond2=box_A<box_B print("Are balls in box A less than box B? ", cond2) cond3=box_A>box_B print("Are balls in box A more than box B?", cond3)

Indentation and Code Blocks

Indentation refers to a fixed number of spaces (or sometimes tabs) added at the beginning of each line of code. These spaces create a visual hierarchy in your program, just like paragraphs in a story or chapters in a book. Indentation helps Python understand which lines of code belong together and should be executed as a single unit. Although indentation in code is just for readability in other programming languages, it is crucial in Python. Interpreter view of Code Code block 1 begins Statement 1 Code block 2 begins Statement 2 Statement 3

Did You Know? What happens if you don’t indent your code properly?

Code block 2 ends Code block 1 ends

Types of Conditional Statements

In Python, we have three types of conditional statements that allow us to make decisions in our programs. These include: •

if Statement

•

if… else Statement

•

if… elif… else Ladder

Chapter 10 • Introduction to Python

227


• if… else Statement • if… elif… else Ladder The if Statement The if Statement

TheThe ‘if’ statement is used to check a specific condition. If the condition following thethe ‘if’ ‘if’ keyword evaluates to to True, ‘if’ statement is used to check a specific condition. If the condition following keyword evaluates True, the the code block after the ‘if’ condition will be executed; otherwise, the code block will be skipped. code block after the ‘if’ condition will be executed; otherwise, the code block will be skipped. Syntax: if condition1: Syntax: if condition1: ##Statement condition1isistrue true Statement to to execute execute ififcondition1

Flowchart

TheThe colon (:) sign is used after after the condition with the if the if colon (:) sign is used the condition with statement. The statements inside the if statement should be statement. The statements inside the if statement should properly indented. be properly indented. Code age = 21

True

False

Output

Code

if age >= 18:

If (condition)

Statement (s)

Eligible to vote.

Output

age = 21 if age >= 18: print("Eligible to vote.")

Eligible to vote.

print("Eligible to vote.")

rest of code

The if… else Statement

TheThe ‘if… else’ checks a condition, allowing us to instruct the computer on what to do in both cases, if… statement else Statement whether the statement is true or false. The ‘if… else’ statement checks a condition, allowing us to instruct the computer on what to do in both cases, If the condition ‘if’ keyword whether the following statementthe is true or false.evaluates to True, the code block after the if condition will be executed; otherwise, the codefollowing block after keyword will be If the condition thethe ‘if’ ‘else’ keyword evaluates toexecuted. True, the code block after the if condition will be executed; Syntax: otherwise, the code block after the ‘else’ keyword will be executed. Syntax: if condition_1: 18 if condition_1: #Statements to execute if condition_1 is True #Statements to execute if condition_1 is True else: else: #Statements to execute if condition_1 is False #Statements to execute if condition_1 is False

Test Expression False True

CO24CB0701.indb 18

Code

Code

age = 21

age>= = 21 if age 18:

if age >= 18: print("Eligible to vote.") print("Eligible to vote.") else: else: print("Too young to vote!") print("Too young to vote!")

Body of else

Body of if

Output Eligible to vote.

Flowchart

8/13/2024 11:47:29 AM

Output

Eligible to vote. Statement just below if

The elif Statement

The elif Statement

Sometimes, we need to evaluate multiple conditions. In such cases, we use the ‘elif’ statement, which stands for ‘else needmultiple to evaluate multipleinconditions. such cases, we use thecondition ‘elif’ statement, which stands ‘else if’. ItSometimes, allows us towe check conditions sequence, In and Python checks each until one of them is for True. if’. It allows us to check multiple conditions in sequence, and Python checks each condition until one of them is True. Syntax: Syntax: Flowchart if condition_1: if condition_1: Statement_1 if condition1 is True Statement_1 if condition1 is True elif condition_2:

228

..

Statement_2 if condition2 is True

False

If cond_1?

..

else:

True

code block 1 True


The elif Statement Sometimes, we need to evaluate multiple conditions. In such cases, we use the ‘elif’ statement, which stands for ‘else condition_2: if’. Itelif allows us to check multiple conditions in sequence, and Python checks each condition until one of them is True. Syntax:

Statement_2 if condition2 is True

Flowchart

if condition_1:

..

Statement_1 if condition1 is True

..

elif condition_2: else: Statement_2 if condition2 is True Final_Statement if no condition is True .. ..Code

x = 10

else:

if x > 0:

If cond_1?

Output x is positive

Final_Statement if no condition is True

print("x is positive")

elif x == 0:

False

x = 10

else:if x > 0:

code block 1

elif cond_2?

True

code block 2

False

Code

print("x is zero")

True

Output x is positive

else code block

print("x is negative") print("x is positive")

elif x == 0: print("xbecomes is zero") True, Statement_1 will be executed, otherwise, the interpreter moves on to condition_2 and If condition_1 else: if it becomes true then it will execute Statement_2. print("x is negative") This process continues until a True condition is found, otherwise the Final_Statement inside ‘else’ statement will be executed if none of the conditions are True. If condition_1 becomes True, Statement_1 will be executed, otherwise, the interpreter moves on to condition_2 Let us update the project we created in the previous section using comparison operators and conditionals. and if it becomes true then it will execute Statement_2. Simple This Calculator process continues until a True condition is found, otherwise the Final_Statement inside ‘else’ statement will be executed if none of the conditions are True. Code

Output

num1 = float(input("Enter first number: "))

Enter first number: 6

num2 = float(input("Enter second number: ")) Chapter == 2 • "+": Control Statements in Python if operator

Enter second number: 8

operator = input("Enter operator (+, -, *, /): ")

result = num1 + num2

Enter operator (+, -, *, /): / Result: 0.75

19

elif operator == "-":

result = num1 - num2

CO24CB0702_P1.indd 19 elif operator == "*":

8/13/2024 1:22:49 PM

result = num1 * num2

elif operator == "/": if num2 == 0:

result = "Division by zero is not allowed."

else:

result = num1 / num2

else:

result = "Invalid operator."

print("Result:",result)

Chapter 10 • Introduction to Python

229


Logical Operators

Logical operators allow us to combine multiple conditions in one. There are three important logical operators in Python: ‘and’, ‘or’ and ‘not.’

The and Operator

The ‘and’ operator allows us to combine two conditional statements and returns True only if both statements are true. In all other cases, it returns False. If Statement 1 is True and Statement 2 is True, then the result is True. If either Statement 1 or Statement 2 (or both) is False, then the result is False. Syntax: Statement 1 and Statement 2 Following is the truth table for the and operator: Condition 1

Operator

True True

and

False False

Condition 2

Result

True

True

False

False

True

False

False

False

Code

Output

print(3<7 and 8==8)

True

print(6>2 and 9==8)

False

The or Operator

The ‘or’ operator allows us to combine two conditional statements and returns True if either of the statements is true. It returns False only if both statements are false. If Statement 1 is True or Statement 2 is True (or both), then the result is True. If both Statement 1 and Statement 2 are False, then the result is False. Syntax: Statement 1 or Statement 2 Following is the truth table for the or operator: Condition 1

Operator

True True

or

False False Code print(4+5>8 or 9!=7) print(6>7 or 8==9.0)

230

Output True

False

Condition 2

Result

True

True

False

True

True

True

False

False

Did You Know? What is the difference between the ‘and’ and the ‘or’ operator?


Multiple and/or Operators

In Python, we have the flexibility to create complex conditional statements by using multiple ‘and’ and ‘or’ operators. When dealing with multiple conditional statements involving both ‘and’ and ‘or’, it is important to know that ‘and’ takes precedence over ‘or’. This means that conditions with ‘and’ are evaluated first, followed by the conditions with ‘or’. Syntax: Statement 1 or Statement 2 and Statement 3 #First we solve the ‘and’ operator, and then the ‘or’ Code

Output

print(2>3 or 3==3 and 1>0)

True

Let us look at how we got the output for the given code: 2 > 3 or 3 == 3 and 1 > 0 False or True and True

#Solve and first

False or True

#Solve or

True Solved Example Write a program to help David pick students for his project. He has two rules: 1. Students must have at least 60% in their school grades. 2. They need a score of at least 7 in their analytical tests.

Run the program to check if Ray and Joe meet David’s conditions. Ray has 65% in school and 8.5 in analytical tests. Joe has 55% in school and 8 in analytical tests. Answer: Code

Output

ray_academics=65

Ray’s scores:

print("Ray’s scores:")

Analytical test: 8.5

ray_analytical=8.5

print("Academics:", ray_academics)

print("Analytical test:", ray_analytical)

ray_condition = ray_academics>=60 and ray_analytical>=7 print("Does Ray meet David’s criteria?-", ray_condition) joe_academics=55 joe_analytical=8

Academics: 65

Does Ray meet David’s criteria?- True Joe’s scores:

Academics: 55

Analytical test: 8

Does Joe meet David’s criteria?- False

print("Joe’s scores:")

print("Academics:", joe_academics)

print("Analytical test:", joe_analytical)

joe_condition = joe_academics>=60 and joe_analytical>=7 print("Does Joe meet David’s criteria?-", joe_condition)

Chapter 10 • Introduction to Python

231


The not Operator

The not operator reverses the result of the condition. True will be reversed to False, and vice versa. The not Operator For example, The not operator reverses the result of the condition. True will be reversed to False, and vice versa. not (True)For example,

(True) will returnnot False. will return False.

LoopsLoops

When weWhen write computer programs,programs, there are there timesare when we when need to same the piece of code andagain and we write computer times weexecute need tothe execute same pieceagain of code again. In that case, we have samethe code again andagain again. This is not an efficient way of programming. again. In that case,to wewrite havethe to write same code and again. This can be improved by using ‘loops’. This is not an efficient way of programming. This can be improved by using ‘loops’.

Loops allow us toallow execute a set of instructions as long as aascertain condition True. Onceisthat becomes False, the False, Loops us to execute a set of instructions long as a certainiscondition True.condition Once that condition becomes loop stops.the This process alsoprocess known as iteration. loop stops.isThis is also known as iteration. Python provides mainly two types of loops, the while loop and the for loop. Python provides mainly two types of loops, the while loop and the for loop.

The forThe Loop for Loop

A ‘for’ loop a way to do something over and over It can be used tobe repeat of a block A is ‘for’ loopofistelling a way aofcomputer telling a computer to do something overagain. and over again. It can usedatoblock repeat code a certain number of times, or to go through a list of things one by one. of code a certain number of times, or to go through a list of things one by one. A ‘for’ loop also known asknown a counting loop. We use variable create to thecreate ‘for’ loop thecalled loop variable. A is ‘for’ loop is also as a counting loop.a We use ato variable the called ‘for’ loop the loop variable. Syntax: Syntax:

forinvariable in sequence: for variable sequence:

Flowchart

# Statements # Statements to be executedto be executed for item in sequence:

item in sequence?

If no more item to iterate

Next item from sequence Code to be executed

There are two ways to create a ‘for’ loop:

are two ways to create a ‘for’ loop: 1. Using There the range() function. 1 in Using the range() function. 2. Using the operator.

2 Using the in operator. Using range() Function

The range() function in Python returns a sequence of numbers, starting from 0 by default, and increments by 1 by default, Using range() Function and stops before a specified number. The range() function in Python returns a sequence of numbers, starting from 0 by default, and increments by 1 by default, and stops before a specified number.

232

Chapter 2 • Control Statements in Python

23


The range() function can be used in a ‘for’ loop to iterate over a sequence of numbers. Syntax: for loop_variable in range(start, stop, step): <statements> #the loop runs from start to stop-1 where: start is the starting number (optional, default is 0) stop is the ending number (not inclusive) step is the increment (optional, default is 1) Code for num in range(0, 5):

Output 0

print(num)

1 2 3 4

Here, the ‘for’ loop starts at 0 and counts up to 4, increasing by 1 each time. Note that if the increment is by 1, there is no need to specify it. Using the ‘in’ Operator The ‘in’ operator is a membership operator that checks if an item is a member of a sequence or not. It can be used in a ‘for’ loop to iterate over the items of a string, list, tuple, or dictionary. Syntax: for loop_variable in string_variable: <statements> Code word = 'bumfuzzle' for letter in word: print(letter)

Output b

u

m f

u z z l

e

Here, the loop iterates over the letters of the string word, starting with the first letter ‘b’ and ending with the last letter ‘e’.

The while Loop

The ‘while’ loop repeats a set of instructions as long as a condition is True. It is also known as a conditional loop. It verifies the condition before executing the loop.

Chapter 10 • Introduction to Python

233


Syntax: Syntax:

Flowchart

while condition: while condition:

Statement 1 Statement 1 Statement 2 Statement 2 ... ... … … Increment/decrement loop variable Increment/decrement loop variable Code

Output

i = 1Code while i < 6:

i=1

while i < 6: print(i) i

+= 1

print(i) i += 1

1 Output 1 2 3 4 5

2 3

while

Condition

False

True

Code to be executed

4 5

Here, the ‘while’ loop starts value i being As long aslong i is less 6, than the loop willloop continue. In each In each Here, the ‘while’ loop with startsthe with theof value of i1. being 1. As as ithan is less 6, the will continue. iteration of the of loop, value i is printed and then by 1. The loop stop is equal 6. to 6. iteration thethe loop, the of value of i is printed andincremented then incremented by 1. Thewill loop willwhen stop iwhen i is to equal

The for versus while Loop The for versus while Loop

The ‘for’and loop and the loop ‘while’ loop are both control flow statements in that Python used toarepeat a code. block of The ‘for’ loop the ‘while’ are both control flow statements in Python arethat usedare to repeat block of code. However, they have different usage scenarios. However, they have different usage scenarios. The ‘for’ loop is used to iterate over a sequence of items, such as a list, tuple, or string, when the number of times The ‘for’ loop is used to iterate over a sequence of items, such as a list, tuple, or string, when the number of times you want to iterate is known. you want to iterate is known. The ‘while’ loop is used to repeat a block of code when the number of times you want to iterate is not known or The ‘while’ loop is used to repeat a block of code when the number of times you want to iterate is not known or when the number of iterations depends on the results of the loop. when the number of iterations depends on the results of the condition being evaluated within the loop.

Jump Statements

Jump Statements Loops run the same set of code for a defined number of times or until the test condition becomes False. However, Loops sometimes run the same of code a defined number timesthe or until the test condition False. weset might wishfor to stop the loop evenof before test condition becomesbecomes False or skip anHowever, iteration. sometimes we might wish to stop the loop even before the test condition becomes False or skip an iteration. This is where we need Jump statements. This isJump where we need jump statements allowstatements. you to skip code or terminate a loop. We have two jump statements in Python:

•

Jump statements allow you to skip code or terminate a loop. We have two jump statements in Python: break statement • •

break statement statement • continue continue statement

The break Statement

The ‘break’ statement is used to terminate the loop. The break Statement Syntax: The ‘break’ statement is used to terminate the loop. while expression: Syntax: if condition: while expression: break #breaks out of the loop if condition: #executes statement outside the loop

234

Chapter 2 • Control Statements in Python

25


break #breaks out of the loop #executes statement outside the loop Code word = input('Enter a word: ') for letter in word:

if letter in 'aeiou':

Output Enter a word: apple Vowel found!

print('Vowel found!') break

Here, the loop checks for all the letters in the word entered by a user for vowels. If the letter is a vowel, the ‘break’ statement will run, and the loop will terminate. Otherwise, the loop will continue to run until it reaches the end of the word. The continue Statement The ‘continue’ statement skips the current iteration of the loop and continues with the next iteration. Syntax:

while expression: Statement_1 if condition:

continue

#skips current set of statements and starts with next loop iteration Statement_2 Code

for num in range(1, 11):

if num == 4 or num== 6 or num==8: continue

print(num)

Output 1 2 3 5 7 9

10

Here, the loop starts counting from 1 and increments the value of num by 1 in each iteration. When the value of num is equal to 4, 6, or 8, the ‘continue’ statement is executed, which skips the printing of the number and goes to the next iteration of the loop.

Infinite Loop

In a program, if a loop is executed over and over again without stopping, it is called an ‘infinite’ loop. This can happen if the condition that controls the loop is always true, or if the loop is never terminated by a ‘break’ statement. Code while True:

print("This is an infinite loop!")

Chapter 10 • Introduction to Python

Did You Know? Infinite loops can be useful when you want to create a program that runs continuously, such as a server or a chatbot.

235


Here, the loop will print the message “This is an infinite loop!” repeatedly, until the program is terminated by the user. An ‘infinite’ loop can lead to the program becoming unresponsive.

How to Prevent an Infinite Loop?

To prevent an ‘infinite’ loop, it is important to carefully consider the condition that controls the loop. Make sure that the condition is only true under the circumstances you want. You should also use ‘break’ statements to terminate loops when you no longer need them to run. Code counter = 0

while counter < 5: # This loop will run 5 times. print("Loop iteration:", counter) counter += 1

Output Loop iteration: 0 Loop iteration: 1 Loop iteration: 2 Loop iteration: 3 Loop iteration: 4

Here, the loop will run five times because the counter variable starts at 0 and increments by 1 each time the loop runs. The loop will continue as long as the counter is less than 5. Once the counter reaches 5, the condition is no longer true, and the loop exits.

Strings

A string is a data type that represents a sequence of characters. In Python, single, double, or even triple quotes can be used to create strings. These values can be words, symbols, characters, numbers, or a combination of all these. A string cannot be changed once it has been created because it is an immutable data type. Strings are commonly used for storing and manipulating text data, as well as representing names, addresses, and other types of information that can be represented as text. There are two types of strings in Python: • Single-line string • Multi-line string

Single-line String

A single-line string can be enclosed in either single quotes or double quotes. Code name1="Mohit" name2='Mohit' print(name1)

Output Mohit Mohit

print(name2)

Multi-line String

Multi-line strings or strings that contain both single and double quotes without needing to escape them are typically defined using triple quotes in Python. In other words, a multi-line string can be enclosed in either three single quotes (‘‘‘ ’’’) or three double quotes (""" """).

236


Code

Output

proverb_1= '''Don't judge

Don’t judge

by its cover. '''

by its cover.

a book

a book

proverb_2= """

Beauty is

in the eye of

the beholder.

Beauty is

in the eye of

the beholder. """

"Actions speak louder than words." A common saying we all know.

proverb_3 = """"Actions speak louder than words."

A common saying we all know.""" print(proverb_1) print(proverb_2) print(proverb_3)

The eval() Function The eval() function evaluates a string expression and returns the result. Syntax: result = eval(expression) Code expression = "2 * 3 + 4 / 2" result = eval(expression) print(result)

Output 8.0 8

Did You Know? A single character in Python

x=5

is just a string of length 1,

expression = "x + y"

as a character data type.

y=3

since there is no such thing

result = eval(expression) print(result)

String Manipulation in Python

You have covered most of this in grade 9, but let’s revisit and explore some important string manipulation techniques. String manipulation in Python involves various operations to process and modify string data. Python provides a set of string methods to perform these operations. Let us learn about some of the important string operations.

Concatenation

Concatenation means to join two or more strings together to form a single string. Two strings can be concatenated or joined with the plus ‘+’ symbol, which is known as the concatenation operator. Let’s understand it with the help of an example:

Chapter 10 • Introduction to Python

237


Code # concat strings with +

Output Welcome to World of Python

str1 = "Welcome to"

str2 = "World of Python"

sentence = str1 + ' ' + str2 print(sentence)

Replication

Replication of strings means to repeat a certain string a specified number of times. The replication operation can be performed with the help of the asterisk symbol '*', which is known as the replication operator. Look at the given example: Code str1='hello'

Output hello

str2='hello'*3

hellohellohello

print(str1) print(str2)

Replacing a String

If you wish to replace a string, just call the replace() function on any string and specify the string you want to replace it with. Look at the following example: Code sentence = "Welcome to World of Python" print(sentence)

print(sentence.replace("Python","Disneyland"))

Output Welcome to World of Python Welcome to World of Disneyland

Finding the Length of a String

To find the length of a string, the len() function is used. The len() function returns the number of characters in a string, including spaces, punctuation, and special characters. Code str = "Python, World!" length = len(str)

Output The length of the string is: 14

print("The length of the string is:", length)

Accessing Characters in Python String

The indexing method in Python can be used to access specific characters within a string. •

hrough indexing, characters at the beginning of the string can be accessed using positive address references, T starting from 0 for the first character, 1 for the next character, 2 for the next to the next character (as shown in the image), and so on.

238


•

Through indexing, characters at the end of the string can be accessed using negative address references, such as –1 for the last character, –2 for the next-to-last character, and so on. 0

1

2 t

h

−12

−11

−10

−9

P

y

3

4

o

5

n

6

−8

−7

−6

7

w

8

o

9

10

11

−5

−4

−3

−2

−1

r

l

d

Let us understand it with the help of an example: In this example, we will define a string in Python and access its characters using positive and negative indexing. The 0th element will be the first character of the string, whereas the –1th element is the last character of the string. Code String1 = "Python World" print("Initial String: ") print(String1)

Output Initial String:

Python World

# Printing First character

First character of String is:

print(String1[0])

P

print("\nFirst character of String is: ") print(String1[-12])

P

# Printing Last character

Last character of String is:

print(String1[-1])

d

print("\nLast character of String is: ") print(String1[11])

d

# Printing Fifth character

Fifth character of String is:

print(String1[4])

o

print("\nFifth character of String is: ") print(String1[-8])

o

String Slicing

The string slicing function in Python is used to gain access to a selection of characters in the string. A colon (:), known as a "slicing operator", is used to access a part of the string. •

he string provided after slicing includes the character at the start index but not the character at the last index, T so keep that in mind while using this method.

•

ubsets of strings can be taken using the slice operators ([ ] and [:]) with indexes starting at 0 at the beginning S of the string and working their way from -1 at the end.

Let us understand it with the help of an example: In the following example, we will slice the original string to extract a substring. The expression [4:12] indicates that the string will be divided into segments starting at index 4 and continuing through index 11. In string slicing, negative indexing is another option.

Chapter 10 • Introduction to Python

239


Code # Creating a String

Output Initial String:

String1 = "Python World"

Python World

print("Initial String: ") print(String1)

# Printing 4th to 12th character

print("\nSlicing characters from 4-12: ") print(String1[4:12])

# Printing characters between 4th and 3rd last character print("\nSlicing characters between 4th and 3rd last character: ") print(String1[4:-3])

Slicing characters from 4-12: on World

Slicing characters between 4th and 3rd last character: on Wo

Using In-built String Methods

Python provides several in-built methods to change the case of strings. These methods help format and standardise text. Here are some main functions for changing the case of Python strings: 1. upper() The upper() method converts all lowercase letters in a string to uppercase. Code str = "python world"

Output PYTHON WORLD

result = str.upper() print(result)

2. lower() The lower() method converts all uppercase letters in a string to lowercase. Code str = "PYTHON WORLD"

Output python world

result = str.lower() print(result)

3. capitalize() The capitalize() method converts the first character of a string to uppercase and the rest to lowercase. Code str = "python world"

result = str.capitalize()

Output Python world

print(result)

4. title() he title() method converts the first character of each word to uppercase and the rest to lowercase. Words in a T string should be separated by whitespace or punctuation marks.

240


Code str = "welcome to the world of python" result = str.title()

Output Welcome To The World Of Python

print(result)

5. swapcase() The swapcase() method converts uppercase characters to lowercase and lowercase characters to uppercase. Code str = "Python World"

Output pYTHON wORLD

result = str.swapcase() print(result)

Decision-making Using String Methods

Apart from these text formatting methods in Python, there are some more methods that are used for decision making using strings. These methods can determine whether a string or character is in uppercase, lowercase, title case, or whether it contains digits or alphanumeric characters. Here are some of the main functions for checking the properties of strings: 1. isupper() he isupper() method returns True if all the alphabetic characters in a string are uppercase. If the string contains T no alphabetic characters, the method returns False. Code str = "PYTHON WORLD"

Output True

result = str.isupper()

False

print(result)

str = "Python World" result = str.isupper() print(result)

2. islower() he islower() method returns True if all the alphabetic characters in a string are lowercase. If the string contains T no alphabetic characters, the method returns False. Code str = "python world" result = str.islower() print(result)

Output True

False

str = "Python World" result = str.islower() print(result)

Chapter 10 • Introduction to Python

241


3. istitle() he istitle() method returns True if a string is title-cased, which means the first character of each word is T uppercase and the rest are lowercase. Code str = "Python World"

Output True

result = str.istitle()

False

print(result)

str = "python world" result = str.istitle() print(result)

4. isdigit() The isdigit() method returns True if all the characters in a string are digits. Code str = "987654321"

Output True

result = str.isdigit()

False

print(result)

str = "python98765" result = str.isdigit() print(result)

5. isalpha() The isalpha() method returns True if all the characters in a string are alphabets. Code str = "Hello"

Output True

result = str.isalpha()

False

print(result)

str = "987654321"

result = str.isalpha() print(result)

6. isalnum() The isalnum() method returns True if all the characters in a string are alphanumeric (letters and numbers). Code str = "987654321"

result = str.isalnum() print(result)

str = "python98765"

result = str.isalnum() print(result)

242

Output True True


Solved Examples Example 2.1 #Python program to perform String operations Code

Output

str2 = 'Hello Sunita'

Hello Sunita

print (str2) # Prints complete string

H

print (str2[0]) # Prints first character of the string

llo

print (str2[2:5]) # Prints characters starting from 3rd to 5th

llo Sunita

print (str2[2:]) # Prints string starting from 3rd character

Hello SunitaHello Sunita

print (str2 * 2) # Prints string two times

Hello SunitaTEST

print (str2 + "TEST") # Prints concatenated string

Example 2.2 #Python program to count the number of vowels in a string Code

Output

string=input("Enter string:")

Enter string:ritu

vowels=0

Number of vowels are: 2

for i in string: if(i=='a' or i=='e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U'): vowels=vowels+1 print("Number of vowels are:", vowels)

Example 2.3 #Python program to count number of lowercase characters in a string Code

Output

string=input("Enter string:")

Enter string:Ritu Singh

count=0

The number of lowercase characters is: 7

for i in string: if(i.islower()): count=count+1 print("The number of lowercase characters is:", count)

Example 2.4 #Python program to count the number of words and characters in a string

Chapter 10 • Introduction to Python

243


Code

Output

string=input("Enter string: ")

Enter string: Ritu is a good girl

char=0

Number of words in the string: 5

word=1

Number of characters in the string: 19

for i in string: char=char+1 if(i==' '): word=word+1 print("Number of words in the string:", word) print("Number of characters in the string:", char)

Lists

Lists are a fundamental data type in Python. It is a collection of various kinds of values. It can hold multiple values in a single variable. In Python, lists are used to store multiple values simultaneously. Python includes a built-in list type named "list". In lists, items are written within square brackets [ ]. A list can: • Store different types (integer, float, string, etc.) of elements. • Store duplicate elements. • Store the elements in an ordered manner. Example: mylist = [2, 4, 6, 8, "Python", 10, 10]

Characteristics of Lists

The characteristics of the lists are given below: • Ordered: In a list, the values or items have a defined order, and this order does not change. If you add new values to a list, they are placed at the end of the list. • Accessed via the Index: You can access list elements using an index, which starts at 0. Hence, the first element of a list is present at index 0, not 1. • Allows Duplicate Values: A list can contain duplicate values. Since values are indexed in a list, it can have items with the same value but a different index. • Mutable: The meaning of mutable is "liable to change". In Python, list items are mutable. It means elements of the list can be modified, individual elements can be replaced, and the order of elements can be changed even after the list has been created. • Variable Size: Lists can store a variable number of elements, allowing you to store and manage different quantities of data.

Creating a List in Python

In Python, you can create a list by enclosing the values or elements within square brackets [ ], separated by commas. There is no need for a built-in function to create a list.

244


Syntax: list_name = [element_1, element_2, … , element_n] Example: Example: Suppose you need to record the percentage of marks for six students. For this, you can simply create a list. Suppose you need to record the ages of five people. For this, you can simply create a list. Code Output markslist = [70, 88, 90.2,Code 75, 68, 59.5]

[70, 88, 90.2, 75, 68, 59.5]Output

agelist = [25, 32, 47, 19, 54] print(markslist)

[25, 32, 47, 19, 54]

print(agelist)

Creating a List with Duplicate Elements Creating a List with Duplicate Elements A list can have duplicate values. Let us see the following example: A list can have duplicate values. Let us see the following example: Code

Output

Code

list = [3, 4, 9, 3, 8, 9]

Output

[3, 4, 9, 3, 8, 9]

list = [3, 4, 9, 3, 8, 9]

[3, 4, 9, 3, 8, 9]

print(list) print(list)

Creating a List with Mixed Types ofof Elements Creating a List with Mixed Types Elements

You can have elements ofof different data types inin aa list. You can have elements different data types list.They Theycan canbe beofofnumeric numerictype, type,string stringtype, type,Boolean Booleantype, type,etc. etc. Example: Example: Code

Code

Output

Output

list1 = ["Sunita", 27,34, True, 42.7,55.5, "Ravi"] list1 = ["Ankit", False, "Mala"]

['Sunita', 27, False, True, 42.7, [‘Ankit’, 34, 55.5,'Ravi'] ‘Mala’]

print(list1)

print(list1)

AccessingElements Elements of a Accessing a List List

Indexing is used in Python to access listlist elements. Suppose there areare n number of elements in ain list. Therefore, Indexing is used in Python to access elements. Suppose there n number of elements a list. Therefore, the listlist indexing will start at at 0 for the first element and n-1 forfor the last element. You can use these index values toto the indexing will start 0 for the first element and n-1 the last element. You can use these index values access the items in the list. The index must be an integer. Let us see how to access elements in a list. Look at the access the items in the list. The index must be an integer. Let us see how to access elements in a list. Look at the following image to to understand the concept of of indexing: following image understand the concept indexing: length = 6

index

‘p’ ‘y’

‘t’

‘h’ ‘o’ ‘n’

0

2

3

1

4

5

Example: Example: Print the third and fifth item of the list.list. Print the second fourth items of the [Hint: thirdelement elementhas hasan anindex index12and andthe thefourth fifth 4.]has an index 3. Hint: TheThe second Code

Code

markslist [70, agelist = [25, =32, 47,88, 19, 90.2, 54] 75, 68, 59.5] print(agelist[1]) print(markslist[2]) print(agelist[3])

Output

Output

90.2 32 19 68

print(markslist[4])

30 10 • Introduction to Python Chapter

245


List Methods

Python has a set of built-in methods that you can use on lists. append(): This method is used to add an element at the end of the list. An element can be of any type (string, number, object, etc.). Syntax: list.append(element) For example, add the item "eggs" to the shopping_list = ["bread", "butter", "milk", "apples"]. Code shopping_list = ["bread", "butter", "milk", "apples"] shopping_list.append("eggs")

Output [‘bread’, ‘butter’, ‘milk’, ‘apples’, ‘eggs’]

print(shopping_list)

Consider another example: Code my_list = [1, 2, 3]

Output [1, 2, 3, [4, 5]]

my_list.append([4, 5]) print(my_list)

The append() adds its argument as a single element at the end of the list. extend(): This method is used to extend the list by adding each element from another collection such as a list, individually to the end of the list. Syntax: list.extend(collection) Code my_list = [1, 2, 3]

Output [1, 2, 3, 4, 5]

my_list.extend([4, 5]) print(my_list)

Error Alert! Unlike append, which adds its argument as a single element, extend goes through each element in the collection and adds them one by one to the list. clear(): This method is used to remove all the elements from the list. Syntax: list.clear() For example, remove all elements from the shopping_list = ["bread", "butter", "milk", "apples"]. Code shopping_list = ["bread", "butter", "milk", "apples"] shopping_list.clear() print(shopping_list)

246

Output []


count(): This method is used to return the number of the specified element. Syntax: list.count(value) For example, to count the number of times the value 5 appears in the list: list = [5, 2, 7, 5, 8, 5, 1]. Code list = [5, 2, 7, 5, 8, 5, 1]

Output 3

x = list.count(5) print(x)

pop(): This method is used to remove the element at the specified position. Syntax: list.pop(position) For example, remove the third element from the list = [5, 2, 7, 5, 8, 5, 1]. [Hint: The third element has an index 2.] Code list = [5, 2, 7, 5, 8, 5, 1]

Output [5, 2, 5, 8, 5, 1]

list.pop(2) print(list)

Note: If the position is not specified, by default, the pop() method removes the last element from the list. remove(): This method is used to remove the first occurrence of the specified element. Syntax: list.remove(element) For example, remove 5 from the list = [5, 2, 7, 5, 8, 5, 1]. Code list = [5, 2, 7, 5, 8, 5, 1]

Output [2, 7, 5, 8, 5, 1]

list.remove(5) print(list)

index(): This method is used to find the position of the first occurrence of the specified element. Syntax: list.index(value) For example, find the first occurrence of the value 5, and return its position in the list = [5, 2, 7, 5, 8, 5, 1]. Code list = [5, 2, 7, 5, 8, 5, 1] x = list.index(5)

Output 0

print(x)

sort(): This method is used to sort the list in ascending order, by default. To sort the list in descending order, the attribute reverse is used. If its value is set to ‘True’, then the list will be sorted in descending order. Syntax: list.sort()

Chapter 10 • Introduction to Python

247


Example 1: Sort the list = [5, 2, 7, 5, 8, 5, 1] in ascending order. Code list = [5, 2, 7, 5, 8, 5, 1]

Output [1, 2, 5, 5, 5, 7, 8]

list.sort()

print(list)

Example 2: Sort the list = [5, 2, 7, 5, 8, 5, 1] in descending order Code list = [5, 2, 7, 5, 8, 5, 1]

Output [8, 7, 5, 5, 5, 2, 1]

list.sort (reverse=True) print(list)

Solved Examples Example 3.1 Create a list of fruits (Apple, Banana, Cherry, Date, Orange). Print all the fruits in the list, one by one. Ans: Code fruit_list = ["Apple", "Banana", "Cherry", "Date", "Orange"] for fruit in fruit_list: print(fruit)

Output Apple

Banana Cherry Date

Orange

Example 3.2 Sort the list alphabetically: List: ['b', 'a', 'l', 'l', 'o', 'o', 'n'] Ans: Code char_list = ['b', 'a', 'l', 'l', 'o', 'o', 'n'] char_list.sort()

Output ['a', 'b', 'l', 'l', 'n', 'o', 'o']

print(char_list)

Tuples

A tuple is an ordered, immutable collection of things or values. Tuples are sequences, just like lists, but they cannot be modified, unlike lists. Lists use square brackets, while tuples use parentheses () to enclose the elements. Tuples are faster than lists. For example, mytuple = (1, 2, 3, 4, 5)

248


Characteristics of Tuples

The characteristics of tuples are given below: • Ordered: In a tuple, the values or items have a defined order, and this order does not change. • A ccessed via the Index: The tuple element can be accessed via the index. It means that the tuple index always starts with 0. Hence, the first element of a tuple is present at index 0, not 1. • I mmutable: The tuple items are immutable. The meaning of immutable is "unable to be changed". It means that we cannot add, modify, or remove items in a tuple after it has been created. • A llows Duplicate Values: A tuple can contain duplicate values. Since values are indexed in a tuple, it can have items with the same value and a different index.

Creating a Tuple

In Python, you can create a tuple by placing the values or elements inside the parentheses ( ), separated by commas. Syntax: tuple_name = (element_1, element_2, … , element_n) Creating a Tuple with a Single Item To create a tuple with a single item, you have to add a comma after the item; otherwise, Python will not recognise it as a tuple. Example: Code mytuple = ("Delhi",)

Output Delhi

print(mytuple)

Creating a Tuple with Duplicate Elements A tuple can contain duplicate elements. Their index values will be different. Example: Code tuple = (3, 4, 9, 6, 4, 9)

Output (3, 4, 9, 6, 4, 9)

print(tuple)

Creating a Tuple with Mixed Elements A tuple can have elements of mix data type. Example: Code tuple = ("Delhi", 4, 9, "Japan", 4, 9) print(tuple)

Chapter 10 • Introduction to Python

Output (‘Delhi’, 4, 9, ‘Japan’, 4, 9)

249


Accessing Elements of a Tuple

Indexing is used in Python to access tuple elements. You can access a tuple entry using indexing. In Python, tuple indexing starts at 0 for the first element. You can use the index operator [ ] to access an item in a tuple. The index must be an integer. Here is how you can access elements in a tuple: For example: Print the first item in the tuple. Code tuple1 = ("Delhi", "Punjab", "Haryana", "Gujarat") print(tuple1[0])

Output Delhi

Tuple Methods

Python has two built-in methods that you can use on tuples. count(): This method is used to compute the occurrence of a specified value that appears in the tuple. Syntax: tuple.count(value) Example: How many times the value 9 appears in the tuple = (3, 4, 9, 6, 4, 9)? Code tuple = (3, 4, 9, 6, 4, 9)

Output 2

x = tuple.count(9) print(x)

Index(): This method is used to find the position of the first occurrence of the specified value. Syntax: tuple.index(value) Example: Find the first occurrence of the value 9, and return its position in the tuple = (3, 4, 9, 6, 4, 9). Code tuple = (3, 4, 9, 6, 4, 9) x= tuple.index(9)

Output 2

print(x)

Deleting Elements of a Tuple

As you are aware, the tuple items are immutable. It implies that once a tuple is created, its elements cannot be changed, added to, or removed without creating a new tuple. However, there is a workaround using the steps that follow: • You can convert the tuple into a list • Change the list • Convert the list back into a tuple Example: Convert the tuple into a list, remove "Haryana", and convert it back into a tuple:

250


Code tuple1 = ("Delhi", "Punjab", "Haryana", "Gujarat") x = list(tuple1)

Output (‘Delhi’, ‘Punjab’, ‘Gujarat’)

x.remove("Haryana") tuple1 = tuple(x) print(tuple1)

mytuple = ("Delhi") print(mytuple)

Solved Examples Example 3.3 Combine or merge two given tuples. tuple1 = (1, 3, 5)

Think and Tell

tuple2 = (2, 4, 6)

Are lists and tuples heterogeneous or homogeneous data structures?

Ans: Tuple concatenation is used to merge the tuples. Code tuple1 = (1, 3, 5)

Output (1, 2, 3, 4, 5, 6)

tuple2 = (2, 4, 6)

result_tuple = tuple1 + tuple2 print(result_tuple)

Example 3.4 Multiply the given tuple by 3. tuple1 = (1, 2, 3) You can use the ‘*’ operator to multiply the tuple. This feature is known as replicating a tuple. Code tuple1 = (1, 2, 3)

tuple1 = tuple1*3

Output (1, 2, 3, 1, 2, 3, 1, 2, 3)

print(tuple1)

Difference Between Lists and Tuples

Lists and tuples are both used to store items and organise data. They are a fundamental concept in Python. But they have a major difference. In lists, the elements can be changed after they are defined, while in tuples, the elements cannot be changed at all. In real life, you might use a shopping list where items can be added, removed, or modified. The tuples can be used to represent days of the week, as these do not change.

Chapter 10 • Introduction to Python

251


S. No.

Lists

Tuples

1

Lists are mutable.

Tuples are immutable.

2

You can easily insert or delete data items in a list.

You cannot directly insert or delete data items in a tuple.

3

Lists have several built-in methods.

Due to immutability, a tuple does not have many built-in methods.

4

Lists are generally slightly slower than tuples because of their mutability.

Tuples are faster than lists.

5

Lists are created using square brackets [].

Tuples are created using parentheses ().

6

Example: list1 = [1, 2, 3]

Example: tuple1 = (1, 2, 3)

Activity Time 1. Write a Python program to calculate the product of the digits in a number. 2. Create a shopping list with items you want to purchase and write a Python code that sorts the list in reverse alphabetical order. 3. Create a tuple containing the names of five cities you would like to visit. Write a Python code to display each city in the tuple on a new line.

Chapter Checkup A Select the correct option. 1 What will be the output of the following code? 1num = 100 print(1num) a 100

b 101

2 Which of the following data types in Python is mutable? a String

b Integer

3 Which of the following is a valid variable name? a Hello_Name

b %Name-Hello

c 1

d Syntax Error

c List

d Tuple

c Hello%Name

d Hello-Name

c x is less than 10

d An error occurs

4 What is the output of the following code? x=5

if x > 10:

print("x is greater than 10") elif x == 10:

print("x is equal to 10") else:

print("x is less than 10") a x is greater than 10

252

b x is equal to 10


B Fill in the blanks with the most suitable words.

1 A ...................... statement is used to specify a code block that executes when none of the preceding conditions in the ‘if’ and ‘elif’ statements are True. 2 In a program, if a loop is executed over and over again without stopping, it is called an ...................... loop. 3 The ...................... method in Python can be used to access specific characters within a string. 4 ...................... means we can assign a variable to a value of any type, and the variable will automatically take on that type. 5 The plus ‘+’ symbol is used to ...................... two strings in Python.

C

State whether the following statements are True or False. Correct the statements that are false. 1 The string slicing function includes the character at the last index. 2 The exponentiation operator has the highest precedence in any expression. 3 T he ‘continue’ statement in Python skips the current iteration of a loop and continues with the next iteration. 4 Strings in Python can be enclosed in triple quotes. 5 The logical operator ‘and’ returns True if at least one of the conditions it combines is True.

D Answer the following questions. (Solved) Q1. Name the types of conditional statements. A1. In Python, we have three types of conditional statements that allow us to make decisions in our programs. These include: • if Statement

• if… else Statement • if… elif… else Ladder Q2. What are the differences between mutable and immutable data types? A2. • Immutable data types are those whose values cannot be changed once declared. Examples: int, float, bool • Mutable data types are those whose values can be changed at any time. Examples: Lists, Dictionaries, Sets Q3. Write the output of the following expressions: i. 54+12 A3. i. 66

ii. 45-17

iii. 3**4

iv. 10%100

v. 175/5

ii. 28

iii. 81

iv. 10

v. 35.0

Q4. Using string slicing, extract the substring "Python" from the string "Learning Python is fun!" and print it. A4. text = "Learning Python is fun!" substring = text[9:15] print(substring) Q5. Write a code to create a tuple T with the given data: 9, ‘Ram’, 7, 5, ‘Hema’ A5. mytuple = (9, ‘Ram’, 7, 5, ‘Hema’ ) print(mytuple)

Chapter 10 • Introduction to Python

253


Q6. What are the characteristics of tuple? A6. The characteristics of tuples are given below: i.

Ordered: In a tuple, the values or items have a defined order, and this order does not change.

ii. Accessed via the Index: The tuple element can be accessed via the index. It means that the tuple index always starts with 0. Hence, the first element of a tuple is present at index 0, not 1. iii. Immutable: The tuple items are immutable. The meaning of immutable is "unable to be changed". It means that we cannot add, modify, or remove items in a tuple after it has been created. iv. Allows Duplicate Values: A tuple can contain duplicate values. Since values are indexed in a tuple, it can have items with the same value and a different index. Q7. What are jump statements? Name the types of jump statements in Python. A7. Loops run the same set of code for a defined number of times or until the test condition becomes False. However, sometimes we might wish to stop the loop even before the test condition becomes False or skip an iteration. Jump statements allow you to skip code or terminate a loop. We have two jump statements in Python: break statement and continue statement. Q8. What is the output of the following code? list = [1, 2, 6, 5, 8, 5, 1] list.pop(2) print(list) A8. [1, 2, 5, 8, 5, 1]

AI Activities 1 Visit the link: https://colab.research.google.com/ to write Python programs in Colaboratory, often referred to as Google Colab. It is a free, cloud-based Jupyter notebook environment that allows you to write and execute Python code in your browser. 2 Visit the link https://www.youtube.com/watch?v=woVJ4N5nl_s to know the Python basics.

Answer Key A

1. d

B

1. else

C

1. False. The string slicing function does not include the character at the last index.

2. c 2. infinite

3. a

4. c 3. indexing

4. Dynamic typing

5. Concatenate

2. False. The parentheses has the highest precedence in any expression. 3. True.

4. True.

5. False. The logical operator ‘and’ returns True if both the conditions it combines are True.

254


Unit 3 • Advance Python (To be assessed through Practicals)

11 Python Basics A

library is a collection of books or a place where books are stored and preserved for future use. Similarly, a Python library is a set of modules. The Python standard library includes over 200 essential modules. It is really useful. Without it, programmers would be unable to use Python’s features.

Python Built in Functions

Python’s built-in functions are predefined functions that help you perform common operations on text and numbers easily. Python includes various built-in functions that can be accessed without the need to import any other modules. Here are some of the most frequently used built-in functions: Function

Description

abs()

Returns the absolute value of a number

bin()

Returns the binary version of a number

input()

Allows user input

max()

Returns the largest item in an iterable

min()

Returns the smallest item in an iterable

next()

Returns the next item in an iterable

print()

Displays the result on the screen

len()

Returns the length of an object

list()

Returns a list

type()

Returns the type of an object

pow()

Returns the value of x to the power of y

round()

Rounds a number to a specified number of decimal places.

255


Example 1. Calculate the absolute value of a number:

Example 2. Calculate the binary value of 10:

Note: The result will always have the prefix ‘0b’. Example 3: Request and print the student’s class.

Example 4: Display the data type of x.

Example 5: Calculate the value of 5 to the power of 4.

Example 6: Round a given number to only three decimals.

Python Libraries and Packages

A Python library is a set of modules. Modules that are linked to one another are often placed in the same package. When a module from another package is required in a program, the package can be imported and its modules used. To use a package in Python, we must first install it. Installing packages in Python is simple. To install a package, follow these steps: 1. To activate your workspace, open Anaconda Navigator. 2. Suppose we want to install the pandas package. To install pandas just write: conda install pandas

256


3. I f we want to proceed with the installation, it will ask to type ‘Y’. When we type ‘Y’, the installation process begins, and our package is installed in the specified environment. 4. We can also install multiple packages at once by specifying them all in a single line. or example, suppose we want to install the pandas, numpy, and matplotlib packages in our working F environment. For this, just write: conda install numpy pandas matplotlib In our environment, this code will install all three of these packages. After the packages are installed, we can import them into the necessary file to begin utilising them. The following are some of the easily accessible packages: Numpy: The term “NumPy” is an abbreviation for “Numerical Python”. NumPy is a commonly used package for working with numbers. It provides support for arrays and matrices, along with a collection of mathematical functions to operate on them efficiently. It has built-in mathematical tools that make calculations easy. NumPy is usually imported under the np alias.

Remember In Python, alias are an alternate name for referring to the same thing.

Syntax: import numpy as np Example: Create a numpy array

OpenCV: OpenCV stands for Open Source Computer Vision Library. It plays an essential role in realtime operation, which are important in modern systems. It allows you to process photos and videos in order to recognise objects, people, or even human handwriting. OpenCV supports several different programming languages, including Python, C++, and Java. Syntax: cv2.imshow(window_name, image) Example: Write a program to read and display an image.

Chapter 11 • Python Basics

257


Here, cv2.imread(“bird.jpg”) is used to read an image file and loads it into the variable “img”. cv2.imshow(“bird”, img) is used to display the image in a new window. Here, “bird” is the window name. It will appear as the title of the window displaying the image. cv2.waitKey(0) ensures that the image window remains open until you press a key, making it useful when displaying images. NLTK: NLTK stands for Natural Language Tool Kit. This toolkit allows for sentiment analysis of a given text, which is useful for applications like social media monitoring and product review analysis. NLP (Natural Language Processing) enables computers to understand, communicate, and respond to human language, effectively performing tasks that typically require human interaction. Pandas: It was created by Wes McKinney in 2008. It makes data processing, data manipulation, and data cleaning easier. Pandas is well suited for: • • • •

Tabular data with heterogeneously-typed columns, as in an SQL table or Excel spreadsheet. Ordered and unordered time series data.

Arbitrary matrix data (homogeneously typed or heterogeneous) with row and column labels. Any other form of statistical data sets.

Pandas can perform tasks like sorting, re-indexing, iteration, concatenation, data conversion, aggregation, etc. The Pandas package is usually imported under the alias pd. Syntax: import pandas as pd Here are some of the key modules in pandas: •

Series: It works like a column in a table. It is used to hold a one-dimensional array of any type.

Syntax: import pandas as pd series = pd.Series(data) •

DataFrame: It is a fundamental data structure in pandas. It represents a two-dimensional and tabular data structure with labelled axes (rows and columns). DataFrames are commonly used for data analysis and manipulation.

Syntax: import pandas as pd df = pd.DataFrame(data) Pandas also provide functions and classes for reading and writing data to various file formats, including CSV, Excel, SQL databases, and more. Syntax: import pandas as pd df = pd.read_csv(‘file_name.csv’)

258


Example 1: Create a simple pandas Series from a list=[2.7, 3.6, 7.1, 9]

Example 2: Create a DataFrame that contains information about three individuals, including their names, ages, and cities of residence. The DataFrame should have the following columns: Name: Alice, Bob, and Charlie Age: 25, 30, and 35 City: New York, Los Angeles, and Chicago

Here, ‘.T’ transposes the DataFrame so that the lists are treated as columns instead of rows. Example 3: Read the CSV file saved in your system and display the first 10 rows of the CSV file.

Chapter 11 • Python Basics

259


Here pd.read_csv(‘data.csv’) is used to read the CSV file into a DataFrame object (df), and df.head(10) is used to display the first 10 rows of the CSV file. Note that you need to upload the CSV file in the same folder as your Jupyter Notebook. Example 4:

Read the csv file saved in your system and display its information.

Here, df.info() is used to show information about the dataset like the number of entries, columns, data types, and non-null counts. Matplotlib: Matplotlib was created by John D. Hunter. It is a popular Python library for creating static, animated, or interactive visualisations. It is capable of generating visually detailed representations such as pie charts, histograms, scatter plots, bar graphs, etc. To use this package, we need to import it in the script. Syntax:

import matplotlib

Here are some of the key modules in Matplotlib: • • • •

Figure

Pyplot

Line2D Patch

Example 1: Draw a line.

260


Example 2: Write a Python program to create a bar graph showing the number of fruits sold. The data is as follows: Apples: 5 Bananas: 10 Oranges: 15

Number of Fruits Solid 14

Number Sold

12 10 8 6 4 2 0

Apples

Bananas

Oranges

Fruits

Remember df.head() is used to display the first 5 rows of the CSV file by default. df.tail() is used to display the last 5

Did You Know? OpenCV was originally developed by Intel.

rows of the CSV file by default.

ActivityTime Time Activity Activity 1: Display the first 10 rows and the last 10 rows. (Group activity) Form groups of 3 students. Create a csv file and load this file in Jupyter Notebook. Write a program in Python that reads the saved csv file and displays its first 10 rows and last 10 rows. Activity 2: Draw a line.

(Individual work)

Create a Python program to draw a line for given x coordinates [0, 1, 2] and y = x + 2.

Chapter 11 • Python Basics

261


Chapter Checkup A Select the correct option.

1 Which of the following is a built-in function in Python? a seed()

b sqrt()

c factorial()

d print()

c np alias

d None of these

b 120.88

c 240

d 120.87

b Intel

c Wes McKinney

d IBM

2 Numpy is usually imported under the a pd alias

b cv2

3 What will be the output of the given code? x = round(120.876,2) print(x) a 120 4 Matplotlib was created by a John D. Hunter

B Fill in the blanks with the most suitable words. 1 ...................... has built-in mathematical tools that make it easy to do calculations. 2 The ...................... function returns the type of an object. 3 NLTK stands for ....................... 4 The len() function returns the ...................... of an object. C

State whether the following is True or False. Correct the statements that are False. 1 OpenCV allows to process photos and videos in order to recognise items, people, or even human handwriting. 2 Pyplot and Line2D are the key modules in Matplotlib. 3 The Pandas package is usually imported under the np alias. 4 To use a package in Python, we must first install it.

D Answer the following questions. (Solved)

Q1. What are built-in functions in Python? Explain any five functions.

A1. Python’s built-in functions are predefined functions that help you perform common operations on text and numbers easily. Python includes various built-in functions that may be accessed without the need to import any other modules. Here are five built-in functions: Function

Description

abs()

Returns the absolute value of a number

bin()

Returns the binary version of a number

input()

Allows user input

max()

Returns the largest item in an iterable

min()

Returns the smallest item in an iterable

Q2. Explain matplotlib in Python with example.

A2. Matplotlib was created by John D. Hunter. It is a popular Python library for creating static, animated, and interactive visualisations. It is capable of generating visually detailed representations such as pie charts, histograms, scatter plots, bar graphs, etc. To use a package, we need to import it in the script.

262


Syntax: import matplotlib For example:

Number Solid

12 11 10 9 8 7 6 2.00

2.25

2.50

2.75

3.00

3.25

3.50

3.75

4.00

Q3. Write a code in Python that counts the number of items in a list and also returns the type of these objects. A3.

Q4. Explain OpenCV.

A4. OpenCV stands for Open Source Computer Vision Library. It allows you to process photos and videos in order to recognise objects, people, or even human handwriting. OpenCV supports several different programming languages, including Python, C++, and Java.

AI Activities 1 Visit the link: https://www.w3schools.com/python/python_ref_functions.asp and explore more built-in functions in Python.

2 Visit the link: https://www.javatpoint.com/opencv-read-and-save-image to know more about OpenCV library in Python. 3 Visit the link: http://bit.ly/data_notebook and start exploring the Jupyter Notebook of basic statistics in Python.

Answer Key A

1. d

B

1. Numpy

C

1. True

2. c

3. b 2. type()

4. a 3. Natural Language Tool Kit

4. length

2. True

3. False. The pandas package is usually imported under the alias pd.

4. True

Chapter 11 • Python Basics

263


Unit Reflection

Key Terms • Kernels: Kernels are programs that execute interactive code written in a certain programming language and provide the user with output. A Jupyter Notebook’s code is run by computational engines called kernels. • Syntax: Syntax errors are mistakes that happen when we do not write our code correctly, such as using incorrect function names or missing quotes and brackets. • Variable: A variable is a reference name given to a location in the computer’s memory. Variables can be used to store numbers, strings, lists, and other data types. • Dynamic typing: It is a feature of Python where the data type of a variable is not determined until runtime. • Iteration: Loops allow us to execute a set of instructions as long as a certain condition is true. Once that condition becomes false, the loop stops. This process is also known as iteration. • Lists: Lists is a collection of various kinds of values. It can hold multiple values in a single variable. • Tuple: A tuple is an ordered, immutable collection of things or values.

Things to Remember • The simplest method to install and use Jupyter Notebook is by using the software Anaconda. Anaconda is a free and open-source environment for writing and executing Python programs. • The Jupyter Notebook is an extremely effective tool for building and presenting AI projects interactively. • Jupyter Notebook is widely used in a variety of applications such as data cleansing and transformation, numerical simulation, statistical modelling, data visualisation, machine learning, etc. • Jupyter Notebook is a Graphical User Interface (GUI), which implies that the Notebook interface provides a wide range of easily accessible tools for simplifying work, many of which are just a click away. • Data types define the type of data that a variable can store. • Immutable data types are those whose values cannot be changed once declared. • Mutable data types are those whose values can be changed at any time. • Typecasting is the conversion of the data type of a value into another data type. • The indexing method in Python can be used to access specific characters within a string. • Python provides mainly two types of loops, the ‘while’ loop and the ‘for’ loop. • Jump statements allow you to skip code or terminate a loop. Python has two jump statements: the break statement and the continue statement. • In a program, if a loop is executed repeatedly without stopping, it is called an ‘infinite’ loop. • Python’s built-in functions are predefined functions that help you perform common operations on text and numbers easily.

264


• A Python library is a set of modules. Modules that are linked to one another are often placed in the same package. When a module from another package is required in a program, the package can be imported and its modules used. • NumPy is a commonly used package for working with numbers. It provides support for arrays and matrices, along with a collection of mathematical functions to operate on them efficiently. • OpenCV allows you to process photos and videos to recognise objects, people, or even human handwriting. • NLTK is a toolkit that allows for sentiment analysis of a given text, which is useful for applications like social media monitoring and product review analysis. • Pandas can perform tasks like sorting, re-indexing, iteration, concatenation, data conversion, aggregation, etc. • Matplotlib is a popular Python library for creating static, animated, or interactive visualisations. • Tuples are sequences, just like lists, but they cannot be modified, unlike lists. Lists use square brackets, while tuples use parentheses () to enclose the elements. Tuples are faster than lists. • Replication of strings means to repeat a certain string a specified number of times. The replication operation can be performed with the help of the asterisk symbol '*', which is known as the replication operator. • Python follows the PEDMAS rule, which stands for: Parentheses (P), Exponents (E), Division (D), Multiplication (M), Addition (A), and Subtraction (S). • Control statements in Python are used to control the flow of execution of the program. They allow you to make decisions, repeat code, and skip code. • There are three main types of control statements in Python: Conditional Statements, Loops, and Jump Statements.

Unit Reflection

265


Test Your Knowledge A. Select the correct option. 1. Which of the following is not a typical application of Jupyter Notebook? a. Data cleansing and transformation

b. Numerical simulation

c. Web development

d. Data visualisation

2. Which method adds a single element to the end of a list? a. extend()

b. insert()

c. append()

d. remove()

3. Which of the following statements is true about Jupyter Notebook? a. Anaconda is a web-based tool for installing Jupyter Notebook. b. Anaconda is a command-line interface (CLI) tool for installing Jupyter Notebook. c. Anaconda can only be used from a web browser to install Jupyter Notebook. d. Anaconda is used to write Jupyter Notebooks, not install them. 4. How do you access the last character of a string using negative indexing? a. string[-0]

b. string[-1]

c. string[-2]

d. string[-3]

5. List L is given below: L = [0, 1, 2, 3, 4] Choose the correct answer to delete the element 3 from the list. a. L.delete(3)

b. L.remove(3)

c. del L[2]

d. L.pop(3)

B. Fill in the blanks with the most suitable words. 1. Tuples are

than lists.

2. The continue keyword is used to 3. In Python,

the current iteration in a loop.

defines a block of statements.

4. Strings in Python are immutable, which means they cannot be 5. The

attribute of the sort() method is used to reverse the order of the list.

C. State True or False. Correct the statements that are False. 1. The list allows duplicate values. 2. The replace() function can modify a string directly. 3. The eval() function can execute a string expression and return its result. 4. Lists cannot store different types of elements. 5. You can access a tuple entry using indexing.

266

once they have been created.


D. Short-answer type questions. 1. How can you use the slicing operator to extract a substring in Python? 2. What is Anaconda? 3. What is a dataframe? 4. What will be the output of the given code? tuple = (1, 8, 7, 5, 4, 8, 5) x = tuple.count(5) print(x)

E. Long-answer type questions. 1. Write a Python program to replace the word “fun” with “awesome” in the string “Learning Python is fun!” and print the result. 2. What is NumPy used for in Python? 3. Write the differences between list and tuple. 4. Differentiate between pop() and remove() with a suitable example.

F. Competency-based questions. 1. Add a student’s name, “Sushma”, at the end of the given list: Stu_list = ['Lata', 'Rama', 'Ankit', 'Vishal'] 2. Write a Python program that concatenates two strings, “Hello” and “World”, and prints the result. 3. Find the error in the following program: num1 = input("Enter first number: ") num2 = input("Enter second number: ") result = num1 + num2 print("The sum is:", result) 4. Write the output of the following program: squares = [] for i in range(1, 6): squares.append(i * i) print('The squares are:', squares)

Unit Reflection

267


Unit 4 • Data Sciences

12 Introduction to Data Science

I

magine you have a huge collection of jigsaw puzzle pieces. Each piece contains a part of a picture on it, but you can’t see the entire picture until you fit all the pieces together. Just like gathering puzzle pieces, data science involves collecting lots of different pieces of information, figuring out how they fit together, and using them to understand the complete picture or make decisions.

Introduction

Artificial Intelligence (AI) depends on data for its effectiveness. The quality and type of data fed into AI systems determine how smart they become. We can categorise the three main domains of AI based on the type of data they use: DATA

Data Science

•

Data is foundational to data science.

•

Works with numeric and alpha-numeric data CV

Computer Vision

Works with image and visual data. NLP

Natural Language Processing

Works with textual and audio/speech based data.

Data Science

Every domain of AI uses a specific type of data that acts as input to the machine and requires a specific method to handle and utilise it. Similarly, data science focuses on extracting insights from diverse datasets, and applying various analytical techniques to interpret and manage this data effectively.

Activity Rock, Paper, Scissors

Let us perform the following experiment to understand how the domain of AI, data, acts as an input to the machine and how the machine interprets and learns from this data. ‘Rock, Paper, Scissors’ is an interactive game based on data for AI where the machine tries to predict the next move of the participant. It is a digital translation of the basic rock, paper, and scissors game where the machine tries to win by learning from the participant’s previous moves.

268


Objective: The objective of this interactive AI-based game is for students to build their understanding of the AI domain, particularly focusing on how AI can analyse data to make predictions. Follow the given steps to explore how this application works. 1. Visit the given link: https://next.rockpaperscissors.ai/ 2. The following window appears.

3. Make a paper (palm), scissors (index and big fingers), and rock (fist) in front of the camera, as shown.

4. Now, start playing the AI game. Make your moves (rock, paper, or scissors) and see how the machine reacts if you

make moves in a specific order or randomly.

What is Data Science?

Data science has become an essential field in today’s data-driven world. The increasing volume, velocity, and variety of data generated by various sources necessitate some methods and tools for data processing, analysis, and interpretation. Data science is the domain of computer science where we extract insights from available data with the help of scientific methods, algorithms, and statistics. Data science combines concepts and methods from statistics, mathematics, data analysis, machine learning, and computer science to extract valuable insights from large amounts of data collected over time. It helps study vast arrays of structured and unstructured data and their conversion into a format which can be easily interpreted by humans.

Chapter 12 • Introduction to Data Science

269


In simple terms, data science is the study of data. It involves: •

Collecting the data

•

Analysing the data

•

Using data to solve problems or make data-driven decisions

The problem can be anything from predicting the weather, recommending films on Netflix, finding the fastest route home or even understanding trends on social media. So, data science encompasses various disciplines that focus on data analysis and finding the best possible solution.

Let us take a simple example: Suppose your school wants to find out which sports games students like the most. Here are the steps they could follow. Collect Data: The school distribute a survey to every student, asking about their favourite sports games.

Remember Data science and data analytics are closely related fields,

Analyse Data: After collecting responses, they examine the survey results to identify the most popular sports games.

but they serve different purposes. Data science is a broader term that consists of various techniques and methods, including data analytics, to extract valuable insights from

Make Data-Driven Decisions: With this information, the school can decide which sports games to organise more frequently.

large sets of data. Data analytics specifically focuses on analysing past data to gather insights and inform decisionmaking, while data science covers the entire process of data handling, from collection to advanced analysis.

This process ensures that decisions are based on data, leading to better outcomes that align with students’ preferences.

Components of Data Science

There are different components of data science, which include: working with statistics and analytical methods

visualisation of data

machine learning

deep learning Statistics

Visualisation

The science of collecting and analysing numerical data in large quantities in order to gain helpful insights.

A tool used to interpret large amounts of data easily through visual representations.

Machine Learning

Components of Data Science

The study and development of algorithms that enable machines to make predictions or decisions based on data.

270

Deep Learninng

A subset of machine learning focused on algorithms that automatically learn and determine the best models for data analysis and prediction.


Why is Data Science Important?

Data science is everywhere in our daily lives. Here are a few reasons why it is important: 1. Making Informed Decisions: Whether it is a business deciding which products to sell, a doctor determining

the best treatment for a patient, or a school planning a new curriculum, data plays a crucial role. It helps people make smart, evidence-based decisions.

2. Solving Problems: Data science helps us find solutions to complex problems. For example, by analysing weather

data, scientists can predict hurricanes and help people prepare for them.

3. Creating New Opportunities: Companies like Google, Amazon, and Facebook use data science to develop new

technologies and services that make enhance our lives, making things easier and more enjoyable.

Error Alert! Data quality issues, such as incomplete, inconsistent, or inaccurate data, can result in unreliable results and poor decision-making. Also, handling sensitive information requires strict measures to prevent breaches and follow rules and regulations.

Did You Know? In data science, various data formats, such as CSV (Comma-Separated Values), JSON (JavaScript Object Notation), Excel (XLSX) , XML (Extensible Markup Language), SQL (Structured Query Language), are used to represent and store different types of data.

Activity Time (Group Work)

Activity 1: Group Discussion

Form groups of 4 or 5 students and discuss the “Role of Data Science in Environmental Sustainability”. Encourage each group to share real-life examples of sustainable solutions that can be developed using data science.

(Individual Work)

Activity 2: Research work

Encourage students to investigate the skills and knowledge needed to pursue a career in data science, such as a data

scientist, data analyst, data engineer, statistician, etc. Identify learning opportunities to develop the skills required for these career roles. Share your research using a presentation with classmates for feedback and suggestions.

Chapter Checkup A Select the correct option. 1 What is data science?

a The study of data visualisation c The study of analysing past data

b The study of extracting valuable insights from available data d The study of sources of data

2 Which of the following is not a component of data science? a Statistics

b Visualisation

3 NLP stands for _____________.

a Node Language Protocol c Network Label Process

Chapter 12 • Introduction to Data Science

c Computer Vision

d Deep learning

b New Loaded Program

d Natural Language Processing

271


B Fill in the blanks with the most suitable words. 1 ...................... is the study and development of algorithms that enable machines to make predictions or decisions based on data. 2

...................... depends on data for its effectiveness.

3 ...................... is foundational to data science. 4 ...................... tool is used to easily interpret large amounts of data through visual representations. C

State whether the following statements are True or False. Correct the statements that are false. 1 Data science is a multidisciplinary field that combines concepts and methods from statistics, mathematics, data analysis, and machine learning. 2 Data analytics includes data science. 3 Machine learning is a subset of deep learning. 4 Computer vision works with image and visual data.

D Answer the following questions. (Solved) Q1. Define data science. A1. Data science is the domain of computer science where we extract insights from available data with the help of scientific methods, algorithms, and statistics. Q2. Discuss the components of data science. A2. The different components of data science are: i.

Statistics: Science of collecting and analysing numerical data in large quantities in order to gain helpful insights.

ii. Visualisation: A tool used to easily interpret large amounts of data through visual representations. iii. Machine learning: The study and development of algorithms that enable machines to make predictions or decisions based on data. iv. Deep learning: A subset of machine learning focused on algorithms that automatically learn and determine the best models for data analysis and prediction. Q3. Sagar is developing a security system to identify and track individuals using image and visual data from surveillance cameras. Which domain of AI is he using? A3. Computer Vision

AI Activities 1 V isit the following link: https://research.google.com/semantris/ to play an interactive word association game based on NLP for AI.

Answer Key A

1. b

B

1. Machine learning

C

1. True

2. c

3. d

4. b

2. Artificial Intelligence (AI)

4. Visualisation

2. F alse. Data science is a broader term that consists of various techniques and methods, including data analytics. 3. False. Deep learning is a subset of machine learning. 4. True.

272

3. Data


Unit 4 • Data Sciences

13 Applications of Data Science

A

s we have learnt in the previous chapter, data science is the study of data to extract meaningful patterns and trends, which can help us make better decisions. Data science is used in many fields and impacts our daily lives in various ways. In this chapter, you will learn about the applications of data science.

Data Science in Education

Data science plays an important role in education. It enables personalised learning for students, which improves student outcomes. In the education sector, the data science uses different types of data for personalised learning, such as student performance data like test scores and assignment grades, behavioural data like time spent on tasks and learning habits, and demographic data like age, gender, and background. Additionally, data science algorithms use feedback from students and teachers to enhance personalised learning experience. Data science is also used in other aspects of education, such as designing curriculum based on student performance and optimising administrative tasks. For example, identifying students struggling in certain subjects can inform school administration to hire additional tutors, get more learning resources, etc.

Data Science in Healthcare

Data science plays an important role in the healthcare sector. Data science algorithms analyse medical images to detect symptoms of diseases with high accuracy, helping doctors diagnose their patients in the early stages of a disease. It uses patient data, such as their medical history, to predict which patients are at risk of developing chronic diseases. It also recommends preventive measures for these diseases. It helps analyse real-time health data collected through wearable devices to monitor conditions like heart disease. Data science also optimises hospital operations by predicting patient admissions, managing resources better, and reducing wait times. This helps improve overall healthcare services for patients.

273


Data Science in Entertainment

Data science makes the entertainment sector more personalised by analysing data to understand what people like or dislike. For example, streaming services like Netflix use data on what films or shows you watch to recommend new films and shows you might enjoy. Music apps like Spotify create personalised playlists by analysing what you listen to more frequently. Video games also use data science to tailor game experiences to your preferences.

Data Science in Sports

Data science has transformed the sports industry by enhancing performance analysis, strategy development, and fan engagement for players. Data science helps study players’ performances in terms of various parameters, like speed and technique, to optimise training and game strategies. For example, data on batting patterns and defensive moves in cricket helps coaches develop better game plans. Smart wearable devices help to track athletes’ health and fitness data in real time to personalise training needs and prevent injuries. Data science helps recruit talented players by analysing their past performance. Data science enhances fans’ experiences by delivering personalised content and predicting ticket prices ahead of sports events. Personalised content includes replays and breaking news about fans’ favourite teams and players, tailored based on their preferred sports, teams, and players.

Data Science in Internet Searches

Data science has significantly enhanced the speed and relevance of our internet searches. Search engines, like Google, Bing, Yahoo, etc., use different machine learning techniques to analyse large amount of web data and then rank these search results based on relevance to the user’s query and the credibility of a web page. For example, when you write a query in a search engine, data science helps by offering autocomplete suggestions, correct spellings, and predicts relevant content. These search results are based on past searches, ensuring you find what you seek more efficiently.

Search...

Did You Know? Considering the fact that Google processes more than 20 petabytes of data every day, had there been no data science, Google wouldn’t have been the ‘Google’ we know today.

Data Science in Environment Protection

Data science helps analyse extensive environmental data to understand patterns, make predictions, and policy decisions. For example, data scientists use satellite images and sensor data to monitor deforestation, detect illegal fishing activities, and track wildlife populations. Climate scientists analyse historical weather data to predict climate change impacts and help policymakers plan to decrease its effects. The air quality data collected from sensors helps to identify pollution sources and develop strategies to improve air quality. Data science helps optimise resource management by predicting water demand and managing renewable energy sources like wind and solar power, contributing to more sustainable environmental practices.

274


Data Science in Retail

Data science plays an important role in helping stores understand customer preferences and how to improve their shopping experience. For example, When you shop online, have you noticed how websites suggest other items might like? It is possible through data science. The website uses data science analyse what you have bought before and suggest similar things. Data science helps stores maintain stock so they do not run out of items. It also helps to manage prices based on data on what people are willing to pay.

you to also fix

Data Science in Finance

Data science is used in banks and financial institutions to detect fraud and make smarter money decisions. Banks use data science to analyse transaction patterns or financial data to detect fraud. For example, when using a credit card, data science looks for unusual spending patterns that could indicate fraud. Data science helps predict how much money a company might make in the future based on its past sales data, which helps investors decide whether to invest or not. Data science also helps banks decide whether to lend money or not by analysing a person’s credit history and money-spending habits. This ensures that the bank is lending money to a person who is likely to pay it back.

Data Science in Transport

Data science helps make travel safer, more efficient, and more convenient. For example, when we use a navigation app, like Google Maps, data science helps us calculate the fastest route by analysing traffic data from many drivers. Data science also predicts jams and suggests alternate routes to avoid delays in reaching the destination. Data science helps transport companies optimise their routes and schedules by analysing passenger demand and vehicle availability data. For example, airlines use data science to forecast flight demand and adjust ticket prices accordingly. Data science improves safety by analysing data from vehicle sensors to prevent accidents.

Error Alert! People generally think data science is useful only for analysing big data. But in reality, it is also valuable for providing insights and solutions to problems using small datasets.

Data Science in Social Media

Data science helps to make our experiences more personalised and engaging on social media platforms like Facebook, Instagram, YouTube, etc. For example, when you use Facebook or Instagram, data science analyses your previous likes, comments, and shares to show you new posts from friends and pages you are interested in. Data science helps detect fake social media accounts and harmful content to make social media

Chapter 13 • Applications of Data Science

275


safer. Data science helps social media platforms target advertisements to specific groups of people based on their online activities.

Did You Know?

Remember

Data science is used by social media platforms, like Facebook and Instagram, to tag people automatically in your photos by recognising their faces.

Accurate and relevant data is important to get better results in data science.

ActivityTime Time Activity Activity 1: Analyse sports data to improve team performance

(Individual Activity)

Ask students to collect data on players’ physical attributes, performance metrics, tactical insights, and psychological

factors in addition to scores from their favourite sports. They should use this comprehensive data to identify the strengths and weaknesses of the players, and then propose a game strategy based on their analysis. Activity 2: Analyse local traffic data to suggest improvements

(Group Activity)

Form groups of 2 to 3 students and collect local traffic data near the school. Then, analyse the data to find patterns like the peak time of heavy traffic, the type of vehicles that travel near school, etc. Create presentations for your proposed solutions to improve traffic flow and the safety of school-going students based on data analysis. Activity 3: Predict exam scores

(Group Activity)

Ask a group of 2–3 students to gather data from their classmates on their previous exam scores, as well as their

historical study hours, leisure time, and sleep hours. Instruct students to analyse the relationships between these

factors and exam scores. Based on their analysis, students will discuss strategies to enhance study habits for improved exam performance.

Chapter Checkup A Select the correct option.

1 How does data science contribute to transportation? a Predicting market trends

c Designing new video games

b Optimises travel routes d Sports Analysis

2 Which of the following are the applications of data science in healthcare? a Weather prediction b Film recommendations c Disease diagnosis

d Personalised learning

3 In which industry is data science used to optimise training and game strategy? a Fashion b Sports

c Entertainment d Education

276


B Fill in the blanks with the most suitable words: 1 In education, data sciences enables ............................. learning experiences tailored to individuals’ needs and preferences. 2 Social media uses data sciences to detect ............................. accounts and harmful content. 3 Data sciences help detect fraudulent transactions in banks through the analysis of ............................. data. 4 Environmental agencies use data science to analyse air quality data from ............................. to identify sources of pollution. C

State whether the following statements are True or False. Correct the statements that are false.

1 Data science enables personalised recommendations on streaming platforms like Netflix by analysing users’ past viewing history. 2 Data science is incapable of helping banks decide whether to lend money or not. 3 Data science is used in healthcare to predict diseases and improve diagnostics. 4 Data science is used in sports to develop game strategies and enhance players’ performance.

D Answer the following questions. (Solved)

Q1. Name any three industries where data science is used.

A1. Entertainment, Transport, and Education

Q2. How does data science help conserve the environment? A2. Data science makes use of satellite images and sensor data to monitor deforestation, detect illegal fishing activities, and track wildlife populations. Climate scientists analyse historical weather data to predict climate change impacts. The air quality data collected from sensors helps to identify pollution sources and develop strategies to improve air quality. Data science help predict water demand and manage renewable energy sources like wind and solar power, contributing to more sustainable environmental practices.

Q3. Imagine you are the owner of a new social media app called BuddyChat. Your app allows users to post updates, share photos, and comment on others’ posts. You want to ensure your users have the best experience possible and stay safe while using your app. Explain how data science can help you achieve this. A3. Data science can help show each user the most interesting posts and updates on their feed. It can also help recognise harmful content, such as offensive language, and flag such content for removal from the app. Data science can help develop strategies for increasing user engagement, such as sending personalised notifications and suggesting new friends and groups.

AI Activities 1 Visit this link: https://www.youtube.com/watch?v=1n7iJ5CdX3U to explore more about the applications of data science. 2 Visit this link: https://climatekids.nasa.gov/ to learn how NASA provides scientific data to help us understand climate change. 3 Visit this link: https://github.com/academic/awesome-datascience to learn more about data science.

Answer Key A

1. b

B

1. a. personalised

C

1. a. True

2. c

3. b b. fake

c. financial

d. sensors

b. False. Data science helps banks decide whether to lend money or not. c. True

d. True

Chapter 13 • Applications of Data Science

277


Unit 4 • Data Sciences

14 Revisiting AI Project Cycle, Data Collection, Data Access D

ata science is a field that brings together different skills and ideas. It combines math, statistics, probability, data analysis, and computer programming to understand and work with data.

When you develop a data science project, you will use a computer program and many different concepts to create a project model. Let’s review the phases of the AI Project Cycle in the context of data science. Problem Scoping

Data Exploration

Data Acquisition

Evaluation

Modelling

1. Problem Scoping Understanding and identifying a problem and having some ideas and vision to find a solution to the problem. 2. Data Acquisition Acquisition denotes the process of gathering or obtaining the data from identified sources. 3. Data Exploration It is the stage where we can analyse the data and visualise it in a user-friendly format, so that we can understand it better. 4. Modelling AI modelling refers to developing AI models for getting intelligent outputs after training the model.

278


5. Evaluation In this phase of the AI project cycle, you test the model in many ways to check for accuracy. This stage of testing the models is known as Evaluation. Once the model is performing accurately, it is then deployed to the production environment, where it can start solving real-world problems.

Sample Data Science Problem

Let us now apply the concepts from the AI project cycle to a sample data science project.

The Scenario

Raju has always had a passion for reading and, after graduating from college, decided to pursue his dream of opening a bookstore. He wanted to offer something unique compared to the big chain stores, so he chose to set up a small, cozy bookstore near schools, colleges, and bustling markets where many young people spend their time. Although Raju’s store attracted a good number of visitors, he quickly encountered a significant challenge: deciding which types of books, genres, and price ranges to stock. The issues he faced included: •

Some customers requested specific books that were out of stock.

•

At times, customers couldn’t find anything appealing among the available selections in the store.

•

Certain books sat on the shelves for months without being sold.

These challenges led to customers frequently leaving the store empty-handed, which negatively impacted Raju’s sales and caused him to lose customers over time. The problem Raju needs to solve is that: What mixture of book genres, titles, and price ranges should I keep in my bookstore so that customers can find the books they want and the stock of books sells quickly? In Raju’s case, the main challenge is to choose the right mix of books to meet customer needs while ensuring that the stock moves quickly. Let’s understand this problem and find a solution step-by-step.

Problem Scoping

Let’s use the 4Ws problem canvas to thoroughly understand and define Raju’s bookstore problem. 4Ws Problem Canvas Who Who is affected by the problem? • •

The bookstore owner, Raju Customers

•

Book supplies and publishers

What is the nature of the problem?

•

Deciding which book genres, titles, and price ranges to keep in the bookstore to meet

What are the evidences of the problem?

•

Customers leave the store without buying because they can’t find what they want.

What are the potential impacts?

•

Loss of sales and customers, leading to financial losses

What

• •

the customers’ requirements and ensure quick sales.

Decreased customer loyalty and satisfaction Wasted shelf space

Chapter 14 • Revisiting AI Project Cycle, Data Collection, Data Access

279


Where Where is the problem occurring?

•

In Raju’s bookstore, which is located near schools, colleges, and busy markets.

Why Why is this problem happening? • • Why is it important to solve this problem?

Raju doesn’t understand what customers are looking for.

The books in the store don’t match what customers want.

•

The store isn’t managing its stock of books well.

•

To increase sales and make customers happy.

• • •

To utilise the space of the shelf. To gain profit from good sales.

To stay competitive with the other bookstores.

By understanding this problem using the 4Ws, Raju can focus on collecting relevant data, analysing it, and developing strategies that meet customer preferences. Problem Statement Template Now that we have noted down all the factors around our problem, let us fill up the problem statement template. The

Book Store Owner

Who

Has a problem that

some customers do not get books as per their choice, and some books go unsold

What

When/During

in Bookstore

Where

An ideal solution would be

to ensure that a Bookstore must have the right mix of books and quantity of books as Why per customer choice and no stock remains unsold for months

Thus, our goal in using data science is: To figure out what customers want and stock the right books to boost sales and make customers happy.

Data Acquisition

After defining the problems and goal, we need to collect the right amount of data to achieve our goal. Here is the sample data we collected for the past five months: 1. Customer Data •

What customers like: Feedback or survey to know which book genres and authors they prefer.

•

Purchase history: Records of what types of books customers bought before.

•

Customer Info: Details of customers like age, gender, and occupation to better understand who the customers are.

2. Sales Data •

Sales Records: Data on which books are selling and which aren’t, including when and how many sold.

•

Inventory Data: Information on current stock, like the books that are high in demand and those that haven’t sold for a long time.

3. Book data •

Book Details: Information about each and every book, like genre, title, author, price, and publication date.

4. Competitor Data •

280

Competitor pricing: Information about what other bookstores are charging for the same books.


5. Market Data •

Industry trends: Data on overall book market trends, including popular and new genres.

By processing this data, Raju can decide which type of books to stock, how to price them, and how to manage inventory to meet customers’ demand and boost sales. Such data can be collected from various means:

Surveys

Web Scraping

Observations

Data Exploration

In Raju’s bookstore project, after collecting data from the past five months, we move to the data exploration step. Here’s how we will approach it: 1. Inspecting and cleaning the Data: •

First, we will look at the data we collected to make sure that everything is complete and correct. We will remove any mistakes or redundant values from the collected data. This will make our analysis more efficient.

2. Data Analysis and Visualisation: •

Next, we will study the cleaned data to find insights and trends. For example, we might graph sales of books, determine which book genres sell best, or analyse what types of books different age groups like.

Here, the following graph shows the number of books sold every month. This information will be analysed to know about the decline or rise of sales.

Modelling

To predict future book demand using past data, historical data is fed to a developed AI model. Modelling requires data preprocessing, after which the data is fed into the machine. Here’s how we will use our data: 1. Types of Data: •

Data includes continuous data (like sales numbers).

•

Data is labelled (we know the outcomes, such as which books were sold).

Chapter 14 • Revisiting AI Project Cycle, Data Collection, Data Access

281


2. Training the model: •

We will split our data into two parts: { {

Training data: we will use about 80% of the data (4 months of sales) to train the model.

Testing data: the remaining 20% of the data (1 month of sales) will be used to test the model.

This approach ensures that the model learns from past sales to predict future demands accurately.

Evaluation

To help Raju predict which books will be popular in the future, evaluation of the model will be performed for accuracy, precision, recall, and F1 score. The model learns from the past sales data to understand relationships between the different data features or parameters, like sale numbers and book genres. 1. Evaluating the model •

After training, test the model with the new data.

•

Input the new data and see if the model’s prediction matches the actual sales number.

•

This will help to check if the model is accurate and efficient.

2. Visualising the results •

We can plot the predicted sales against the actual sales. If the predicted points are close to the actual points, the model is doing amazing.

For example, we can create a graph that compares the predicted and actual sales for different book genres. For example, in the figure below, the predicted points and actual points are very close to each other, this implies that the model is performing good.

If the model’s predictions aren’t accurate, we can improve the model by training it with more data until it gives us better results. This process ensures Raju can confidently stock the right books to meet the customers’ demand.

282


In the figures above, the blue line shows actual values, and the dots show the predicted values. Figure 1: The model’s predicted values do not match the actual values at all. Hence, the model is said to be underfitting as its accuracy is lower. Figure 2: In the second one, the model’s predicted values match well with the actual values. This means that the model is performing accurately, and the model is called a perfect fit. Figure 3: In the third case, model performance is trying to cover all the input data samples even if they are out of alignment with the actual values. In this case, the model is said to be overfitting and has a low accuracy.

Did You Know? Overfitting and underfitting can be humorously illustrated using a common analogy with “Goldilocks and the Three Bears.” Overfitting: This is like Goldilocks finding a bed that is too soft. Underfitting: This is like Goldilocks finding a bed that is too hard.

ActivityTime Time Activity Activity: Exploring Data Collection Methods

(Group Work)

Divide students into small groups and ask them to brainstorm different sources of data. Encourage them to think of examples for both offline and online data collection.

Offline Sources: Examples may include surveys, printed reports, interviews, physical sensors, etc. Online Sources: Examples may include websites, social media, online surveys, APIs, etc. Also encourage students to discuss advantages and disadvantages of collecting data offline versus online.

Chapter Checkup A Select the correct option. 1 Which of the following is the first step in the AI Project Cycle? a Data Acquisition

b Problem Scoping

c Data Exploration

d Deployment

2 In the context of data science, what does ‘Data Acquisition’ refer to? a Cleaning the data

b Collecting data for the project

c Developing AI algorithms

d Evaluating the model

3 What is the purpose of the Evaluation phase in the AI Project Cycle? a Acquiring data for the project

b Visualising the data

c Testing the model for accuracy

d Deploying the model in the real world

B Fill in the blanks with the most suitable words. 1 ...................... refers to developing AI models for getting intelligent outputs after training the model. 2 ...................... is the phase where we test the model’s accuracy before deploying it. 3 ...................... is a field that combines math, statistics, probability, data analysis, and computer programming to understand and work with data. 4 A model whose predicted values match well with the actual values is called a ...................... fit.

Chapter 14 • Revisiting AI Project Cycle, Data Collection, Data Access

283


C

State whether the following statements are True or False. Correct the statements that are false. 1 Deployment is the final step where the model is put into a production environment. 2 Surveys and web scraping are common methods for data acquisition in data science projects. 3 The purpose of the Data Acquisition phase is to develop AI algorithms that can predict future outcomes based on historical data. 4 Market Data refers to the data collected about individual customer preferences and behaviours.

D Answer the following questions. (Solved) Q1. How can it be ensured that an AI model is performing accurately? A1. We can make sure an AI model works well by testing it with new data. We compare what the model predicts with the real outcomes. If the model is not accurate, then we can improve it until it gives better results. Q2. Why is Data Acquisition important in data science projects? A2. Data Acquisition is important because it involves the collection of data needed for the project. This information can help us analyse and build the model. Q3. Name any three data collection methods. A3. Three data collection methods are surveys, observations and web scraping. Q4. What does it mean when a model is said to be underfitting? A4. When a model is said to be underfitting, it means that it has not learned the underlying patterns in the training data well enough, resulting in poor performance. This is often indicated by the model's predicted values not matching the actual values at all. As a consequence, the model's accuracy is low because it fails to capture the complexity of the data. Q5. Ayushi is working on an AI project to predict energy consumption. She has collected a large dataset. Now, she needs to clean and analyse it. In which phase of the AI project cycle is Ayushi now? A5. Ayushi is now in the Data Exploration phase, where she will clean and analyse the data.

AI Activities Visit the link: https://youtu.be/tLaLfaIJf-Y?si=I53jDu09iheZh4g4 to see the difference between training data and testing data.

Answer Key A

1. b

B

1. AI modelling

C

1. True

2. T rue

2. b

3. c 2. Evaluation

3. Data science

4. perfect fit

3. False. The purpose of the AI modelling phase is to develop AI algorithms that can predict future outcomes based on historical data.

4. True

284


Unit 4 • Data Sciences

15 Python for Data Sciences P

ython is a popular programming language with an extensive number of libraries and packages that increase its usefulness for various purposes and widely used by Data Scientists. These packages cover a wide range of domains from web development to data analysis, machine learning, artificial intelligence, scientific computing, and so on.

Python Packages

A Python package is a set of codes or functions or modules. Modules linked to one another are often placed in the same package. When a module from another package is required in a program, the package can be imported and its modules used. In other words, a package is just an area containing codes, functions, or modules of the same kind. Several packages are available for free (one of the benefits of Python’s open-source nature) for various uses. Some of the Python packages are: Numpy: Numpy stands for Numerical Python. Numpy is a commonly used package when it comes to working around numbers. It supports arrays and matrices, along with a collection of mathematical functions to operate on them efficiently. OpenCV: OpenCV is an image processing package that can be used for image manipulation and processing like cropping, resizing, editing, etc. It also allows you to process photos and movies in order to recognise items, people, or even human handwriting. Matplotlib: Matplotlib is capable of generating visually detailed representations through charts such as box plot, histograms, scatter plots, bar graphs, etc. NLTK: NLTK stands for Natural Language Tool Kit. It is a popular Python package for performing Natural Language Processing (NLP). This toolkit helps assess the sentiment of a given text, which is helpful for applications like social media monitoring and product review analysis. Pandas: The name “Pandas” refers to “Panel Data” and “Python Data Analysis”. It is useful for handling two-dimensional data tables. It is used to work with data from Excel sheets and other databases. It makes data processing, data manipulation, and data cleaning easier.

285

Did You Know? Pandas was created by Wes McKinney in 2008.


Package Installation

To utilise a package in Python, we must first install it. Installing packages in Python is simple. To install a package, follow these steps: 1. To activate your workspace, open Anaconda Navigator. 2.

Suppose you want to install the pandas package. To install this package just write:

conda install pandas 3. If we want to proceed with the installation, it will ask us to type Y. When we type Y, the installation process begins, and our package is installed in the environment we have specified. 4. We may also install numerous packages at once by specifying them all in a single line. For example, suppose we want to install the pandas, numpy, and matplotlib packages in our working environment. For this, just write: conda install numpy pandas matplotlib In our environment, this code will install all three of these packages. After the packages are installed, we may import them into the necessary file to begin utilising them.

Working with a Package

To use a package, we must import it into the script where it is needed. In Python, there are several ways to import packages: Syntax

Meaning

import numpy

Import numpy in the file to use its functionalities in the file to which it has been imported.

import numpy as np

Import numpy and refer to it as np wherever it is used.

from numpy import array

Import only one functionality (array) from the whole numpy package. While this gives faster processing, it limits the package’s usability.

from numpy import array as arr

Import only one functionality (array) from the whole numpy package and refer to it as arr wherever it is used.

Numpy

Numpy: The term “Numpy” is an abbreviation for “Numerical Python”. It is a commonly used package when it comes to working around numbers. It provides support for arrays and matrices, along with a collection of mathematical functions to operate on them efficiently. An array is a set of multiple values which are of the same data type. The Numpy has built-in mathematical tools that make it easy to do calculations. Numpy is usually imported under the np alias.

Remember

In Python, alias are an alternate name for referring to the same thing.

Syntax: import numpy as np

NumPy Array

Python lists can be used in place of arrays, although they do not perform well when dealing with huge amounts of numerical data. To solve this problem, we use Python’s NumPy package. NumPy has an array object named ndarray. An array’s values are homogeneous (have the same data type).

286


Create Array Object Code import numpy as np a = np.array([2, 4, 6, 8]) print(a)

Output [2 4 6 8]

Create NumPy Array from a List Code

Output [2 4 6 8]

import numpy as np list = [2, 4, 6, 8] a = np.array(list) print(a)

NumPy Array Indexing: Array indexing is similar to accessing an array element. An array element can be accessed using its index number. Indexes in NumPy arrays begin with 0, indicating that the first element has index 0, the second has index 1, and so on. Example: Find the third element from the following array. Code import numpy as np a = np.array([2, 4, 6, 8]) print(a[2])

Output 6

Difference between NumPy Arrays and Lists NumPy Arrays

Lists

Numpy arrays store homogeneous (same type) data.

Lists can store heterogeneous (different types) data.

It takes less memory space.

It takes more memory space.

Numpy arrays support multi-dimensional arrays.

Lists support only one-dimensional arrays.

The size of the array is fixed once it has been created.

The list can be resized (by adding or deleting elements).

It is suitable for numerical computations, data analysis, machine learning, and tasks involving large datasets.

It is suitable for general-purpose programming.

Direct numerical operations can be done. For example, dividing the whole array by 4 divides every element by 4.

Direct numerical operations are not possible. For example, dividing the whole list by 4 cannot divide every element by 4.

Example: To create an array:

Example: To create a list: A = [1,2,3,4,5]

import numpy

A=numpy.array([1,2,3,4,5])

Some common modules of this library are, math, datetime, random, etc. Random: Numpy offers the random module to work with random numbers. Syntax: import numpy as np x = np.random.rand()

Chapter 15 • Python for Data Sciences

287


Example: Generate a random integer from 10 to 500. Code import numpy as np import random x = np.random.randint(10,500) print(x)

Result 459

math: This module provides functions to deal with both basic operations such as addition (+), subtraction (-), multiplication (*), division (/) and advanced operations like: ⇒ sqrt(): This function is used to find square root of a given number. Syntax: math.sqrt(x)

⇒ pow(): This function is used to calculate the power (exponentiation) of a given number to another number. Syntax: math.pow(x, y)

⇒ factorial(): This function is used to calculate the factorial of a number. Syntax: math.factorial(x)

⇒ min(): This function is used to find the smallest value in a given list. Syntax: min(n1, n2, n3, ...)

⇒ max(): This function is used to find the largest value in a given list. Syntax: max(n1, n2, n3, ...)

⇒ prod(): This function is used to find the product of the elements from the given iterable. Syntax: math.prod(iterable, start)

Syntax: import math Example: Calculate the factorial of 7. Code import math print(math.factorial(7))

Result 5040

In this program, Python includes a built-in module called math from its standard library. The math module provides a list of mathematical methods. Here, the factorial () method is used to calculate the factorial of a given number. DateTime: This module can be imported to work with the date as well as time. Syntax: import datetime Example: Display current date and time. Code import datetime x=datetime.datetime.now() print(x)

288

Result 2024-05-27 11:12:50.933934


Here are some ways by which you can create arrays using NumPy package assuming the NumPy packages is imported already. Function

Code

Output

Creating a 2-Dimensional zero array (2X3 – 2 rows and 3 columns)

numpy.zeros((2,3))

array ([[ 0. , 0. , 0. ], [0. , 0. , 0.]])

Creating a 2-Dimensional constant value array (2X3 – 2 rows and 3 columns) having all 7s

numpy.full((2,3),7)

array ([[ 7, 7, 7 ], [ 7, 7, 7]])

Creating a sequential array from 0 to 20 with gaps of 4

array([ 0, 4, 8, 12, 16])

array ([ 0, 4, 8, 12, 16])

Pandas

The name “Pandas” refers to “Panel Data” and “Python Data Analysis”. It makes data processing, data manipulation, and data cleaning easier. Pandas are suited for: •

Tabular data with heterogeneously-typed columns, as in an SQL table or Excel spreadsheet.

•

Ordered and unordered time series data.

•

Arbitrary matrix data (homogeneously typed or heterogeneous) with row and column labels.

•

Any other form of statistical data sets.

Pandas can do things like sorting, re-indexing, iteration, concatenation, data conversion, visualisation aggregation, etc. The Pandas package is usually imported under the pd alias. Syntax: import pandas as pd

Primary Data Structures of Pandas

There are two types of data structures in Pandas. 1. Series 2. DataFrame Series: It works like a column in a table. It is used to hold a one-dimensional array of any data type. Syntax: import pandas as pd series = pd.Series(data) DataFrame: It is a fundamental data structure in Pandas. It represents a two-dimensional, and tabular data structure with labelled axes (rows and columns). DataFrames are commonly used for data analysis and manipulation. Syntax: import pandas as pd df = pd.DataFrame(data)

Chapter 15 • Python for Data Sciences

289


Example: Create a simple Pandas Series from a list=[9.1, 8.2, 7] Code

Result 0 9.1 1 8.2 2 7.0 dtype: float64

import pandas as pd a = [9.1, 8.2, 7] x = pd.Series(a) print(x)

Example: Create a Pandas DataFrame for given data. Duration: [60, 45, 30], Pulse: [120, 100, 98] Code import pandas as pd data = { 'Duration': [60, 45, 30], 'Pulse': [120, 100, 98] } df = pd.DataFrame(data) print(df)

Result 0 1 2

Duration Pulse 60 120 45 100 30 98

Here are just a few of the things that pandas do well: •

Easily handles missing data (expressed as NaN) in both floating and non-floating point data.

•

Columns can be added and removed from DataFrames and higher-dimensional objects.

•

Objects can be manually aligned to a set of labels, or the user may remove the labels and have Series, DataFrame, and so on automatically align the data during calculations.

•

Intelligent label-based slicing, advanced indexing, and large-data subsetting.

•

Easy merging and joining of data sets.

•

Flexible data reshaping and pivoting.

•

Easily importing data from files such as CSV, Excel, etc.

Matplotlib

Matplotlib was created by John D. Hunter. Matplotlib is open source and we can use it freely. It is a popular Python library for creating static, animated, or interactive visualisations. It is capable of generating visually detailed representations such as pie charts, histograms, scatter plots, bar graphs, etc. To use a package, we need to import it in the script. Syntax: import matplotlib Here are some of the key modules in Matplotlib: Figure: The Figure module represents the entire figure or canvas where your plots are drawn. It is typically created using plt.subplots() or plt.figure(). Syntax: import matplotlib.figure as Figure

290


Pyplot: This module provides a high-level interface for creating and customising plots. It is commonly used for creating simple visualisations like line plots, bar plots, scatter plots, histograms, and more. Syntax: import matplotlib.pyplot as plt Line2D: This module is used for creating and customising line plots. It allows you to control the appearance of lines, markers, and their properties. Syntax: import matplotlib.lines as Line2D

Did You Know?

Patch: This module provides classes for creating various shapes and patches, such as rectangles, circles, polygons, and more.

Over 137,000 python libraries are present today.

Syntax: import matplotlib.patches as Patch

Ticker: This module provides tools for controlling the appearance of tick marks and labels on axes. Syntax: import matplotlib.ticker as Ticker Example: Draw a line. Code

Result

import matplotlib.pyplot as plt import numpy as np x = np.array([0, 1, 2, 3]) y = x+1 plt.plot(x, y) plt.show()

Error Alert! When the appropriate syntax of the language is not followed, a syntax error occurs. Example: print “hello” SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(...)?

Chapter 15 • Python for Data Sciences

Remember

NumPy works only with homogenous collection of Data while Pandas works with both homogeneous and heterogeneous type of data.

291


Activity Time Activity 1: Generate random numbers between 1-100 and guess the number.

(Group activity)

Purpose: Form groups of 4 students and create a program that allows the computer to select a number between 1 and 100 at random. Once users have guessed the number, provide a hint. The user receives another clue and loses points for each incorrect guess. The hint may consist of divisible multiples, bigger or smaller, or any combination of these. Activity 2: Write a program to find the minimum number of an array.

(Individual work)

Activity 3: Draw a line xy for given x coordinates [0,5,8,3] and y = x*2

(Individual work)

Chapter Checkup A Select the correct option. 1 Series is a data structure from Python’s ...................... module. a Numpy

b Pandas

c Matplotlib

d Dataframes

2 This library in Python used for data processing, data manipulation, and data cleaning easier. a Matplotlib

b Numpy

c Pandas

d None of these

c 16.0

d 27.0

3 What will be the output of the given code? import math print(math.pow(4, 3)) a 12.0

b 64.0

4 This module provides tools for controlling the appearance of tick marks and labels on axes. a Pyplot

b Patch c Ticker d None of these

B Fill in the blanks with the most suitable words. 1 A Python library is a collection of ...................... that are linked together. 2 Size mutability means columns can be ...................... and ...................... from DataFrames. 3 ...................... function is used to find the largest value in a given list. 4 ...................... are commonly used for data analysis and manipulation. C

State whether the following statements are True or False. Correct the statements 1 DataFrame is used to hold a one-dimensional array of any type. 2 Line2D is used for creating and customizing line plots. 3 Numpy is usually imported under the np alias. 4 DateTime module can be imported to work only with the date.

D Answer the following questions. (Solved) Q1. Why pandas are used? A1. Pandas can do things like sorting, re-indexing, iteration, concatenation, data conversion, visualisation, aggregation, etc. It makes data processing, data manipulation, and data cleaning easier.

292


Q2. Write key module of Matplotlib. A2. Figure: The Figure module represents the entire figure or canvas where your plots are drawn. It is typically created using plt.subplots() or plt.figure(). Syntax:

import matplotlib.figure as Figure

Pyplot: This module provides a high-level interface for creating and customizing plots. It is commonly used for creating simple visualizations like line plots, bar plots, scatter plots, histograms, and more. Syntax:

import matplotlib.pyplot as plt

Line2D: This module is used for creating and customizing line plots. It allows you to control the appearance of lines, markers, and their properties. Syntax:

import matplotlib.lines as Line2D

Patch: This module provides classes for creating various shapes and patches, such as rectangles, circles, polygons, and more. Syntax:

import matplotlib.patches as Patch

Ticker: This module provides tools for controlling the appearance of tick marks and labels on axes. Syntax:

import matplotlib.ticker as Ticker

Q3. Write a python code to join two given arrays. [1, 3, 5] and [2, 4, 6] A3.

Code

Result [0 1 4 5 2 3 9]

import numpy as np a1 = np.array([0, 1, 4, 5]) a2 = np.array([2, 3, 9]) a = np.concatenate((a1, a2)) print(a)

AI Activities 1 Visit the link https://pythonprinciples.com/challenges/Tic-tac-toe-input/ and run this code. 2 Visit the link: https://www.hackerrank.com/challenges/finding-the-percentage/problem?isFullScreen=true and solve this challenge. 3 Visit the link : http://bit.ly/data_notebook and start exploring- The Jupyter Notebook of Basic Statistics with Python.

Answer Key A

1. b

B

1. Modules

C

1. False. Series is used to hold one-dimensional array of any type.

2. c

3. b

4. c

2. Added, Removed

3. Max()

4. DataFrames

2. T rue. 3. True.

4. False. DateTime module can be imported to work only with the date as well as time.

Chapter 15 • Python for Data Sciences

293


Unit 4 • Data Sciences

16 Statistical Learning and Data Visualisation Statistics is a popular field that involves collecting data, organising, analysing, interpretating, and visualising data. Nowadays, statistics is used widely in various fields, such as computer science, machine learning, data science, etc. Python simplifies statistical analysis on datasets in data science.

Basic Statistics with Python

Data Science involves analysing data to extract insights and knowledge. When dealing with numeric and alphanumeric data, mathematics becomes indispensable. The basic statistical methods used in mathematics are readily available in Python, making it easier to analyse and manipulate datasets. Additionally, Python offers a range of libraries and tools, such as Pandas, NumPy, and Matplotlib, that enhance the efficiency and effectiveness of data analysis. These tools enable data scientists to perform complex calculations, visualise data trends, and build predictive models with ease. Let us first discuss some of these statistical tools frequently used in Python: M M

M

• Mean: The average value of a sequence. • Median: Middle value of a sorted data set. • Mode: Most frequent value of the sequence.

• Standard Deviation: Measures the spread of the sequence around its average value. SD

V

• Variance: Average of the squared differences from the mean.

Mean: The sum of the data values divided by the total number of data values is called the mean. It is also defined as the average value of a given data set.

294


Syntax: statistics.mean(data) The statistics.mean() method calculates the mean value of the given data set. Example: Calculate mean value for the given data sets: i.

[1, 2, 5, 8, 10,7]

ii.

[6, 5.5, -4.4, 8.2, -6, 32] Code

import statistics

print(statistics.mean([1, 2, 5, 8, 10,7]))

print(statistics.mean([6, 5.5, -4.4, 8.2, -6, 32]))

Output 5.5

6.883333333333333

Median: The middle value is known as the median. Before calculating the median, the data must be sorted in ascending order. Note: If the number of data values is odd, it will return the exact middle value. If the number of data values is even, it takes the average of the two middle values. Syntax: statistics.median(data) Here, the statistics.median() method calculates the median of the given data set. Example: Calculate the median of the given data sets: i.

[1, 2, 5, 7, 8, 10]

ii.

[6, 10, 16, 19, 20] Code

import statistics

print(statistics.median([1, 2, 5, 7, 8, 10]))

print(statistics.median([6, 16, 10, 29,22]))

Output 6.0 16

Mode: The value that appears the most frequently in the data set is the mode. If the frequencies of all data values are the same, the data collection may not have a mode. In addition, if two or more data values have the same frequency, we may have more than one mode. Syntax statistics.mode(data) Example: Calculate the mode of the given data set: [2, 3, 5, 3, 5, 2, 2, 1, 4] Code import statistics

print(statistics.mode([2, 3, 5, 3, 5, 2, 2, 1, 4]))

Output 2

Standard Deviation: The standard deviation represents the dispersion or variance in a set of data values around its mean value. When the standard deviation is low, it means the data points are near the mean; when it is high, it means that the data points are dispersed over a larger range of values.

Chapter 16 • Statistical Learning and Data Visualisation

295


The standard deviation is calculated by following the given steps: i.

Determine the Mean: Calculate the mean (average) of the data set.

ii. Calculate the Deviations: Subtract the mean from each data point to find the deviation of each data point from the mean. iii. Square the Deviations: Square each of these deviations to make them positive. iv. Sum the Squared Deviations: Add all of the squared deviations together. v. Calculate the Variance: Divide the sum of the squared deviations by the number of data points (or N−1 if using a sample). vi. Calculate the Standard Deviation: Finally, take the square root of the variance to obtain the standard deviation.

∑ s=

2 n   i = 1  x i − x 

n −1

•

S represents the sample standard deviation.

•

xi are the individual data points.

•

x̄ is the sample mean.

•

n is the number of data points in the sample.

Remember Variance is the square of standard deviation

Syntax statistics.stdev(data) Example: Find out the standard deviation of the given data set: i.

[15, 7.8, -39, -50]

ii.

[1, 20, 70, 90] Code

import statistics

print(statistics.stdev([15, 7.8, -39, -50])) print(statistics.stdev([1, 20, 70, 90]))

Output 32.71712090022593 41.67633221226008

Variance: Variance is a statistical term that indicates the degree of spread or dispersion in a group of data points. Variance is often used in machine learning to assess model effectiveness. Variance is defined as the average of the squared deviations from the mean. Syntax: statistics.variance(data) The statistics.variance() method calculates the variance from given data set. Example: Find out the variance of the given data set [5, 1.8, -9, -15,6]. Code import statistics

print(statistics.variance([5, 1.8, -9, -15,6]))

296

Output 86.288


Error Alert! In cases of mean, mode, median, standard deviation, and variance, if data is empty, it returns a StatisticsError (This error usually arises when a statistical function is trying to perform an operation on

Remember

The statistics.median() method sorts the data in ascending order before calculating the median.

data that is either inadequate or incorrect.)

The advantage of using Python packages is that we don’t have to create our formulas or equations to get the results. There are several pre-defined functions available in packages, such as NumPy and Pandas that make this task easier.

Data Visualisation

Data analysis can be challenging due to large datasets that include numerical values. Machines work efficiently on numbers, but humans often require visual aid to understand and interpret information. The graphical representation of data is known as data visualisation. Data visualisation tools make it easy to see and analyse data trends, anomalies, and patterns. While collecting data, some errors may occur. Let us first look at the types of problems we can have with data: 1. Erroneous Data: Errors in data can occur in two ways: •

Incorrect values: The dataset can contain wrong values at random places. For example, a phone number is mentioned in the roll number column, whereas a roll number is mentioned in the name column, and so on. These are incorrect values that do not match the type of data supposed to be in that place.

•

Invalid or null values. The values become invalid in some places because they are corrupted. ‘NaN’ values are commonly found in datasets. These are null values; they have no meaning and cannot be processed. As a result, these values are deleted from the database as they are found.

2. Missing Data: In some datasets, some cells remain blank. The values of these cells are missing, hence the cells are empty. Missing data cannot be assumed to be an error because the values here are not incorrect and may not be missing due to an error. 3. Outliers: These are data values that do not fall within the range of a particular element. For example: Assume a student missed an exam and hence received a 0 score. If his scores are taken into consideration, the overall class average will fall. To avoid this, the average is calculated for the range of marks from highest to lowest, keeping this result separate. This ensures that the class’s average marks are accurate based on the data. In Python, the Matplotlib package helps visualise data. Matplotlib was created by John D. Hunter. It is open source, and we can use it freely. This package allows us to plot different types of graphs, such as bar charts, pie charts, histograms, scatter plots, etc. Let us understand a few of these graphs:

Line Chart

A line graph is a unique type of graph which is commonly used in statistics. Line charts are used to show the relationship between two data points, X and Y, on an individual axis. Example: Draw a basic line chart with equally spaced x-values and y-values calculated as the corresponding x-values increased by 1.

Chapter 16 • Statistical Learning and Data Visualisation

297


Code

Output

import matplotlib.pyplot as plt import numpy as np

x = np.array([0, 2, 4, 6]) # for X-axis points y = x+1 #forY-axis points plt.plot(x, y) plt.show()

Scatter Plot

Scatter plots are effective data visualisation tools because they help you to easily analyse and display correlations between variables. The data is represented as a collection of dots. A 2D scatter plot can display information for up to 4 parameters. In a scatter plot, the two axes (X and Y) represent two different parameters. The other two different parameters are represented by the colour and size of the circles. Thus, using only one position on the graph, one may visualise 4 different parameters all at once. Code

Output

import matplotlib.pyplot as plt x =[2, 5, 9, 1, 2, 7, 12, 3, 4, 17, 22, 1, 16]

y =[78, 87, 67, 99, 120, 68,

113, 87, 84, 98, 87, 75, 55]

plt.scatter(x, y, c =”red”) plt.show()

Bar Chart

A bar chart is used to display a distribution of data points or to compare metric values across different subsets of data. A bar chart is a commonly used data visualisation tool that represents data values with rectangular bars. Various versions of bar charts exist, like single bar charts, double bar charts, etc.

298


For example: Draw a bar graph that depicts the number of students registered in various classes at a school. Code

Output

import numpy as np

40

data = {‘IX’:40, ‘X’:35, ‘XI’:30, ‘XII’:30}

classes = list(data.keys())

values = list(data.values()) fig = plt.figure(figsize = (10, 5)) plt.bar(classes, values, color =’green’,

No. of students enrolled

import matplotlib.pyplot as plt

width = 0.4)

35 30 25 20 15 10 5 0

plt.xlabel(“Classes”)

IX

X

Classes

XI

XII

plt.ylabel(“No. of students enrolled”) plt.show()

Histogram

A histogram is a graph that displays data distribution. A histogram is a kind of data visualisation that shows the distribution of a continuous variable by dividing it into bins (intervals) and using bars to depict the frequency (count) of data points in each bin. The X axis indicates the range of values separated into bins. The Y axis indicates the frequency (or count) of data points within each bin. For example: Draw a simple histogram with some random numbers in python. Code

Output

import matplotlib.pyplot as plt import numpy as np

plt.hist(data, bins=10, color=’red’, edgecolor=’blue’) plt.xlabel(‘Values’)

plt.ylabel(‘Frequency’) plt.show()

Frequency

data = np.random.randn(100)

Values

Chapter 16 • Statistical Learning and Data Visualisation

299


Box Plots

Box plots, or box and whiskers plots, are a standard method of presenting the distribution of data throughout the range with the help of four quartiles. Box plots are typically used to represent continuous variables. If the data are discrete, the plot usually doesn’t provide much information. They indicate the median, upper and lower quartiles, lowest and maximum values, and any outliers in the dataset. Interquartile Range (IQR)

Outliers

"Minimum" (Q1- 1.5* IQR)

–4

–3

Outliers

"Minimum" (Q3 + 1.5* IQR)

Median

Q3 Q1 (25th Percentile) (75th Percentile) –2

–1

0

1

2

3

4

As we can see, the plot contains a box, and the two lines at its left and right are termed as whiskers. The plot has 5 different parts to it: Quartile 1: From the 0th to the 25th Percentile—This segment represents data between the 0th and 25th percentiles. If the data in this range is tightly clustered, the whisker will be shorter, reflecting the smaller spread. However, if the data covers a broader range, the whisker will be longer, indicating a larger spread. Quartile 2: From the 25th to the 50th Percentile—The 50th percentile, also known as the median, represents the midpoint of the entire data distribution. The data within the 25th to 75th percentile range, which has a minimal deviation from the median, is represented inside the box. Quartile 3: From the 50th to the 75th Percentile—This range is also plotted inside the box, as the deviation from the median is still minimal. Quartiles 2 and 3 together form the interquartile range (IQR). The length of the box varies based on the spread of the data; a smaller spread results in a shorter box, while a larger spread results in a longer box. Quartile 4: From the 75th to the 100th Percentile—This represents the whisker plot for the top 25% of the data. Outliers: One of the key benefits of box plots is their ability to highlight outliers in the data distribution. Outliers, which are data points that fall outside the expected range, are plotted as dots or circles outside the main graph. Since being out of range is not an error, that is why they are still plotted on the graph for visualisation.

Think and Tell

Is the box plot vertical or horizontal?

Activity Time Activity1: Form groups of five students and assign one statistical tool to each student to calculate mean, mode, median,

standard deviation, and variance of the given data set: [4, 2.5, 3.25, 3.1, 1.75, 3.8]

Activity2: Write a Python code to compute the mode of the given data set: [‘apple’, ‘mango’, ‘kiwi’, ‘mango’, ‘banana’].

300

(Group activity) (Individual work)


Chapter Checkup A Select the correct option. 1 Box plots are usually used for a Continuous data

b Discrete data.

2 The middle value is known as the a Mean

3

Matplotlib was created by a Wes McKinney

c Both a and b

d None of these

b Median

c Mode

d Standard Deviation

b John D. Hunter

c Guido van Rossum

d James Gosling

.

4 Which chart type shows the distribution of a continuous variable by dividing it into bins and representing the frequency with bars? a Bar Chart

b Box and Whisker Plot

B Fill in the blanks with the most suitable words. 1 Missing data cannot be construed as an 2 We take the square root of the 3 Before calculating the

d Line Chart

.

to obtain the standard deviation. , the data must be sorted in ascending order.

4 The data is represented as a collection of dots in C

c Histogram

chart.

State whether the following statements are True or False. Correct the statements that are false. 1 Histogram is a data visualisation tool. 2 Variance is a statistical term that indicates the degree of spread or dispersion in a group of data points. 3 Outliers in data may indicate errors or anomalies. 4 The data from the 25th to 50th percentiles is plotted in the third quartile (Q3).

D Answer the following questions (Solved). Q1. What is a standard deviation? A1. The standard deviation represents the dispersion or variance in a set of data values around its mean value. The formula for the standard deviation is:

∑ s= • •

2 n   i = 1  x i − x 

n −1

S represents the sample standard deviation. x̄ is the sample mean.

Q2. What are outliers? Give an example.

• •

xi are the individual data points.

n is the number of data points in the sample.

A2. Outliers are data values that do not fall within the range of a particular element. For example: Assume a student missed an exam and hence received a 0 score. If his scores are taken into consideration, the overall class average will fall. To avoid this, the average is calculated for the range of marks from highest to lowest, keeping this result separate. This ensures that the class’s average marks are accurate based on the data. Q3. Explain the box plot in detail with a diagram. A3. Box plots, or box and whiskers plots, are a standard method of presenting the distribution of data throughout the range with the help of four quartiles. the median, upper and lower quartiles, lowest and maximum values, and any outliers in the dataset.

Chapter 16 • Statistical Learning and Data Visualisation

301


Interquartile Range (IQR)

Outliers

"Minimum" (Q1- 1.5* IQR)

–4

–3

Median

Q1 (25th Percentile)

–2

–1

Q3

(75th Percentile)

1

0

Outliers

"Minimum" (Q3 + 1.5* IQR)

2

4

3

As we can see, the plot contains a box, and the two lines at its left and right are termed as whiskers. The plot has 5 different parts to it:

Quartile 1: From the 0th to the 25th Percentile—This segment represents data between the 0th and 25th percentiles. If the data in this range is tightly clustered, the whisker will be shorter, reflecting the smaller spread. However, if the data covers a broader range, the whisker will be longer, indicating a larger spread. Quartile 2: From the 25th to the 50th Percentile—The 50th percentile, also known as the median, represents the midpoint of the entire data distribution. The data within the 25th to 75th percentile range, which has minimal deviation from the median, is represented inside the box. Quartile 3: From the 50th to the 75th Percentile—This range is also plotted inside the box, as the deviation from the median is still minimal. Quartiles 2 and 3 together form the Interquartile Range (IQR). The length of the box varies based on the spread of the data; a smaller spread results in a shorter box, while a larger spread results in a longer box. Quartile 4: From the 75th to the 100th Percentile—This represents the whisker plot for the top 25% of the data.

Outliers: Outliers, which are data points that fall outside the expected range, are plotted as dots or circles outside the main graph. Since being out of range is not an error, that is why they are still plotted on the graph for visualisation.

Q4. Write a Python code to compute the mean, median, and mode of the given data set [0, 2, 4, 4, 6, 8, 8, 9, 9, 9]. A4.

Code

Output

import statistics

9

print(statistics.median([0, 2, 4, 4, 6, 8, 8, 9, 9, 9]))

5.9

print(statistics.mode([0, 2, 4, 4, 6, 8, 8, 9, 9, 9])) print(statistics.mean([0, 2, 4, 4, 6, 8, 8, 9, 9, 9]))

7.0

AI Activities 1 Visit the link: https://www.tableau.com/learn/articles/data-visualization and explore all topics. 2 Visit the link: https://www.javatpoint.com/how-to-plot-histogram-in-python. Learn how to plot a histogram.

Answer Key A

1. a

2. b

B

1. Error

2. Variance

C

1. True.

3. b

4. c 3. median

4. Scatter plot

2. T rue.

3. False. Outliers fall outside the expected range, but being out of range is not an error.

4. False. The data from the 25th to the 50th percentiles is plotted in the second quartile(Q2).

302


Unit 4 • Data Sciences

17 K-Nearest Neighbour Model**

P

ersonality traits play a crucial role in human behaviour and decision-making. Predicting someone’s personality using data and algorithms combines psychology and computer science in a fascinating way. Before diving into the K-Nearest Neighbour (KNN) model, let us play a fun and engaging game based on personality prediction. This will help us understand the concepts of KNN in a simple and interesting way.

Activity Personality Prediction

There are several personality predictions, each based on a particular psychological theory. Here are a few popular types: • • • •

People focused: This refers to individuals who genuinely care about others and consider their well-being.

Task focused: Task-oriented people concentrate on goals and understand what is needed to achieve them. Passive: Being passive means actively listening to others without interruption.

Active: Active individuals participate in conversations and ensure their voices are heard within a group.

Now, imagine this map as a grid. Take a moment to consider which of the above qualities best describes you. Next, take a piece of paper and write your name on it. Position this paper on the map at the point that most accurately reflects your characteristics. You can place the paper slip anywhere on the map.

Positive Y-axis (Passive)

Negative X-axis (Task Focused)

Positive X-axis (People Focused)

Negative Y-axis (Active)

Now, visit this link and complete the quiz on your own: https://tinyurl.com/discanimal ** Note: This chapter is optional as per the CBSE syllabus and may not be covered in assessments.

303


This link will take you to a personality prediction quiz. Try to answer every question in this quiz honestly without anyone’s help. After completing the quiz, remember the animal assigned to you. Write it down privately and keep it to yourself only. After everyone completes the quiz, return to the map, remove your paper slip, and draw the symbol that corresponds to your animal in its place. Here are the symbols: Lion

Otter

Golden Retriever

Beaver

Lion Strength: You are determined, competitive, bold, a decision-maker, and a leader. Your strategy is “Let me handle it my way” or “Now let’s get started!” Weakness: Too argumentative, too authoritative. Otter Strength: You are visionary, motivating, energetic, fun-loving, creative, collaborative, and optimistic. Your strategy is “Believe me!” and “It will work out!” Weakness: Talkative, less focused on details, impatient Golden Retriever Strength: You are loyal, habitual, dislike change, sympathetic, thoughtful, patient, and a good listener. Your strategy is “Let’s leave things as they are” Weakness: Unable to express feelings, too gentle with others Beaver Strength: You are reserved, practical, analytical, precise, persistent, and scheduled. Your strategy is “How was it handled in the past?” Weakness: Unrealistic expectations for yourself and other people, excessive criticisim Place these symbols where you placed your names. Ask five students not to place symbols and keep their animal’s secret. Their name slips will remain on the map to predict their animals using the map. Next, try to predict the possible animals for these five unknowns. Examine each slip one by one to see which animal appears most frequently nearby. If the otter symbol is most common near their slip, there is a good chance their animal is also an otter. Let us guess the animal for each of them based on their nearest neighbours. After guessing, ask these five students if the guess is correct. The personality prediction quiz was a brief introduction to KNN. In data science, there are several algorithms used for classification. One of those algorithms is the K-Nearest Neighbour.

KNN Algorithm

The K-Nearest Neighbour (KNN) algorithm is a basic supervised learning technique. It is a popular choice for solving classification and regression problems. It is used in a wide range of applications, including video and image recognition as well as handwriting identification. The KNN algorithm is useful for the interpolation of missing data values, i.e., it estimates the missing value based on the nearest known data point. It assumes that similar things tend to be close to each other,

304


following the idea that “like things attract like.” The KNN Did You Know? algorithm is based on the concept that the value for a missing data will be close to the values of its nearest neighbours. The ‘K’ in KNN The KNN algorithm was developed in 1951 represents the number of nearest neighbours considered when by Evelyn Fix and Joseph Hodges and was categorising a given data point. Choosing an appropriate value later enhanced by Thomas Cover. for ‘K’ is crucial. In the KNN algorithm, the Euclidean distance is commonly used as a measure of similarity between data points. Euclidean distance is a measure of the straight-line distance between two points in a multidimensional space.

Characteristics of KNN Algorithm KNN has the following characteristics: •

The KNN prediction model depends on its neighbouring points to define its category.

•

It determines how to classify unknown points by using the attributes of the majority of the nearest points.

•

It is based on the principle that similar data points should be close together.

Example

Assume you have to determine if a new data point in the graph represents a dog or a cat. In the graph, the ‘X’ depicts the new data point whose value is to be predicted. The blue diamond represents a dog, and the yellow diamond represents a cat.

x

Now, let us look at the following maps carefully and decide whether ‘X’ should be a cat or a dog.

x

x

1 Nearest NeAighbour

2 Nearest Neighbours

Cat

Dog

x

3 Nearest Neighbours

1. I n the first case, K is taken as 1 which means that we are taking only 1 nearest neighbour into consideration. The nearest value to ‘X’ is a blue one, hence, the KNN algorithm predicts that ‘X’ represents a dog. 2. I n the second graph, the value of K is 2. Taking the 2 nearest nodes to ‘X’ into consideration, we see that one is a cat and the other is a dog. This makes it difficult for the machine to make any predictions based on the nearest neighbour, and hence the machine is not able to give any predictions. 3. I n the third graph, the value of K becomes 3. Here, 3 nearest nodes to ‘X’ are chosen, out of which 2 are yellow and 1 is blue. On the basis of this, the model is able to predict that the animal is, in fact, a cat. The KNN classifier can be used for classification tasks because it is based on features—similarity and closeness.

Significance of the Number of Neighbours

1. As the value of K approaches 1, our predictions become less accurate. When K=1, blue is the single nearest neighbour, but data point ‘X’ is surrounded by multiple yellows and one blue. We would expect the data point to be yellow, but KNN predicts blue incorrectly.

Chapter 17 • K-Nearest Neighbour Model**

305


2. On the other hand, if we increase the value of K, predictions become more stable due to the clear indication of a majority. In such a scenario, the model is more likely to be accurate (up to a certain point). But eventually, we see an increase in the number of mistakes if we realise we go too far with the value of K. 3. When we take a majority vote among labels (for example, selecting the mode in a classification issue), we normally make K an odd number to provide a tiebreaker.

Advantages of KNN •

KNN memorises the entire training dataset and uses it directly during prediction. This makes it adaptable to new data without retraining.

•

KNN stores the training data and computes predictions based on the similarity between query points and the stored examples. It is efficient for real-time scenarios.

•

KNN can handle both classifications, where it assigns the most common class label among neighbours, and regression, where it averages nearby neighbours’ values.

Disadvantages of KNN •

It does not operate well with large datasets because the cost of computing the distance between the unknown data point and known data points (in order to find the nearest neighbour) is too expensive. This also reduces the algorithm’s speed.

•

The KNN technique does not perform well with high-dimensional data because it is difficult for the algorithm to determine the distance in each dimension.

•

The KNN algorithm is influenced by data noise. We must manually enter missing numbers and delete outliers.

Remember The K parameter in the KNN method determines how many neighbours will be evaluated to classify a single query point.

Think and Tell

Why is the KNN algorithm considered a “Lazy Learner”?

Activity Time Activity 1: KNN approach for vehicle manufacture

(Group activity)

A car manufacturer has developed a new model named ‘ABC’. To assess its market potential, the company needs to identify existing vehicles in the market that closely resemble this model. Your task is to form groups of 4–5 students. Based on any one of these characteristics, such as pricing, engine power, engine size, fuel tank capacity, etc., represent these cars on a scatter plot graph and use the KNN algorithm to predict the model ‘ABC’ is closest to which car among the plotted cars. Activity 2: KNN algorithm to predict academic difficulties

(Individual activity)

Categorise student groups based on academic performance metrics, such as test scores, assignment grades, participation

levels, and study habits. Utilise the KNN algorithm to identify students whose academic profiles closely resemble those who have historically faced challenges or dropped out early.

306


Chapter Checkup A Select the correct option. 1 Which of the following statements accurately describes the KNN algorithm? a KNN is an unsupervised learning technique used for clustering data. b KNN is a basic supervised learning technique used for classification and regression. c KNN is primarily used for dimensionality reduction in high-dimensional datasets. d KNN is a reinforcement learning algorithm used for training agents in dynamic environments. 2 Which of the following is the main disadvantage of the KNN algorithm? a Adaptable to new data without retraining c Memorises the entire training dataset

b Computationally expensive for large datasets

d Can handle both classification and regression

3 What does ‘K’ mean in the KNN algorithm?

a Kernel b Value for an unknown data point c Average value for known data points

d Number of nearest neighbours

B Fill in the blanks with the most suitable words. 1 As the value of K approaches ......................, our predictions become less accurate. 2 One of the disadvantages of the KNN algorithm is that it is influenced by ....................... 3 KNN uses ...................... method to average nearby neighbours’ values to predict values for unknown data. 4 We must manually enter missing numbers and delete ...................... while making use of the KNN algorithm. C

State whether the following statements are True or False. Correct the statements that are false. 1 The KNN algorithm is efficient for real-time scenarios. 2 The KNN prediction model does not depend on the surrounding points or neighbours to define its class or group. 3 KNN is suitable for classification but not for regression problems. 4 The KNN technique does not perform well with high-dimensional data.

D Answer the following questions. (Solved) Q1. What is the K-Nearest Neighbour Algorithm? A1. The K-Nearest Neighbour (KNN) algorithm is a basic supervised learning technique. It is a popular choice for solving classification and regression problems. This algorithm is useful for the interpolation of missing data values, i.e., it estimates the missing value based on the nearest known data point. Q2. What are the three advantages of KNN. A2. Following are the advantages of the KNN algorithm: • KNN memorises the entire training dataset and uses it directly during prediction. This makes it adaptable to new data without retraining. • KNN stores the training data and computes predictions based on the similarity between query points and the stored examples. It’s efficient for real-time scenarios. • KNN can handle both classifications, where it assigns the most common class label among neigh-bours, and regression, where it averages nearby neighbours’ values.

Chapter 17 • K-Nearest Neighbour Model**

307


Q3. What are the characteristics of KNN algorithm? A3. KNN has the following characteristics: •

The KNN prediction model depends on its neighbouring points to define its category.

•

It determines how to classify unknown points by using the attributes of the majority of the nearest points.

•

It is based on the principle that similar data points should be close together.

Q4. Shefali has the given dataset that contains information about the sweetness of a fruit. There is a new data point labelled ‘X’, and she has to determine if it is sweet or not. How will she go about it?

x

x

1 Nearest Neighbour

2 Nearest Neighbour

x

Sweet Not Sweet

3 Nearest Neighbour

A4. Shefali should use the K-Nearest Neighbour algorithm to determine if the fruit labelled ‘X’ is sweet or not. She should first consider the following values for K: 1 K =1: In the first graph, the value of K is equal to 1. This means taking only 1 nearest neighbour into consideration. The nearest value to X is a blue one, hence, the 1-nearest neighbour algorithm predicts that the fruit is not sweet. 2 K =2: In the second graph, the value of K is 2. Taking 2 nearest nodes to X into consideration, we see that one is sweet while the other one is not . Hence, no prediction can be made. 3 K =3: In the third graph, the value of K becomes 3. Here, 3 nearest nodes to X are chosen, out of which 2 are yellow and 1 is blue. On the basis of this, Shefali predicts that the fruit will be sweet.

AI Activities 1 V isit the link: https://neptune.ai/blog/knn-algorithm-explanation-opportunities-limitations?ref=blog.aiensured. com and learn more about the KNN algorithm. 2 Visit the link: https://www.freecodecamp.org/news/k-nearest-neighbors-algorithm-classifiers-and-model-example/ and solve some more examples of KNN.

3 Visit the link: https://www.youtube.com/watch?v=gLz0UK2kdWs and understand the concepts of KNN.

Answer Key A

1. b

2. b

B

1. one

2. data noise

C

1. True

3. d 3. regression

4. outliers

2. F alse. The KNN prediction model depends on the surrounding points or neighbours to define its class or group. 3. False. KNN is suitable for both classification and regression problems. 4. True.

308


Unit Reflection

Key Terms • Data science: Data Science is the domain of computer science where we extract insights from available data using scientific methods, algorithms, and statistics. • Problem Scoping: Understanding and identifying a problem and having some ideas and vision to find a solution to the problem is known as problem scoping. • Data Acquisition: It denotes the process of gathering or obtaining data from identified sources. • Data Exploration: It is the stage where we analyse the data and visualise it in a user-friendly format so that we can understand it better. • AI modelling: AI modelling refers to developing AI models to get intelligent outputs after training the model. • Evaluation: In this phase of the AI project cycle, you test the model in many ways to check for accuracy. • Mean: The sum of the data values divided by the total number of data values is called the mean. It is also defined as the average value of a given data set. • Median: The middle value is known as the median. Before calculating the median, the data must be sorted in ascending order. • Mode: The value that appears the most frequently in the data set is the mode. • Standard Deviation: The standard deviation represents the dispersion in a set of data values around its mean value. We take the square root of the variance to obtain the standard deviation. • Variance: Variance is defined as the average of the squared deviations from the mean. • Data Visualisation: The graphical representation of data is known as data visualisation. Data visualisation tools make it easy to see and analyse data trends, anomalies, and patterns.

Things to Remember • Artificial Intelligence (AI) depends on data for its effectiveness. The quality and type of data fed into AI systems determine how smart they become. • We can categorise AI into three main domains based on the type of data they use: Data Science, Computer Vision, and Natural Language Processing. • There are different components of data science, which include working with statistics and analytical methods, visualisation of data, machine learning and deep learning. • Data science plays an important role in education, healthcare, entertainment, sports, internet searches, environment protection, retail, finance, transport, social media, etc. • A Python package is a set of codes or functions or modules. Modules linked to one another are often placed in the same package. • Numpy stands for Numerical Python. Numpy is a commonly used package when it comes to working around numbers. It supports arrays and matrices.

Unit Reflection

309


• OpenCV is an image processing package that can be used for image manipulation and processing, like cropping, resizing, editing, etc. • Matplotlib is capable of generating visually detailed representations through charts such as box plot, histograms, scatter plots, bar graphs, etc. • NLTK stands for Natural Language Tool Kit. It is a popular Python package for performing Natural Language Processing (NLP). • The name “Pandas” refers to “Panel Data” and “Python Data Analysis”. It is useful for handling two-dimensional data tables. • Numpy arrays store homogeneous (same type) data whereas lists can store heterogeneous (different types) data. • There are two types of data structures in Pandas: Series and DataFrame. • Series works like a column in a table. It is used to hold a one-dimensional array of any data type. • DataFrame is a fundamental data structure in Pandas. It represents a two-dimensional, and tabular data structure with labelled axes (rows and columns). • Statistical tools frequently used in Python are mean, median, mode, standard deviation, and variance. • ‘NaN’ values are commonly found in datasets. These are null values; they have no meaning and cannot be processed. As a result, these values are deleted from the database as they are found. • Outliers are data values that do not fall within the range of a particular element. • The K-Nearest Neighbour (KNN) algorithm is a basic supervised learning technique. It is a popular choice for solving classification and regression problems. • The KNN algorithm is useful for the interpolation of missing data values, i.e., it estimates the missing value based on the nearest known data point.

310


Test Your Knowledge A. Select the correct option. 1. Which data science component focuses on algorithms that enable machines to make predictions or decisions? a. Statistics

b. Data Visualisation

c. Machine Learning

d. Deep Learning

2. How do search engines like Google use data science to enhance search results? a. Providing customer reviews

b. Offering autocomplete suggestions

c. Displaying random content

d. Ignoring past searches

3. Which phase of the AI project cycle is best suited for using the 4Ws canvas to clearly define the problem? a. Data Acquisition

b. Modelling

c. Problem Scoping

d. Evaluation

4. In which scenario is a model said to be overfitting? a. When the model’s predicted values do not match the actual values at all. b. When the model’s predicted values match the actual values perfectly. c. When the model’s accuracy is consistently low. d. When the model tries to cover all input data samples, even if they don’t align with the actual values. 5. What is the output of the following code? import pandas as pd a = [9.1, 8.2, 7] x = pd.Series(a) print(x) a. A Pandas Series with a default integer index starting from 0 and values 9.1, 8.2, and 7. b. A Pandas DataFrame with a single row containing the values 9.1, 8.2, and 7. c. A Pandas Series with custom indices [‘a’, ‘b’, ‘c’] and values 9.1, 8.2, and 7. d. A Pandas Series with float indices and integer values.

B. Fill in the blanks with the most suitable words. 1. The function math.pow(2, 3) returns 2. A

.

is a graph that displays data distribution.

3. The box plots, or box and whiskers plots, present data distribution using 4. The

neighbours.

quartiles.

algorithm is based on the concept that the value for missing data will be close to the values of its nearest

5. In statistics, the middle value is known as the

.

C. State True or False. Correct the statements that are False. 1. Data Science involves analysing data to extract insights and knowledge. 2. Numpy is imported under the np alias. Unit Reflection

311


3. Evaluation refers to developing AI models for getting intelligent outputs after training the model. 4. Data science is used in banks and financial institutions to detect fraud and make smarter money decisions. 5. Python simplifies statistical analysis on datasets in data science.

D. Short-answer type questions. 1. Identify the error in the following code snippet: x = “10” y = 5 result = x + y print(result) 2. Write code in Python to read the CSV file saved in your system and display the first 5 rows of the CSV file. 3. Draw the graph the following code will generate: import matplotlib.pyplot as plt x =[6, 5, 9, 1, 2, 5, 12, 3, 4] y =[7, 3, 15, 9, 20, 8, 13, 8, 4] plt.scatter(x, y, c =”blue”) plt.show()

E. Long-answer type questions. 1. Differentiate between numpy arrays and lists. 2. Write Python code to create the following arrays: a. array([[5, 5, 5], [5, 5, 5], [5, 5, 5]]) b. array([[0., 0., 0.], [0., 0., 0.]]) 3. Explain the phases of the AI Project Cycle in the context of data science.

F. Competency-based questions. 1. Identify the type of model in Figure a and Figure b. Justify your answer.

Values

Values

Time

Fig. a

2. What will the following Python code do? import datetime x=datetime.datetime.now() print(x)

312

Time

Fig. b


Unit 5 • Computer Vision

18 Introduction to Computer Vision

I

n the previous chapters, we have explored the exciting world of artificial intelligence, learning how it works and where it is used. Now, let us dive into another interesting topic, Computer Vision, in this chapter.

You might have used a smartphone with a face lock feature. Have you ever wondered how your phone effortlessly recognises your face every time it opens the phone lock? This is because of computer vision. Let us now learn what computer vision is and how it is useful.

Computer Vision

Computer vision is a domain of artificial intelligence that enables computers and systems to extract meaningful information from digital images, videos, and other visual inputs, enabling them to act or recommend based on that information. If AI enables computers to ‘think’ then computer vision enables them to ‘see’, observe, and recognise. Apart from face locks in smartphones, Google Lens and self-driving cars are some popular examples of computer vision.

313


How Do Computers See?

Computer vision is a way for computers to ‘see’ and ‘understand’ the world around them. This is how it works: •

Computers use cameras to take pictures or videos of the world around them.

•

Softwares are used to analyse the images or videos to identify objects and patterns.

•

AI is used to make sense of the data collected and understand the information that the computer is ‘seeing’.

DOG DOG Applications of Computer Vision

Computer vision algorithms can be trained with a lot of visual data to process visuals at incredible speed and accuracy. These applications are available to everyone easily today and they are on the priority list of many industries. Let us explore some major applications of computer vision:

Facial Recognition

When you set up a face lock on your smartphone, you are teaching the device to recognise your unique facial features. Computer vision technology analyses the distinct details of your face, such as the arrangement of your eyes, nose, and mouth. It then saves these features as digital signatures and refers to them whenever required. So, every time you look at your phone, the computer vision technology compares what it ‘sees’ with the stored facial signature. If the match is successful, the phone unlocks, granting you access. This is how computer vision makes our devices smarter and more user-friendly.

Document Verification

Industries such as banking and finance, travel, property and real estate, law and legal services, and vehicle registration and verification are major areas where computer vision capabilities can be applied for accurate validation of the documents as quickly as possible. It helps in fraud detection, authenticating individuals, verifying ownership of property, identifying forfeited currency and documents.

314


Healthcare Services

Devices and sensors equipped with computer vision technology help with faster and more accurate diagnosis of diseases and health conditions. Realtime blood loss monitoring in patients during operations, locating tumours, internal infections, cardiovascular ailments, etc., can all be scanned to minimise the death rate.

Retail Industry

The shopping cart’s sensors can easily perform object identification of the items in the cart and match the details in the database using computer vision. Computer vision can help in taking inventory of items in stock for reorders and tracking the status of those items. Quicker checkouts at the mall exit, locating misplaced items, checking shoplifting, minimising billing errors, and identifying regular buyers and their preferences are the major benefits that can be harvested with the help of computer vision.

Image-Based Search

Taking a picture of an item and locating it on the internet is a common practice today. Finding items, people, and places can be highly efficient with computer vision technology. They also help in product comparison for variety, finding similar products, classifying items on physical features and people for agespecific or gender-specific services, consolidating product catalogues, etc.

Digital Audio-Visual Marketing The new trending innovation in digital marketing using computer vision, helps users create realistic visual content for the intended audience and customers. Companies like Lenskart and Zara use computer vision for virtual try-on experiences, allowing users to visualise how the items would look on them before making a purchase. This interactive application demonstrates the versatility and widespread adoption of computer vision across different industries.

Education and Training

Augmented reality (AR) and virtual reality (VR) learning experiences heavily rely on computer vision algorithms. These algorithms play a pivotal role in transforming static educational content into dynamic and interactive formats. For instance, computer vision is instrumental in generating 3D visuals from 2D images, enabling online classes, and enhancing virtual tour excursions. In essence, computer vision acts as a foundational tool for creators, allowing them to craft immersive educational content that fosters engaging and effective online learning environments.

Chapter 18 • Introduction to Computer Vision

315


Autonomous Vehicles

Computer vision plays a critical role in the development of autonomous vehicles. It allows these vehicles to ‘see’ and understand their surroundings, enabling them to navigate safely and efficiently. Self-driven cars, driverless trucks, pilotless planes, and hands-free driving assistance are some examples of CV applications. This involves the process of identifying the objects, finding their navigational routes, and at the same time monitoring the environment. However, adverse weather and unexpected events challenge accurate object detection. Also, ethical dilemmas and complex road situations require advanced decision-making.

Character, Sign, and Symbol Recognition

CV applications can recognise various scientific icons and optical codes. This enhances visual communication in tasks like interpreting traffic signs for self-driving vehicles, enabling Google Translate to convert text from images, and extracting information from images through pixel-based scanning.

Smart Homes and Cities

Computer vision in smart homes enables features like facial recognition for security, gesture-based controls for managing devices such as lighting, entertainment systems, and appliances, as well as monitoring for energy efficiency. In smart cities, CV aids in traffic management, public safety surveillance, and infrastructure monitoring to optimise urban planning and resource allocation.

Activity Thing Translator Let us perform the following experiment to understand how computer vision works. Objective: The Thing Translator application recognises the objects shown in front of the camera. It extracts the features of the object and matches them with the images in its database. Follow the given steps to explore how this application works. 1. Visit the following link: https://thing-translator.appspot.com/ 2. The following window appears.

316


3. Display an object in front of the camera and click on the round button on the screen. 4. The application will recognise the object and will display its name on the screen, as shown.

Activity Time Activity 1: Traffic Sign Detection Game

(Individual Activity)

Present students with various traffic signs. They have to identify and classify the traffic signs. They can then speak about the importance of traffic sign recognition in autonomous vehicles. Activity 2: Design a Futuristic City

(Group Activity)

Students can brainstorm and sketch ideas for a futuristic city that utilises computer vision for various purposes (e.g., smart traffic lights, self-regulating pedestrian crossings, automated waste management). They can create a presentation showcasing their ideas on how computer vision can contribute to a safer, more efficient future city. They can discuss potential challenges and solutions.

Chapter Checkup A Select the Correct Option. 1 If AI enables computers to think, then computer vision enables computers to ....................... a Smell

b See

c Listen

d Speak

2 What does CV stand for in the context of digital audio-visual marketing? a Computer Vision

b Consumer Vision

c Comprehension Vision

d Consequences Vision

3 In the application of computer vision in the retail industry, what can sensors in the shopping cart easily perform? a Employee attendance

b Identification of items

c Temperature of products

d Social media engagement

B Fill in the blanks with the most suitable words. 1 Computer vision enables computers to derive meaningful information from ...................... and videos. 2 ...................... recognition is commonly used as a security feature in handheld digital communication devices.

Chapter 18 • Introduction to Computer Vision

317


3 The application of computer vision in the ...................... industry includes performing object identification of items in the shopping cart. 4 Computer vision enables ...................... application to convert text from images. C

State whether the following statements are True or False. Correct the statements that are false. 1 Computer vision is a domain of artificial intelligence. 2 The application of computer vision in the retail industry does not involve tracking the status of items. 3 Autonomous vehicle routing-and-parking assistance is not an example of computer vision applications. 4 Computer vision is not applicable in the education sector.

D Answer the following questions. Q1. Explain one major benefit of using computer vision in the healthcare industry. A1. In the healthcare industry, devices and sensors equipped with computer vision technology help with faster and more accurate diagnosis of diseases and health conditions. Real-time blood loss monitoring in patients during operations, locating tumours, internal infections, cardiovascular ailments, etc., can all be scanned to minimise the death rate. Q2. Explore the applications of computer vision in autonomous vehicles, detailing its benefits and challenges. A2. Computer vision plays a critical role in the development of autonomous vehicles. It allows these vehicles to ‘see’ and understand their surroundings, enabling them to navigate safely and efficiently. Self-driven cars, driver-less trucks, pilot-less planes, and hands-free driving assistance are some examples of CV applications. This involves the process of identifying the objects, finding their navigational routes, and at the same time monitoring the environment. However, adverse weather and unexpected events challenge accurate object detection. Also, ethical dilemmas and complex road situations require advanced decision-making. Q3. Imagine you are designing a new application for the retail industry. How can adding computer vision to the application improve the shopping experience for customers? A3. Computer vision can improve the shopping experience of customers in many ways. Using computer vision, the shopping cart’s sensors can easily perform object identification of the items in the cart and match the details in the database. Computer vision can also help in taking inventory of items in stock for reorders and tracking the status of items. Quick checkout at the mall exit, locating misplaced items, checking shoplifting, minimising billing errors, and identifying regular buyers and their preferences are the major benefits to be harvested with the help of CV technology.

AI Activities Visit the link: https://quickdraw.withgoogle.com and let AI identify your drawing.

Answer Key A

1. b

B

1. Images

C

1. True.

2. a

3. b

2. Facial

3. Retail

4. Google Translate

2. False. The application of computer vision in the retail industry involves tracking the status of items.

3. False. Autonomous vehicles routing-and-parking assistance is an example of computer vision applications. 4. False. Computer vision is applicable in the education sector.

318


Unit 5 • Computer Vision

19 Understanding CV Concept C

omputer vision is a domain of AI that enables devices to interpret and understand visual information from the environment, such as images and videos. It plays a crucial role in many applications, including autonomous driving, medical imaging, facial recognition, and more. In computer vision, understanding pixels, resolution, and pixel values is crucial, as these concepts form the foundation for various image processing and analysis techniques. Grasping these basics helps effectively apply and develop methods for interpreting visual data.

Computer Vision Tasks

Computer vision encompasses a wide range of tasks that are essential for extracting meaningful information from images or videos. These tasks can either directly support predictions or provide foundational data for more complex analyses. Below are key tasks typically performed in computer vision applications:

For Single Objects

Classification

For Multiple Objects Object Detection

Classification + Localisation

Instance Segmentation

Image Classification

Image classification is the process of assigning an input image a label from a predetermined list of categories. Although it seems simple, this task is central to computer vision and forms the core of many real-world applications. The common applications of image classification include medical imaging, where it helps recognise diseases from scans, and online communities, where it can be used to categorise photographs according to their content.

Classification with Localisation

This task involves identifying both the object present in an image and its location within that image. It is specifically used for single objects. In applications such as robotics, where a robot must locate an object before interacting with it, or in surveillance systems, where locating individuals or objects is crucial, this process is essential for ensuring precise object positioning.

319


Object Detection

Object detection is the process of finding instances of real-world objects such as faces, cars, or animals in images or videos. Object detection algorithms typically use extracted features and learning algorithms to recognise instances of an object category. Object detection algorithms are helpful for many applications, such as self-driving vehicles, where it is important to recognise pedestrians and other cars, or the retail sector, where it can be used to track items on racks. These methods are used to identify and categorise every object in an image.

Instance Segmentation

A more detailed operation known as instance segmentation assigns labels to each pixel in an image corresponding to the object to which it relates, in addition to detecting and classifying objects. This leads to an accurate drawing of the boundaries of objects. When precise knowledge of the dimension and structure of each object is required, like in medical imaging for segmenting tumours or monitoring the environment for imagery from satellite analysis, instance segmentation plays a crucial role. Classification

Classification + Localisation

Object Detection

Instance Segmentaion

Activity Emoji Scavenger Hunt: An AI Game The Emoji Scavenger Hunt uses your phone’s camera and Google’s machine learning to identify real-world objects that match given emojis. The game presents an emoji, and you have to find and point your camera at a corresponding object within a time limit. The neural network running on your device attempts to recognise the object in real-time. The more emojis you match with real objects, the higher your score. This experiment demonstrates how machine learning and computer vision can be used for object recognition in a playful and interactive way. Follow the given steps to play the Emoji Scavenger Hunt: 1. Go to emojiscavengerhunt.withgoogle.com on your phone. You will be directed to a web page, as shown.

320


2. Click on the LET’S PLAY button to begin. 3. An emoji will be displayed, and you must locate a real-world object that matches it.

4. Point your camera at the object. The AI will attempt to recognise it and tell it what it is seeing.

5. Continue finding objects for each emoji until the timer runs out.

Chapter 19 • Understanding CV Concept

321


Basics of Image

An image is a graphical representation of data that can be used to portray a certain scene, idea, or concept or to capture a moment in time. Images are essential to many digital domains, such as website development, artificial intelligence, graphics design, and cinematography. Some important concepts of image are pixel, resolution, and pixel value. Let us discuss these concepts one-by-one.

Pixel

The smallest unit of a digital image is called a “picture element,” which is what the name “pixel” refers to. A digital photograph is made up of thousands or even millions of these pixels. Pixels are usually square but occasionally round and are carefully organised in a two-dimensional grid to form the entire image.

The example that follows shows how a portion of an image can be greatly magnified to show the individual pixels that make it up. Together, these pixels approximate the original image. The more pixels you have, the more closely the image resembles the original.

Resolution

Resolution refers to the total number of pixels contained within an image. Resolution determines the image’s clarity and detail. The image resolution increases with pixel count, making it possible to more accurately capture the minute details of the original scene. For this reason, compared to lower-resolution photographs, where each pixel can become more obvious and the image less polished, high-resolution images, with their more tightly packed pixels, look sharper and more detailed. The different ways to describe resolution are as follows: •

Resolution by Dimensions: One common way to describe resolution is by specifying the number of pixels along the width and height of an image, such as 1280 × 1024. Here, “1280” represents the number of pixels across the width, while “1024” represents the pixels from top to bottom. This method provides a clear understanding of the image’s structure and is often used when discussing display resolutions, such as on monitors, TVs, or smartphone screens.

•

Resolution by Pixel Count: Another approach to describing resolution is by using a single figure to represent the total pixel count. For example, consider a 12-megapixel camera. This camera captures images containing approximately 12 million pixels, which is determined by multiplying the image’s pixels along the width by its height. For example, an image with a resolution of 4000 × 3000 pixels has a total of 12 million pixels (4000 multiplied by 3000 equals 12,000,000 pixels), which is why it is referred to as a 12-megapixel image.

Higher resolution generally equates to finer detail and sharper images. The idea of pixel density—which is commonly expressed in pixels per inch, or PPI—is essential for assessing a digital image’s quality. A higher pixel density guarantees finer detail and smoother transitions, giving the image a more realistic appearance. Comprehending the function of pixels in digital imaging is crucial in domains such as graphic design, computer

322


vision, photography, medical imaging, video production, etc., where precise and high-quality images are required. In photography, a higher megapixel count allows for larger prints and more detailed zooming without losing clarity. In digital displays, higher resolution contributes to better image quality, making it possible to view more detailed content without noticeable pixelation.

Did You Know? The first digital image ever created was of a baby, captured in 1957. It was just 176x176 pixels.

Pixel Value

In digital imaging, every pixel that constitutes an image stored on a computer has an associated pixel value. This value determines the brightness and the specific colour of the pixel. The most common format for storing these pixel values is the byte image, where each pixel’s value is represented as an 8-bit integer. This format allows each pixel to have a value ranging from 0 to 255. In this context, a pixel value of 0 typically represents no colour or black, while a value of 255 represents full colour or white. Understanding the 255 Pixel Value Range The reason behind the maximum value of 255 lies in the way computers store and process data. Computers store data using a binary system, which is a base-2 number system comprising only two digits: 0 and 1. Each binary digit is known as a bit. When we talk about an 8-bit system, we mean that each pixel’s value is stored using 8 bits. Since each bit can have two possible values (0 or 1), an 8-bit sequence can represent 28 or 256 different values, ranging from 0 to 255. This gives us a total of 256 possible pixel values, providing a detailed spectrum of brightness or colour intensity in images. In practice, this 8-bit format is widely used because it offers a good balance between image quality and file size, making it suitable for various applications, from basic image storage to complex computer vision tasks. Number of bits

Different patterns

No. of pattems

No. of patterns

1

01

2^1

2

2

00 01 10 11

2^2

4

3

000 001 010 100 011 101 110 111

2^3

8

2^8 = 256

Did You Know? By using more bits per pixel, such as 16-bit or 32-bit formats, images can represent even finer gradations of colour and brightness, which is often necessary in professional imaging and scientific applications where precision is critical.

Grayscale Images

Grayscale images are a type of digital image that contains varying shades of grey without any visible colour. These shades range from black, the darkest possible shade which represents the complete absence of light and colour, to white, the lightest shade which represents the full presence of light and colour. The black shade is typically assigned a pixel value of 0, while white is assigned a pixel value of 255. The shades of grey in between are achieved by combining equal intensities of the three primary colours (red, green, and blue).

Think and Tell

What do you think would happen if a pixel in an image had a value outside the 0-255 range? How would it affect the image?

A grayscale image is defined by its individual pixels, which are each saved as a single byte. These pixels combine to form a 2D array, or a single plane. The size of a grayscale image is defined as the height x width of that image. Chapter 19 • Understanding CV Concept

323


Take a look at this sample to get a better understanding of grayscale images. You can see that the image’s pixel values span from 0 to 255. The computer stores such images in the form of these numbers.

Grayscale images are foundational in various fields, particularly in image processing and computer vision. Since these images are simpler than colour images, they require less computational power and memory for processing. This simplicity makes them ideal for tasks such as edge detection, and object recognition. For instance, in medical imaging, grayscale images are commonly used in X-rays and MRIs, where the focus is on the structure and density of tissues rather than their colour.

RGB Images

We look at various coloured images in our daily lives. These coloured images are composed of three primary colours: red, green, and blue, collectively known as RGB. In an RGB image, each pixel is essentially a mix of red, green, and blue components. By adjusting the intensity of these components, a wide range of colours can be created. For instance, when all three colours are combined at their maximum intensity, the result is white. Conversely, when they are all at zero intensity, the result is black. By fine-tuning the individual levels of red, green, and blue, virtually any colour can be achieved, enabling the rich and varied visual experiences that digital images provide. Every RGB image is stored in the form of three different channels called the R channel, the G channel, and the B channel. In the image below, if we separate the image into its three channels, each channel will display varying intensities for the individual pixels. When viewed independently, these channels appear as grayscale images, reflecting the intensity values for each pixel within that channel. We already know that these intensities range from 0 to 255, where 0 represents the absence of colour (black) and 255 represents the full presence of colour (white). In other words, we can say that all three planes, when combined form a colour image. This means that in a RGB image, each pixel has a set of three different values which together give colour to that particular pixel.

R

G

B

RGB colour representation is foundational in various fields such as digital imaging, computer graphics, and visual media. Understanding how these colours interact is crucial for tasks like image processing, colour correction, and even designing user interfaces where colour plays a vital role in the user experience. By mastering the principles of RGB, one can gain deeper insights into how digital devices render the vibrant world we see on screens.

324


Activity RGB Calculator

The RGB calculator helps you convert colours between different formats, such as RGB, HEX, and HSL. It also allows you to adjust the individual red, green, and blue (RGB) components of colour to see how they combine to create different colours. Let us perform the following steps to demonstrate the use of the RGB calculator:

1. Visit the https://www.w3schools.com/colors/colors_rgb.asp web link. You will be directed to a web page, as shown.

2. Drag the sliders for red, green, and blue to adjust their levels and mix these colours. The resultant colour will be displayed in real-time as you move the sliders, allowing you to see how different combinations affect the final colour.

3. To display black, set all colour parameters to 0: rgb (0, 0, 0).

4. To display white, set all colour parameters to 255: rgb (255, 255, 255). 5. To display grey, set all colour parameters as equal.

Activity Creating Pixel Art Piskel is a free online pixel art and animated sprite editor. Artists and game developers often use it to create sprites and animations for games. It is popular for its user-friendly interface and ease of use. Chapter 19 • Understanding CV Concept

Error Alert! Misconception: RGB images are always better than grayscale images for computer vision tasks. Solution: The choice between RGB and grayscale depends on the specific task; grayscale is often more efficient for tasks that don’t require colour information.

325


Follow the give steps to create a pixel art:

1. Visit the www.piskelapp.com link. You will be directed to a web page, as shown.

2. Click on the Create Sprite button.

3. Create a new sprite in the frame using the various tools available in the toolbar on the left. For example, you can use the Dithering tool to draw your sprite and then apply the Paint bucket tool to fill it with colours.

3. Click on the EXPORT button located on the right-hand side of the bar.

4. From the GIF tab, click on the Download button to download the created sprite as an animated GIF.

The sprite is downloaded. You can then use the created sprite.

326


Image Features In the field of computer vision and image processing, a ‘feature’ refers to a distinct piece of information within an image. These features plays a crucial role in addressing specific computational tasks or solving problems associated with particular applications. They can manifest as various structural elements in an image, such as points, edges, textures, or even larger entities like objects. Identifying and analysing features within an image is foundational to various computer vision applications. For instance, in facial recognition systems, key facial features like the eyes, nose, and mouth are extracted and compared against a database to verify identity. Similarly, in autonomous driving, features such as road signs, lane markings, and obstacles are detected to guide the vehicle’s decisions. The importance of features extends beyond simple detection; they also enable more complex tasks such as image segmentation, where an image is divided into different regions based on feature similarities, and image classification, where features are used to categorise images into predefined classes. Understanding how to extract and utilise these features effectively is crucial for developing robust computer vision systems that can perform reliably in diverse real-world scenarios. Example: Locating Image Patches Let us consider a scenario where a security camera captures an image. At the top of this image, you are presented with six small image patches—each containing a distinct visual pattern. Your objective is to accurately identify and pinpoint the exact location of each of these patches within the larger image. For this, take a pencil and carefully mark the precise locations where these patches appear in the image.

A

C

E

B

D

F

Now, answer the following questions: •

Were you able to locate all the patches precisely?

•

Which patch was the most challenging to locate?

•

Which patch was the easiest to locate?

Let us examine each patch individually and then determine their exact locations. •

For Patches A and B: These patches cover flat surfaces in the image and occupy a large area. However, their location within this area can vary, making it difficult to pinpoint their exact position. The expansive nature of these patches contributes to the challenge, as there are numerous potential locations where they could be found.

•

For Patches C and D: These patches represent the edges of a building and are simpler to identify compared to A and B. While it is possible to approximate their locations due to the linear nature of the edges, finding the exact location still remains challenging. This difficulty arises because the pattern along the edge is consistent, making it hard to distinguish one part of the edge from another.

Chapter 19 • Understanding CV Concept

327


•

For Patches E and F: These patches are the easiest to locate within the image. They represent the corners of the building, which are distinctive because the visual pattern changes sharply at these points. Unlike the edges, where the pattern remains consistent, the corners offer unique visual cues that make it easier to identify the precise location of these patches.

The difficulty in locating these patches can be linked to the inherent properties of the image features they represent. Flat surfaces (Patches A and B) offer fewer unique identifiers, resulting in ambiguity. Edges (Patches C and D), while more defined, still present challenges due to repetitive patterns. Corners (Patches E and F), on the other hand, serve as natural anchors in an image, offering the most distinctive features for precise identification.

Activity Time (Group Work)

Activity 1: Computer Vision Tasks

Form groups of 3 or 4 students. Assign each group a computer vision task: image classification, classification with

localisation, object detection, or instance segmentation. Ask them to discuss how these tasks are applied in real-world scenarios. Encourage the students to share any personal experiences or knowledge related to these tasks, such as

interactions with facial recognition technology or autonomous driving systems. Each group will present their discussions to the class.

(Individual Work)

Activity 2: Hands-On Task

Provide students with an image containing several small patches, each representing different features like edges, corners,

or flat surfaces. Students will attempt to locate and mark the exact positions of these patches within the larger image. After completing the task, have students reflect on which patches were easier or more difficult to locate and discuss how these features play a role in computer vision tasks such as object detection and image matching.

(Individual Work)

Activity 3: Research Work

Students will conduct research on the applications of AI and computer vision in their local community. They should explore areas such as security surveillance, healthcare imaging, or retail automation. Students will write a report detailing their findings, focusing on how these technologies are used, their benefits, and any ethical concerns that might arise. Each student will present a summary of their report to the class.

Chapter Checkup A Select the correct option. 1 In the context of pixel values in a grayscale image, what does a pixel value of 0 typically represent? a White b Grey

c Black d Transparent

2 Which method in computer vision assigns tags to each pixel in an image corresponding to the object it relates to? a Image Classification

b Classification with Localisation

c Object Detection

d Instance Segmentation

3 What is the primary purpose of resolution in an image? a To determine the colour intensity

b To specify the pixel values

c To measure the brightness

d To indicate the image’s clarity and detail

4 In RGB images, combining all three colours at their maximum intensity results in which colour? a Black b Grey c White d Red

328


B Fill in the blanks with the most suitable words. 1 The simplest unit of a digital image is known as ....................... 2 In an 8-bit image, pixel values range from 0 to ....................... 3 ...................... refers to the total number of pixels in an image, influencing its clarity and detail. 4 In computer vision, ...................... involves recognising and locating multiple objects within an image. C

State whether the following statements are True or False. Correct the statements that are false. 1 Higher resolution results in more pixelation and less clarity in an image. 2 Image classification involves both identifying the object and pinpointing its location within the image. 3 Emoji Scavenger Hunt uses your phone’s camera to identify real-world objects that match given emojis. 4 The RGB colour model is used primarily for grayscale images.

D Answer the following questions. (Solved) Q1. What is the significance of pixel density in digital images? A1. Pixel density, often measured in pixels per inch (PPI), is crucial for determining the sharpness and detail of an image. Higher pixel density results in finer detail and smoother transitions in an image, making it appear more realistic. Q2. Explain the role of resolution in digital imagery and how it affects the quality of images in different applications. A2. Resolution refers to the total number of pixels contained within an image. Resolution determines the image’s clarity and detail. The concept of resolution is essential not only in digital imagery but also in fields like photography, printing, and display technology. Higher resolution generally equates to finer detail and sharper images, which is crucial for applications like digital photography, medical imaging, and graphic design. In photography, a higher megapixel count allows for larger prints and more detailed zooming without losing clarity. In digital displays, higher resolution contributes to better image quality, making it possible to view more detailed content without noticeable pixelation. Q3. You are implementing a facial recognition system in a crowded environment. Which computer vision task would you use to detect and identify faces? A3. Object detection

AI Activities 1 V isit the link: https://www.youtube.com/watch?v=taC5pMCm70U to learn about image classification vs object detection vs instance segmentation. 2 Visit the link: https://www.youtube.com/watch?v=wsFROq2jVSQ to learn about the concept of pixel.

Answer Key A

1. c

2. d

3. d

B

1. pixel

2. 255

3. Resolution

C

1. False. Higher resolution results in less pixelation and more clarity in an image.

4. c 4. Object Detection

2. F alse. Image classification involves only identifying the object, not its location. 3. True.

4. False. The RGB colour model is used primarily for colour images.

Chapter 19 • Understanding CV Concept

329


Unit 5 • Computer Vision

20 Introduction to OpenCV

A

n open-source software library for computer vision and machine learning is called OpenCV, short for Open Source Computer Vision Library. It was initially created by Intel and is currently operated by the OpenCV Foundation, a community of developers and researchers. The library contains about 2500 effective algorithms, spanning a broad spectrum of traditional and cutting-edge computer vision and machine learning methods. In addition to many other tasks, these algorithms can identify objects, detect faces, classify human behaviour in videos, locate identical images from an image database, track eye movements, and much more.

Python OpenCV Library

OpenCV is a powerful library for computer vision tasks in Python and various other programming languages. It provides a wide range of functionalities for tasks such as image and video processing, object detection, machine learning, and more. You can install the OpenCV library by performing the following steps: 1. Open the Anaconda Prompt from the Start menu.

330


2. Type the following command: pip install opencv-python he process of installing the OpenCV begins. After completing the process of installing, the OpenCV library gets T installed, as shown in the figure:

Now, you can import the OpenCV library by using the following code snippet in the Jupyter Notebook: import cv2 # import OpenCV There are various functions of OpenCV to carry out various image processing techniques such as resizing, cropping, etc. Now, let us perform some basic image processing operations on the image that follows:

Loading Images using Imread Function

The imread() function of cv2 is used to read an image from the specified file path into a NumPy array. The following code is used to load image using imread function: import cv2

from matplotlib import pyplot as plt # import matplotlib import numpy as np # import numpy

img = cv2.imread('Flower.jpg') #Load the image file into memory plt.imshow(img) plt.title('Flower') plt.axis('off')

Remember If the image file is in the same folder as your notebook, you can simply use the file name. Otherwise, provide the full path to the image file like this: cv2.imread ('C:/path/to/your/image.jpg')

plt.show()

Chapter 20 • Introduction to OpenCV

331


The code loads and displays an image using OpenCV and Matplotlib respectively. It imports the necessary libraries, reads the image Flower.jpg into a variable, and then displays it using Matplotlib’s imshow function with the title “Flower” and no axes. The plt.axis(‘off’) command in Matplotlib is used to hide all axis elements, including axis labels, grid lines, etc. Note that OpenCV loads images in BGR format, so converting the image to RGB with cv2.cvtColor is recommended for accurate colour display. The output of the following code is as follows:

Notice that the colours are not represented properly. This is because the OpenCV interprets images in BGR format rather than the expected RGB format. This causes images to display with a predominance of blue hues.

Did You Know? OpenCV can remove red-eye effects from photos taken with flash.

Convert the BGR Colour Format to RGB

The cv2.cvtColor() function in OpenCV is used to convert an image from one colour space to another. The following code is used to convert the BGR colour format to RGB colour format: import cv2

from matplotlib import pyplot as plt import numpy as np

img = cv2.imread('Flower.jpg') #Load the image file into memory plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) plt.title('FLower') plt.axis('off') plt.show()

The output of the code is as follows:

You can see that now you have the correct colour representation for the image.

332


Convert the image in Grayscale Colour Mode

The cmap attribute of the imshow() function in Matplotlib is used to specify the colormap to be used when displaying an image. Also, interpolation=’bicubic’ means the image is smoothed by averaging the closest 16 pixels when resizing or displaying, resulting in a clearer and more detailed image. The following code is used to show an image in grayscale colour mode: import cv2 from matplotlib import pyplot as plt import numpy as np img = cv2.imread('Flower.jpg',0) # the number zero opens the image as a grayscale image plt.imshow(img, cmap = 'gray', interpolation = 'bicubic') #cmap specifies color mapping, gray in this case. plt.title('Flower') plt.axis('off') plt.show() The output of the following code is as follows:

We can clearly see that the image gets converted into a grayscale image.

Getting Information about Your Image

You can pass the object or function you need help with directly to the help function. Another method is to place a question mark ‘?’ before or after the object or function name. This will open a pop-up window with the documentation to understand how to use these objects or functions in your Jupyter Notebook environment. The following code demonstrates how we can get information about our image: import cv2 img = cv2.imread('Flower.jpg') img? The output of the following code is as follows: Type:

ndarray

String form: [[[232 161 157] [232 161 157]

Chapter 20 • Introduction to OpenCV

333


[232 161 157] ... [170 61 83] [170 61 83] [169 60 <...> 79 81] [186 79 81] [186 79 81] ... [171 40 73] [169 39 72] [166 36 69]]] Length: File:

1018 c:\users\dell\appdata\local\programs\python\python312\lib\site-packages\numpy\__init__.py

Docstring: ndarray(shape, dtype=float, buffer=None, offset=0, strides=None, order=None) You can see that the flower image is represented by a numpy array because the type associated with the image is numpy. Now, let us see the size of the image using the shape attribute of the img function. The following code is used to know the dimensions of the image: import cv2 img = cv2.imread('Flower.jpg') print(img.shape) The output of the following code is as follows: (1018, 1824, 3) In the given code, the shape attribute retrieves the dimensions of the image NumPy array. For a coloured image, img.shape would return a tuple (height, width, channels), where height is the number of rows (pixels from top to bottom) and width is the number of columns (pixels from left to right). This means that our image has the height of 1018 px and width of 1824 px. Therefore, there are 1018 x 1824 = 1,856,832 px (equivalent to 1.86 megapixels approximately). Here, channels represent the number of coloured channels. There are three channels RGB, therefore, the number ‘3’. For a grayscale image, img.shape would return a tuple (height, width). A grayscale image does not have coloured channels, RGB associated with it. The following code is used to know the dimensions of the grayscale image: import cv2 from matplotlib import pyplot as plt img = cv2.imread('Flower.jpg',0) # the number zero opens the image as a grayscale image plt.imshow(img, cmap = 'gray', interpolation = 'bicubic') #cmap specifies color mapping, gray in this case. plt.title('Flower')

334


plt.axis('off') plt.show() print(img.shape) The output of the following code is as follows:

(1018, 1824) Notice that there are no longer 3 channels in a grayscale image.

Accessing Pixels

The following code is used to know the RGB value of a particular pixel in an image: import cv2 from matplotlib import pyplot as plt img = cv2.imread('Flower.jpg') plt.imshow(cv2.cvtColor(img,cv2.COLOR_BGR2RGB));plt.axis('on');plt.title('RGB') plt.show() [B,G,R] = img[505, 256] print('The RGB value is: Red=', R, 'Green=', G, 'Blue=',B) The output of the following code is as follows: RGB

The RGB value is: Red= 105 Green= 90 Blue= 175

Chapter 20 • Introduction to OpenCV

335


Splitting Colour Channel

Splitting a colour image into its individual colour channels (Red, Green, and Blue) can be done easily using OpenCV in Python. The cv2.split function is used to split the image into its three colour channels. The following code is used to split a colour image into its individual colour channels: import cv2 from matplotlib import pyplot as plt img = cv2.imread('rgb.png') #Load the image file into memory plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB));plt.axis('off');plt.title('RGB') #Split channel b = img[:,:,0] g = img[:,:,1] r = img[:,:,2] fig, bgr = plt.subplots(1,3) bgr[0].imshow(cv2.cvtColor(b, cv2.COLOR_BGR2RGB));bgr[0].axis('off');bgr[0].set_title('Blue'); bgr[1].imshow(cv2.cvtColor(g, cv2.COLOR_BGR2RGB));bgr[1].axis('off');bgr[1].set_title('Green'); bgr[2].imshow(cv2.cvtColor(r, cv2.COLOR_BGR2RGB));bgr[2].axis('off');bgr[2].set_title('Red'); plt.show() The output of the following code is as follows:

The image is split into its three colour channels: Blue (b), Green (g), and Red (r), by indexing into the third dimension of the img array. Each of the colour channels is displayed separately using subplots, and the axes are turned off for each image. It also has titles.

Cropping Images

To crop an image using OpenCV in Python, you can specify a region of interest (ROI) by defining the starting and ending coordinates of the area you want to crop. This is done using Python slicing on the NumPy array representing the image. NumPy slicing works as img[y1:y2, x1:x2], where (y1, x1) is the top-left corner and (y2, x2) is the bottom-right corner of your ROI. The following code is used to crop an image: import cv2 from matplotlib import pyplot as plt

336


img = cv2.imread('Flower.jpg') plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB));plt.axis('on');plt.title('Flower') plt.show() roi = img[50:1200,50:1300] #img[range of y, range of x] plt.imshow(cv2.cvtColor(roi, cv2.COLOR_BGR2RGB)) plt.title('Cropped Flower') plt.show() The output of the following code is as follows:

Turning on the axis by using the plt.axis (‘on’) function makes it easier to find the ROI to crop the image.

Changing Pixel Value

In image processing, changing pixel values is essential for various tasks such as filtering, enhancement, and analysis. By modifying pixel values, we can reduce noise, sharpen or smooth images. Changing pixel values also helps in segmenting and masking, highlighting regions of interest, and extracting features like edges and corners. Additionally, pixel value changes enable image blending and fusion for creating composites and augment data for training machine learning models by generating variations in images. The following code is used to change the pixel value of an image: import cv2 from matplotlib import pyplot as plt img = cv2.imread('Flower.jpg') img[75:350,250:550] = [250,25,20] plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) plt.title('Flower') plt.axis('on') plt.show()

Chapter 20 • Introduction to OpenCV

Did You Know? You can see the minimum and maximum pixel value present in the image using the commands print (img.min()) and print (img.max()) respectively.

337


The output of the following code is as follows:

Think and Tell In what ways do you think machine learning algorithms enhance the functionalities provided by OpenCV?

Here, the colour of the rectangular ROI defined by img[75:350, 250:550] is changed to a shade of blue. It’s important to note that the colour value [250, 25, 20] is in BGR format, as OpenCV utilises this colour representation.

Copying a Part of the Image

Copying a part of an image in OpenCV involves selecting a region of interest (ROI) from the image and copying it to another part of the same image or a different image. The following code is used to extract the part of an image: img = cv2.imread('Flower.jpg') extracting = img[50:300,320:620] plt.imshow(cv2.cvtColor(extracting, cv2.COLOR_BGR2RGB)) plt.title('Extracting Part of Image') plt.axis('on') plt.show() The output of the following code is as follows:

The following code is used to copy the part of image somewhere in it: img = cv2.imread('Flower.jpg') extractimage = img[50:300,320:620] img[550:800,1450:1750]=extractimage plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) plt.title('Copy Extracted Image') plt.axis('on') plt.show()

338


The output of the following code is as follows:

Copy Extracted Image

Resizing Image

The resize() function of OpenCV is used to resize an image. The following code is used to resize an image: import cv2 from matplotlib import pyplot as plt img = cv2.imread('Flower.jpg') resized = cv2.resize(img, (400, 400)) plt.imshow(cv2.cvtColor(resized, cv2.COLOR_BGR2RGB)) plt.title('Flower') plt.axis('on') plt.show() print(resized.shape) The output of the following code is as follows:

(400, 400, 3)

Chapter 20 • Introduction to OpenCV

339


The image is resized but it appears distorted due to uneven aspect ratio. Resizing an image while maintaining its aspect ratio is a common task in image processing. To resize an image with its aspect ratio preserved using OpenCV, you typically calculate the scaling factor based on either the desired width or height and then resize the image accordingly. The following code is used to resize an image, while maintaining the aspect ratio: img = cv2.imread('Flower.jpg') resized=cv2.resize(img,(int(img.shape[1]/4),int(img.shape[0]/4))) plt.imshow(cv2.cvtColor(resized, cv2.COLOR_BGR2RGB)) plt.title('Flower') plt.axis('on') plt.show() print(resized.shape) The output of the following code is as follows:

Error Alert! Misconception: Resizing an image in OpenCV always maintains the aspect ratio. Solution: Calculate the scaling factor to maintain the aspect ratio when resizing.

The cv2.resize function returns a new image that is a quarter of the original size (both in width and height) and assigns it to the variable resized.

Saving an Image

The imwrite function in OpenCV is used to save an image to a specified file. The following code is used to save an image: img = cv2.imread(‘Flower.jpg’) resized=cv2.resize(img,(int(img.shape[1]/4),int(img.shape[0]/4))) cv2.imwrite(‘Original_Flower.jpg’,img) cv2.imwrite(‘Resized_Flower.jpg’,resized) The output of the following code is as follows: True

340


Activity Time Activity 1: Group Discussion

(Group Work)

Organise a discussion on the applications of OpenCV in different industries. Divide students into groups, each representing a different industry (e.g., healthcare, automotive, security, entertainment). Each group should research and present how OpenCV is being used in their industry, highlighting the benefits and challenges. Activity 2: Creating a Presentation

(Individual Work)

Assign students to create a presentation on a specific function or feature of OpenCV (e.g., resizing, cropping, etc). They should explain the function, provide code examples, and demonstrate the feature with sample images or videos.

Chapter Checkup A Select the correct option

1 Which function in OpenCV is used to display help or documentation about a function or object? a help() b info() c doc() d describe() 2 What is the correct command to install OpenCV using pip? a pip install opencv

b pip install opencv2

c pip install opencv-python

d pip install python-opencv

3 In which colour format does OpenCV interpret images by default? a RGB

b CMYK c BGR

d HSV

4 What does the cmap attribute in Matplotlib’s imshow() function specify? a The path of the image file b The color map to be used when displaying an image or array c The size of the image d The format of the image 5 In OpenCV, how can you crop an image represented as a NumPy array? a By specifying the coordinates of the top-left and bottom-right corners using the syntax img[y1:y2, x1:x2]. b By using the cv2.crop() function to define the region of interest. c By applying a mask to the image and selecting the desired region. d None of these. B Fill in the blanks with the most suitable words. 1 OpenCV is a powerful library for computer vision tasks in ...................... and various other programming languages. 2 The ...................... function of cv2 is used to read an image from the specified file path into a NumPy array. 3 The ...................... function is used to split the image into its three colour channels. 4 The ...................... function in OpenCV is used to save an image to a specified file.

Chapter 20 • Introduction to OpenCV

341


C

State whether the following statements are True or False. Correct the statements that are false. 1 OpenCV was initially created by Apple. 2 OpenCV provides functionalities only for image processing. 3 The plt.axis(‘off’) command in Matplotlib is used to hide all axis elements. 4 We can see the size of the image using the shape attribute of the img function.

D Answer the following questions. (Solved) Q1. What is the imread() function used for in OpenCV? A1. The imread() function is used to read an image from the specified file path into a NumPy array. Q2. Explain the process of resizing an image while maintaining its aspect ratio in OpenCV. A2. To resize an image while maintaining its aspect ratio in OpenCV, you first calculate the scaling factor based on either the desired width or height. Once you have the scaling factor, you use it to calculate the new dimensions of the image while preserving the aspect ratio. Finally, you use the resize() function to resize the image to the new dimensions. Q3. Explain the purpose of the cv2.cvtColor function. A3. The cv2.cvtColor function is used to convert an image from one colour space to another, such as from BGR to RGB, ensuring accurate colour representation when displaying images with Matplotlib. Q4. Natasha is developing an application using OpenCV to identify faces and track eye movements in video feeds. Which features of OpenCV can she utilise to achieve these tasks effectively? A4. Natasha can utilise OpenCV’s face detection algorithms to identify faces and its eye-tracking algorithms to monitor eye movements. The library provides a variety of algorithms specifically designed for tasks like face detection and eye tracking.

AI Activities 1 Visit the link: https://youtu.be/oUJs03eZ0S8?list=PLKnIA16_RmvYXDBJ5WRDuQRSzFJs93pYR to learn about image processing using OpenCV. 2 Visit the link: https://youtu.be/ur8IHlbs3oM to learn about OpenCV.

Answer Key A

1. a

B

1. Python

C

1. False. OpenCV was initially created by Intel.

2. c

4. b

2. imread()

5. a 3. cv2.split()

4. imwrite()

2. False. OpenCV provides functionalities for tasks such as image and video processing, object detection, machine learning, and more. 3. True

4. True.

342

3. c


Unit 5 • Computer Vision

21 Understanding Convolution Operator**

C

omputers store images as numbers. Each image is made up of tiny squares called pixels. The arrangement of these pixels creates the picture we see. Each pixel can have a value from 0 to 255, which determines its colour.

When we change these numbers, we change the image. This is how image editing works. By altering the pixel values, we can modify the image. Many of us use image editing software like Photoshop. We also use apps like Instagram and Snapchat, which have filters to improve the look of our pictures. These filters work by changing the pixel values to make the image look better. Additionally, image editing can include cropping, resizing, and adjusting brightness or contrast. More advanced techniques involve adding special effects, removing unwanted elements, or combining multiple images. All these processes rely on manipulating the pixel values to achieve the desired results.

Original Image

Brightness

Contrast

Warmth

Solarise

Posterise

Noise

Grayscale

Pixelate

** Note: This chapter is optional as per the CBSE syllabus and may not be covered in assessments.

343


Convolution

A fundamental mathematical action called convolution is essential to many common image processing methods. It involves the multiplication of two numerical arrays, usually of the same dimensionality but different sizes, to generate another array with the same dimensionality. Convolution is the process of multiplying an image array element-by-element with another array called the kernel and then adding up the results. To put it simply, imagine you have a grid of numbers representing an image and another smaller grid (the kernel) representing a filter. You place the kernel array over the image array, multiply the overlapping numbers, add them up, and record the result. You then move the kernel to the next position and repeat the process until the entire image has been processed. This creates a new grid of numbers (the output image) where each value reflects the combined effect of the original image array and the kernel array. Weighted sum for the pixel value in the output image = (1×1) + (0×0) + (0×1) + (1×0) + (1×1) + (0×0) + (1×1) + (1×0) + (1×1)

0

1

0

0

1 1×1 0×0 0×1

0 1×0 1×1 0×0

0

0

0 1×1 1×0 1×1

= 1+0+0+0+1+0+1+0+1

0

0

0

1

1

0

0

=4

0

0

1

1

0

0

0

0

1

1

0

0

0

0

1

1

0

0

0

0

0

Where I is the image array, K is the kernel array, and I*K is the resulting array.

I Convolution is used in various applications, such as sharpening or blurring images, edge detection, and applying artistic effects. By changing the values in the kernel, you can achieve different results and enhance specific features of the image. Experimenting with different kernels helps in understanding how convolution affects an image and why it is a crucial tool in image processing.

*

1

0

1

0

1

0

1

0

1

K

=

1

4

3

4

1

1

2

4

3

3

1

2

3

4

1

1

3

3

1

1

3

3

1

1

0

I*K

Think and Tell

Why is convolution important in image processing and computer vision?

Kernel

The kernel plays a crucial role in convolution by determining how each pixel in an image is transformed, thereby influencing the overall appearance of the image. A kernel is a small grid that we move over an image, multiplying its values with the image’s pixels to change it in a specific way. Different effects, such as sharpening or blurring, are achieved by adjusting the values within the kernel. When we modify the values of the kernel, we alter the outcome of the convolution process. This means that changing the kernel’s values can produce varied visual effects on the image. For example, increasing the intensity of the sharpening kernel will enhance the clarity of the edges, making the image appear more defined. Conversely, adjusting a blurring kernel will soften details, resulting in a smoother and more diffused appearance across the image. In image processing, we use convolution to extract features from images, which is especially important in Convolutional Neural Networks (CNNs). You will study about CNNs in the next chapter. To perform convolution, we align the centre of the kernel with each pixel in the image. This process can make the output image smaller than the original because the edges aren’t fully covered. To keep the output image the same size as the input, we add padding around the edges of the input image, usually with zeros. By padding the image, we ensure that the convolution operation covers the entire image, maintaining the same dimensions for both the input and output images. This technique is crucial for preserving the size of the image during various processing stages, particularly in CNNs.

344


Let us try an example to get the resultant array when the image array and kernel array are as follows: 0

1

1

0

1

0

1

1

0

1

1

0

1

1

1

1

0

1

1

0

Output:

0

0

1

0

1

1

1

1

0

Image Array

0

0

0

0

1

Kernel Array

The resultant array is:

Activity Image Kernels Explained Visually The “Image Kernels Explained Visually” by Setosa.io offers an interactive explanation of image kernels. It provides visual demonstrations of how different kernels affect an image and allows users to experiment with various kernels, upload their own images, or use live video to see the effects in real-time. Follow the given steps to perform this activity: 1. Visit the following link: https://setosa.io/ev/image-kernels/. It directs you to a web page with the heading ‘Image Kernels’. 2. You can apply a 3 x 3 kernel to an image of a face provided on the web page in an interactive manner. For this, you need to hover your mouse over the different pixels of the 'input image' on the web page and select different values for the kernel from the drop-down menu. These computations will result in different kernel values ultimately producing a new 'output image'.

Chapter 21 • Understanding Convolution Operator**

345


3. Now, scroll down the web page and click on the Choose File tab.

4. The Open dialog box opens. Navigate to the location and select an input image file that you want to upload. 5. Click on the Open button.

6. The image will be uploaded to the website. Select the effect that you want to apply to the image from the drop-down list. Here, we have selected the blur effect.

346


7. The blur effect is applied to the image. Also, notice that the value of the kernel is changed according to the selected effect.

Activity Time Activity 1: Group Discussion

(Group Work)

Divide participants into groups. Assign each group a specific kernel (e.g., sharpening, blurring). Have them upload different images on the site https://setosa.io/ev/image-kernels/ and apply convolution using different kernel values. Discuss the results and how different kernel values impact image appearance. Activity 2: Prepare presentation

(Individual Work)

Assign students the task of creating a presentation. The presentation should explain the fundamentals of image processing techniques with a focus on convolution operations. Discuss the applications of convulation in editing and enhancing images. Activity 3: Research Work

(Individual Work)

Assign students to research advanced applications of convolution in image processing. Explore scholarly articles and technical papers on the evolution of convolution techniques. Emphasise recent developments and future trends.

Chapter Checkup A Select the correct option 1 What is each tiny square in a digital image called? a Bit

b Byte

c Pixel

d Kernel

2 What range of values can each pixel have in a digital image? a 0 to 100

b 0 to 255

c 1 to 256

d 0 to 1023

3 What does convolution in image processing help us with? a Changing file names

b File compression

c Sharpening or blurring images

d None of these

Chapter 21 • Understanding Convolution Operator**

347


B Fill in the blanks with the most suitable words. 1 Apps like Instagram and Snapchat, have ....................... to improve the look of pictures. 2 The process of placing a kernel over an image and multiplying overlapping numbers and then adding up results is called ........................ 3 Padding is often added around the edges of an input image to maintain the same ....................... for both the input and output images during convolution. 4 CNN stands for ....................... . C

State whether the following statements are True or False. Correct the statements that are false. 1 Image editing can include cropping, resizing, and adjusting brightness or contrast. 2 Convolution is only used for applying artistic effects to images. 3 Changing the kernel’s values during convolution can produce different visual effects on the image. 4 To perform convolution, we align the centre of the kernel with each pixel in the image.

D Answer the following questions. (Solved) Q1. What is convolution? A1. Convolution is the process of multiplying an image array element-by-element with another array called the kernel and then adding up the results. Q2. How does the kernel play a crucial role in convolution? A2. The kernel plays a crucial role in convolution by determining how each pixel in an image is transformed, thereby influencing the overall appearance of the image. A kernel is a small grid that we move over an image, multiplying its values with the image’s pixels to change it in a specific way. Different effects, such as sharpening or blurring, are achieved by adjusting the values within the kernel. When we modify the values of the kernel, we alter the outcome of the convolution process. This means that changing the kernel’s values can produce varied visual effects on the image. Q3. Emma wants to enhance a recent photo using Instagram filters. She notices that the filter she chooses significantly alters the colours and lighting of her picture. Describe how Instagram filters work to improve the appearance of photos. A3. Instagram has filters to improve the look of pictures. These filters work by changing the pixel values to make the image look better. Convolution allows for the manipulation of pixel values to achieve various effects and enhancements in the image, improving the overall image quality.

AI Activities 1 Visit the link: https://www.youtube.com/watch?v=Etksi-F5ug8 to learn more about convolution.

2 Visit the link: https://www.youtube.com/watch?v=YgtModJ-4cw to learn how convolution works.

Answer Key A

1. c

2. b

3. c

B

1. filters

2. convolution

3. dimensions/size

C

1. True.

2. F alse. Convolution is used for various applications, such as sharpening or blurring images, edge detection, and applying artistic effects. 3. True 4. True

348

4. Convolutional Neural Networks


Unit 5 • Computer Vision

22 Introduction to CNN**

A

neural network is a computational model inspired by the human brain, consisting of interconnected nodes (neurons) that process and transmit information. A type of neural network particularly effective for image processing tasks is Convolutional Neural Networks (CNNs).

Let’s say you want an AI model to be able to distinguish between the images of a dog and a cat. CNNs are useful in situations like these. Before CNNs, recognising objects in images required a lot of manual effort to define the features to look for. CNNs automate this process, making it faster and more accurate.

Convolution Neural Network

Convolutional Neural Network (CNN), also known as ConvNet, is a technique of deep learning algorithms created especially for processing and analysing visual data. CNNs are excellent at identifying patterns as well as structures in images, which sets them apart from standard neural networks. A CNN can take an input image, analyse various elements within it, and assign importance to different features. CNNs work by automatically learning important features from images, such as edges, textures, patterns, colour, etc., without needing to be explicitly programmed to recognise these features. This ability allows the CNN to distinguish between different objects or aspects within the image, making it an essential tool for tasks like image classification and object recognition.

CNN

CAR TRUCK VAN

BICYCLE INPUT CONVOLUTION POOLING CONVOLUTION POOLING + ReLU

+ ReLU

FLATTEN

HIDDEN LAYERS

Input an Image

Process Image

FULLY

CONNECTED

Car

80%

Bus

15%

Motor-Cycle

5%

SOFTMAX

CLASSIFICATION

Output Values

In the diagram above, an input image is provided, which is then processed through CNN. The CNN analyses the image and makes a prediction based on the labels provided in the specific dataset. This process involves the CNN learning and identifying features within the image to accurately classify it according to the given labels. ** Note: This chapter is optional as per the CBSE syllabus and may not be covered in assessments.

349


Did You Know? The concept of CNNs was first introduced in the 1980s, but they gained prominence with the advent of deep learning.

Different Layers of CNN

A convolutional neural network consists of the following layers: Fully Connected Convolution + ReLU Input

Pooling Output

Feature Extraction

Classification

Fig. Layers of CNN architecture These layers are as follows: 1. Input layer

2. Convolution layer

3. Rectified linear Unit (ReLU) 4. Pooling layer

5. Fully Connected layer 6. Output layer

Input Layer

The input layer of a CNN serves as the entry point for raw data, typically images. Understanding the structure and characteristics of the input data is crucial as it determines the design of subsequent layers and the overall network architecture. In CNN, input data is represented as a 3D matrix (height x width x channels). For example, a coloured image might have dimensions 32x32x3 (32 pixels height, 32 pixels width, and 3 colour channels: Red, Green, and Blue).

Convolution Layer

This layer of a CNN is intended to extract significant features from an input image. We refer to this procedure as the convolution operation. CNNs typically have multiple convolutional layers. Basic features including edges, colours,

350


gradient orientation, etc., are captured in this layer. With added layers, the architecture adapts to the high-level features as well, giving us a network which has a better understanding of images in the dataset. The convolution layer performs the following operations: •

Apply filters through kernels: Kernels are tiny grids or matrices that glide across the input image. To generate a single value in the output feature map, each kernel value multiplies an element-by-element portion of the input and adds the results. In the convolution layer, several kernels are used to produce several features. The output of this layer is called a feature map or an activation map.

•

Produce feature maps: Several feature maps produced by various kernels make up a convolutional layer’s output. These maps represent various features of the input data, including textures, edges, and more elaborate patterns.

Feature maps have the following uses: Feature maps expedite image processing and enhance focus on important features of the image. { {

It reduces the image size so that it can be processed more efficiently.

The entire focus goes on the features of the image that can help us in processing the image further.

For example, to identify a specific car, you might only need to see its unique bumper sticker, the shape of its headlights, and its license plate. You don’t necessarily need to see the entire car.

Input Data

Feature Map

ReLU (Rectified Linear Unit)

After we get the feature map, it is subsequently sent to the ReLU layer. This layer preserves the positive value in the feature map by simply eliminating all of the negative values. The ReLU function works by outputting the input directly if it is positive, and zero if the input is negative. This can be expressed mathematically as: ReLU(x)=max(0,x), where, x is the input data. To illustrate this concept graphically, consider two graphs side by side.

Chapter 22 • Introduction to CNN**

Think and Tell

When identifying different types of flowers, which specific features might be crucial for identifying them, and why are these features important for image processing?

351


5 4

10

3

8

2

1 –10 –8 –6 –4 –2 0 –1 ×1 –2

Only positive values of the input are taken, negative values are removed

6 2 4 6

4

8 10

2 –10

–3

5

–5

Output = Max(Zero, Input)

10

–4

Graph 1

Graph 2

The Graph 1 represents a linear graph before ReLU activation. After passing through the ReLU layer, the resulting Graph 2 demonstrates how ReLU converts negative values to zero and leaves positive values unchanged, creating a non-linear effect. The primary reason for applying ReLU is to accentuate significant changes in the feature map. By zeroing out negative values and preserving positive values, ReLU amplifies transitions between different features, thereby enhancing the perceptibility of colour changes or feature distinctions in the data.

ReLU

Black = Negative, White = Positive

Only non-negative values

Pooling Layer

Pooling layers systematically reduce the spatial dimensions (width and height) of the input feature maps, decreasing computational complexity and controlling overfitting by retaining the most relevant features. There are two types of pooling, which are: •

Max Pooling: Selects the maximum value from each window of the feature map covered by the kernel.

•

Average Pooling: Selects the average value from each window of the feature map covered by the kernel. Max Pooling 30

25

45

56

16

37

102

69

56

85

76

106

89

94

71

95

37

102

94

106

27

68

81

87

Average Pooling

352


The pooling layer plays a crucial role in CNNs by executing several essential functions: •

It reduces the size of the input image, making subsequent computations more efficient and manageable.

•

By summarising local features, the pooling layer enhances the network’s resistance to small variations such as distortions, translations, and minor transformations within the input image. This robustness helps in improving the overall performance of the network by focusing on essential features and reducing sensitivity to irrelevant details.

•

It extracts important features from the input data, consolidating information from neighbouring pixels or regions. This process aids in capturing essential patterns that contribute to the network’s ability to recognise complex patterns and objects.

Fully Connected Layer

Fully connected layers integrate the features learnt by the previous layers and perform classification based on these features. Before being fed into a fully connected layer, the output obtained from the last convolutional or pooling layer is flattened into a 1D vector. Each value in the 1D vector represents a probability that a certain feature belongs to a label. For example, if the image is of a car, features like wheels or headlights should have high probability of being associated with the label “car”. Each neuron in a fully connected layer is connected to every neuron in the preceding layer, forming a dense matrix of weights. 1 2 1

2

3

4

5

6

7

8

9

3 4 5 6 7 8 9

Pooled Feature Map

Flattened Pooled Feature Map

FCP Layer

The number of neurons in the fully connected layers is typically determined based on the complexity of the task (classification or regression) and the size of the input data.

Output Layer

The output layer generates the final predictions depending on the specific task being performed (e.g., classification, regression) and learnt by the preceding layers.

Let’s Summarise

Overall, the different layers in the CNN function as shown here.

Chapter 22 • Introduction to CNN**

353


Convolutional Layer

Rectified linear unit (ReLU)

Fully Connected Layer

Pooling Layer

Max (1, 1, 5, 6) = 6

1 ×1 1 ×0 1 ×1

0

0

0 ×0 1 ×1 1 ×0

1

0

0 ×1 0 ×0 1 ×1

1

1

0

0

1

1

0

0

1

1

0

0

Image

10

1

1

2

4

5

6

7

8

4

3

2

1

0

2

1

2

3

4

8

4

x

6

Convolved Feature

−10

−5 5 10 Output = Max(Zero, Input)

max pool with 2 × 2 filters and stride 2

6

8

3

4

Y Rectified Feature Map

Car

70%

Truck

20%

Bicycle 10%

Reduce size, improve feature, give probability value

Applications of CNN

CNN plays an important role in computer vision and image recognition. Some of the applications of CNN are as follows:

Error Alert!

Image classification: CNNs assign labels to images based on learnt features.

Data preprocessing is crucial for CNN

•

Object detection: CNNs localise and classify objects within images.

augmentation, and noise reduction.

•

Image segmentation: CNNs partition images into meaningful segments.

•

Face recognition: CNNs identify individuals based on facial features.

•

Image generation: CNNs create new images based on learnt patterns.

•

Image super-resolution: CNNs enhance image resolution from low-resolution inputs.

•

Image captioning: CNNs generate natural language descriptions for images.

•

Video analysis: CNNs interpret actions and activities within video sequences.

•

Medical image analysis: CNNs assist in the diagnosis and analysis of medical images.

•

Autonomous vehicles: CNNs enable vehicles to perceive and navigate roads based on visual input.

•

performance, including normalisation,

Activity Time Activity 1: Case Study Analysis

(Group Work)

Form groups of 3–4 participants. Have each group study a specific case where CNNs were successfully implemented in an application (e.g., medical imaging, autonomous vehicles). Each group should analyse the challenges faced and the solutions provided by CNNs. Activity 2: Debate

(Group Work)

Divide students into two groups. One group will argue the advantages of using CNNs over traditional image processing techniques, while the other group will argue the potential disadvantages and limitations of CNNs. Encourage critical thinking and evidence-based arguments.

354


Chapter Checkup A Select the correct option. 1 What is the primary function of the convolutional layer in a CNN? a Extracting features from the input image c Reducing the size of the input image

2 What does the pooling layer in a CNN primarily do?

a Increase the number of feature maps

b Introducing non-linearity d Classifying the image

b Reduce the spatial dimensions of the feature maps

c Add non-linearity d Perform classification

3 Which layer in a CNN reduces the number of parameters and computations in the network? a Convolution Layer b ReLU Layer

c Pooling Layer d Fully Connected Layer

4 Which of the following is not an application of CNNs?

a Image classification b Object detection c Medical diagnosis through textual data

d Image segmentation

B Fill in the blanks with the most suitable words. 1 The ...................... layer of a CNN typically handles visual data. 2 The ...................... layer in a CNN introduces non-linearity by zeroing out negative values. 3 The convolution layer applies filters to input images through ...................... . 4 The ...................... layer is responsible for the final classification in a CNN. C

State whether the following statements are True or False. Correct the statements that are False. 1 CNNs are used for processing and analysing text data. 2 The input layer of a CNN is always 2-dimensional. 3 Max pooling is used to compute the average value from each window of the feature map. 4 The output layer of a CNN produces the final predictions.

D Answer the following questions. (Solved) Q1. Explain the different types of pooling: A1. There are two types of pooling, which are as follows: • •

Max Pooling: Selects the maximum value from each window of the feature map covered by the kernel.

Average Pooling: Selects the average value from each window of the feature map covered by the kernel.

Q2. Explain the role of different layers in a Convolutional Neural Network (CNN). A2. A Convolutional Neural Network (CNN) consists of several layers, each serving a specific purpose in processing and analysing visual data. • Input layer: The input layer of a CNN serves as the entry point for raw data, typically images. In CNN, input data is represented as a 3D matrix (height x width x channels). • Convolution layer: This layer of a CNN is intended to extract significant features from an input image. We refer to this procedure as the convolution operation. CNNs typically have multiple convolutional layers. Basic features including edges, colours, gradient orientation, etc., are captured in this layer. • ReLU: After we get the feature map, it is subsequently sent to the ReLU layer. This layer preserves the positive value in the feature map by simply eliminating all of the negative values.

Chapter 22 • Introduction to CNN**

355


• Pooling layer: Pooling layers systematically reduce the spatial dimensions (width and height) of the input feature maps, decreasing computational complexity and controlling overfitting by retaining the most relevant features. • Fully connected layer: Fully connected layers integrate the features learnt by the previous layers and performs classification based on these features.

Output layer: The output layer generates the final predictions depending on the specific task being performed (e.g., classification, regression) and learnt by the preceding layers.

•

Q3. In this 4X4 feature map, apply max pooling and average pooling to obtain the down sampled feature map.

3

13

17

11

5

3

1

23

7

1

2

3

11

17

3

4

3

13

17

11

5

3

1

23

7

1

2

3

A3.

11

17

3

x

Ma Ave

rag e

4

ling

o Po

Poo

ling

13

23

17

4

6

13

9

3

AI Activities 1 Visit the link: https://www.youtube.com/watch?v=YRhxdVk_sIs to learn about Convolutional Neural Networks. 2 Visit the link: https://www.youtube.com/watch?v=Q6YHaadg3MI to visualise the feature maps in Convolutional Neural Networks (CNN).

Answer Key A

1. a

2. b

B

1. Input

2. ReLU

C

1. False. CNNs are used for processing and analysing visual data.

3. c

4. c

3. kernels

4. fully connected

2. F alse. The input layer of a CNN can handle 3-dimensional data (height, width, and channels). 3. False. Max pooling selects the maximum value from each window of the feature map. 4. True.

356


Unit Reflection

Key Terms • Computer vision: Computer vision is a domain of artificial intelligence that enables computers and systems to extract meaningful information from digital images, videos, and other visual inputs, enabling them to act or recommend based on that information. • Image: An image is a graphical representation of data that can be used to portray a certain scene, idea, or concept or to capture a moment in time. • Pixel: The smallest unit of a digital image is called a “picture element,” which is what the name “pixel” refers to. • Resolution: It refers to the total number of pixels contained within an image. Resolution determines the image’s clarity and detail. • OpenCV: OpenCV is a powerful library for computer vision tasks in Python and various other programming languages. • Convolution: Convolution is the process of multiplying an image array element-by-element with another array called the kernel and then adding up the results. • Kernel: A kernel is a small grid that we move over an image, multiplying its values with the image’s pixels to change it in a specific way. • CNN: Convolutional Neural Network (CNN), also known as ConvNet, is a technique of deep learning algorithms created especially for processing and analysing visual data.

Things to Remember • There are various applications of computer vision such as facial recognition, document verification, healthcare services, retail industry, image-based search, digital audio-visual marketing, education and training, etc. • Image classification is the process of assigning an input image a label from a predetermined list of categories. • Classification with localisation involves identifying both the object present in an image and its location within that image. • Object detection is the process of finding instances of real-world objects such as faces, cars, or animals in images or videos. • Instance segmentation assigns labels to each pixel in an image corresponding to the object to which it relates, in addition to detecting and classifying objects. • The Emoji Scavenger Hunt uses your phone’s camera and Google’s machine learning to identify real-world objects that match given emojis. • Grayscale images are a type of digital image that contains varying shades of grey without any visible colour. • Coloured images are composed of three primary colours: red, green, and blue, collectively known as RGB. • The RGB calculator helps you convert colours between different formats, such as RGB, HEX, and HSL. It also allows you to adjust the individual red, green, and blue (RGB) components of a colour to see how they combine to create different colours.

Unit Reflection

357


• Piskel is a free online pixel art and animated sprite editor. Artists and game developers often use it to create sprites and animations for games. • In the field of computer vision and image processing, a ‘feature’ refers to a distinct piece of information within an image. They can manifest as various structural elements in an image, such as points, edges, textures, or even larger entities like objects. • The imread() function of cv2 reads an image from the specified file path into a NumPy array. • The cv2.cvtColor() function in OpenCV is used to convert an image from one colour space to another. • Splitting a colour image into its individual colour channels (Red, Green, and Blue) can be done easily using OpenCV in Python. • The cv2.split function is used to split the image into its three colour channels. • In image processing, changing pixel values is essential for various tasks such as filtering, enhancement, and analysis. • The resize() function of OpenCV is used to resize an image. • The imwrite function in OpenCV is used to save an image to a specified file. • Convolution is used in various applications, such as sharpening or blurring images, edge detection, and applying artistic effects. • Different effects, such as sharpening or blurring, are achieved by adjusting the values within the kernel. • The different layers of CNN are the Input Layer, convolution layer, rectified linear unit (ReLU), pooling layer, fully connected layer, and output layer. • Some of the applications of CNN are image classification, object detection, image segmentation, face recognition, image generation, image super-resolution, image captioning, etc.

358


Test Your Knowledge A. Select the correct option. 1. Which layer of a Convolutional Neural Network (CNN) is responsible for reducing the spatial dimensions of the input feature maps?

a. Input Layer

b. Convolution Layer

c. Pooling Layer

d. Fully Connected Layer

2. In a grayscale image, a pixel value of 255 typically represents: a. Black

b. White

c. Red

d. Green

3. Which of the following algorithms is specifically used for feature extraction in images? a. K-nearest Neighbours (KNN)

b. Convolutional Neural Networks (CNNs)

c. Decision Trees

d. Support Vector Machines (SVMs)

4. In computer vision, what is the purpose of the ReLU layer? a. To apply filters to images b. To perform pooling operations c. To eliminate negative values and preserve positive values d. To classify objects 5. In an RGB image, which combination of pixel values results in the colour black? a. (255, 0, 0)

b. (0, 255, 0)

c. (0, 0, 255)

d. (0, 0, 0)

B. Fill in the blanks with the most suitable words. 1. In computer vision, the process of identifying objects in images is known as

.

2. A Convolutional Neural Network (CNN) layer that preserves only positive values is called

.

3. A method used in image processing to sharpen or blur images by multiplying pixel values with a filter is called 4. In RGB images, the combination of maximum intensity for red, green, and blue results in the colour 5. The library used for computer vision tasks in Python is called

. .

.

C. State True or False. Correct the statements that are False. 1. In a grayscale image, pixel values range from 0 to 255. 2. The fully connected layer in a CNN is responsible for extracting features from images. 3. ReLU stands for Rectified Linear Unit. 4. The imread() function in OpenCV is used to display an image on the screen. 5. The input layer of a CNN receives the final processed output data.

Unit Reflection

359


D. Short-answer type questions. 1. Explain the role of pixel values in a grayscale image. 2. What is the significance of the pooling layer in a CNN? 3. What is the main advantage of using Convolutional Neural Networks (CNNs) for image classification?

E. Long-answer type questions. 1. Describe the process of convolution in image processing and explain how it is used in Convolutional Neural Networks (CNNs). 2. Explain the role and importance of the fully connected layer in a Convolutional Neural Network (CNN). 3. Explain how the RGB colour model is used to create different colours in digital images. How does adjusting the intensity of red, green, and blue components affect the resulting colour?

4. Explain any three applications of computer vision.

F. Competency-based questions. 1. Nina is analysing medical scans using CNNs. How can she leverage instance segmentation to accurately identify and measure tumours?

2. Raj is implementing a computer vision system for document verification. What key features should the system identify to prevent fraud?

3. In image processing, we can get a lot of features from the image. It can be either a blob, an edge or a corner. In the following image, identify the patches that form good features and bad features. Justify your answer.

360


Unit 6 • Natural Language Processing

23 Introduction to Natural Language Processing H

ave you ever wondered how your smartphone understands your voice commands so easily? Or how search engines like Google understand your queries and help you find the information you need with just a few keystrokes? Or how do virtual assistants like Siri and Alexa respond to your inquiries? All of this is possible with the help of Natural Language Processing (NLP).

What is NLP?

NLP is the domain of AI that deals with the language-based interactions between a machine and a human, as well as between two machines. The objective of NLP is to enable computers to understand, comprehend, and generate human language in a way that is both meaningful and contextually appropriate. NLP enables humans to interact with computers more naturally, using spoken or written language rather than highly developed programming languages. NLP involves a variety of algorithms that process and analyse large amounts of natural language data from users’ interactions, including text and speech. NLP algorithms are trained on vast amounts of text data, learning patterns, structures, and the meaning of words and sentences. It also involves understanding the context, sentiment, and intent behind those words. This enables computers to perform a wide range of tasks, from recognising voice commands to translating languages and generating human-like responses in chatbots.

NLP Applications

NLP has numerous applications in our daily lives. Let us learn about some of them.

Chatbots

Chatbots are computer programs designed to imitate human-like conversation using text or speech interfaces. NLP is essential for chatbots to comprehend the user’s input, generate appropriate responses, and engage in meaningful conversations.

361


Here is how NLP plays a pivotal role in enhancing chatbot capabilities: Customer Support Chatbots are widely used by organisations to provide customer services on websites and social media platforms. These chatbots can address frequently asked questions, assist with troubleshooting, and transfer complex issues to the right team member when needed. For example, chatbots assist customers with tasks, such as requesting personal loans, and obtaining information on money transfers or if you want to report a lost card, a chatbot is there to assist you anytime, offering 24 × 7 assistance. E-commerce Product Recommendations NLP is used by chatbots to engage in conversations with users, to understand their preferences and provide personalised product recommendations. For example, a chatbot for a clothing store would enquire about a customer’s size, budget, and preferred styles to suggest items that fit their tastes. Educational Assistance Chatbots are used in the educational field to provide academic support, such as helping students with homework, providing conceptual explanations, quizzing students, offering study tips, etc. For example, ChatGPT provides personalised learning experiences and adaptive tutoring, catering to individual learning styles.

Virtual Assistants

This is one of the most common applications of NLP. A virtual assistant is an AI tool that understands and responds to voice commands or text inputs, such as questions and requests, or performs tasks for you. Virtual assistants come in the form of applications, or combinations of devices loaded with applications. Siri on the iPhone, Alexa on the Amazon Echo device, and Google Assistant on the Android phone are some of the popular virtual assistants. You can ask a virtual assistant to set alarms, check the weather, play your favourite songs, or even tell you jokes.

Sentiment Analysis

Sentiment analysis is an NLP technique used to analyse and interpret the sentiment expressed in text data. By comprehending human language, NLP enables computers to detect whether the sentiment conveyed in text is positive, negative, or neutral. Let us learn about some applications of NLP in sentiment analysis. Social Media Monitoring Businesses use sentiment analysis to track their brand’s presence on social media platforms like Twitter, Facebook, and Instagram. Companies gain insights into public opinion and engage customers more effectively by recognising sentiment or emotion from customers’ comments, posts, likes, shares, emojis, etc. Product Reviews Analysis E-commerce giants like Amazon and Myntra use sentiment analysis to evaluate product reviews and ratings. This enables businesses to identify top-selling products, discover product flaws, and make data-driven decisions regarding product development and marketing strategies. Political Opinion Analysis Sentiment analysis is used to analyse public sentiment towards political candidates, parties, and policies. It is used in political campaigns to determine the opinions of voters. It also helps to determine whether their messaging strategies are resonating positively with voters.

362


Film and Entertainment Reviews Film and entertainment industry players use sentiment analysis to analyse audience reactions to films, series, TV shows, etc. By assessing sentiment expressed by audiences in reviews and social media discussions, companies can gauge audience preferences, predict box office or streaming platform success, and customise promotional campaigns to achieve commercial success.

Automatic Summarisation

NLP can be used to auto-generate short and clear summaries of longer texts or documents through AI algorithms and techniques. Let us look at some of the applications of NLP in automatic summarisation. News Platforms Websites and apps like Google News, Apple News, and Flipboard use NLP algorithms to automatically produce summaries of news articles from diverse sources. This allows users to stay informed about the latest news topics without the need to read through entire articles. Document Summarisation Tools Google Docs offers a feature that allows you to use NLP to create content summaries for lengthy documents, research papers, or reports. These tools can be used by professionals and students to extract key information and insights from large volumes of text. YouTube Video Summarisation NLP algorithms convert the spoken content of YouTube videos into text through automatic transcription, producing a text-based representation known as a transcript. Once the transcript is analysed, the algorithms identify key points, topics, and important moments within the video. Based on this analysis, the algorithms generate summaries, capturing the relevant information in the video clip.

Did You Know?

NLP is also used to classify text. Text classification makes it possible to assign predefined categories to a document and organise it to help you find the information you need or simplify some activities. For example, an application of text categorisation is spam filtering in email.

Human Language Vs Computer Language

Humans communicate through language, which our brains process continuously and intuitively. Our brains constantly interpret the sounds around us, making sense of them in real-time. Imagine you are at home watching TV while your family is talking in the background. Your brain processes both the dialogue on the TV and the conversations happening around you. If someone suddenly calls your name, your brain quickly shifts focus from the TV to the person calling you. This ability to process and prioritise different sounds at the same time is a unique feature of human cognition. When someone speaks, the sound waves travel to the listener’s eardrum, where they are converted into neural impulses and sent to the brain for interpretation. The brain processes these signals to understand their meaning. If the message is clear, it’s stored; otherwise, the listener may ask for clarification. In contrast, computers understand only numbers, so any information sent to a machine must be converted into numerical data. If a mistake is made while typing, the computer generates an error and cannot process that part. While machines can process data faster than the human brain, they cannot match the brain’s intelligence or the diversity in how it processes information. Human language has a vast vocabulary, whereas computer language

Chapter 23 • Introduction to Natural Language Processing

363


is limited. Although AI enables machines to grasp the tone and emotions of a context, they still lack the nuanced understanding that comes naturally to humans. The human brain, through lifelong learning, can comprehend the meaning of a sentence even if it is grammatically incorrect, while a machine typically prioritises correct grammar over overall sense.

Language Structure and Part-of-Speech Tagging

Human language operates according to specific rules. Within a sentence, we find nouns, verbs, adverbs, and adjectives—all essential for effective communication. These rules establish the structure of a language, a concept known as syntax, which involves the grammatical arrangement of words in a sentence. Understanding this structure allows us to interpret the meaning of a message. To enable computers to handle this effectively, part-ofspeech tagging is used. This technique helps the computer identify various parts of speech. For example, you are an iPhone customer and posted a comment on Facebook, “I Just received my new iPhone! It’s amazing! #happy #excited”. This sentence would be tokenised into the following list of words: [“I’, “Just”, “received”, “my”, “new”, “iPhone”, “!”, “It’s”, “amazing”, “!”, “#happy”, “#excited”]. These tokens are then tagged with their parts of speech. Part-of-speech tagging involves assigning a tag to each token based on its grammatical function in the sentence. For example, the word “received” would be tagged as a verb, “amazing” would be tagged as an adjective, and “iPhone” would be tagged as a noun. Besides syntax, the semantics, or meaning, of a sentence is equally important. Human communication is complex and has many details that are easy for people to understand but hard for computers to understand.

Analogy with Programming Language •

Different syntax, same semantics: {

{

•

“5 – 3” and “3 subtracted from 5” Both expressions mean the same thing, and both result in 2.

“The keys are on the desk.” and “On the desk are the keys.” Both sentences indicate that the keys are located on the desk, but they are phrased differently.

Think and Tell

Think of some other examples of different syntax and same semantics and vice-versa.

Different semantics, same syntax: {

“8 / 4” (in Python 2) and “8 / 4” (in Python 3) In Python 2, this results in 2 (integer division), while in Python 3, it results in 2.0 (float division).

Multiple Meanings of a Word

Let us consider three sentences where the word “light” is used in different contexts: •

“The room was filled with bright light from the lamp.” Here, “light” refers to the brightness or illumination.

•

“She carried a light backpack for the hike.” In this context, “light” means not heavy.

•

“He turned on the light to read a book.” Here, “light” refers to an electrical device that produces illumination.

Context plays a crucial role in our understanding of language. We instinctively grasp the meaning of a sentence based on our experience with the language and our accumulated knowledge. In the three sentences provided, the

364


word “light” is used in different ways, each carrying a distinct meaning depending on the context. This demonstrates that in natural language, a single word can have multiple meanings, and its significance changes according to the surrounding context.

Think and Tell

Think of some other words which can have multiple meanings, and we use them in sentences.

Activity Google Translate Let us perform the following experiment to understand how AI uses NLP to translate text from one language to another. Objective: Experience real-time translation between different languages using the Google Translate app thereby leveraging the power of NLP. Google Translate is an AI-powered translation app that allows users to translate text into different languages. It can translate texts entered by typing, handwritten text, spoken words, and text scanned through the camera or captured in images. Follow the given steps to explore how this application works. 1. Download the Google Translate app from the Google Play Store in your smartphone or your device’s app store. 2. Open the Google Translate app. The following screen appears. 3. Click on the Camera option in the bottom-right corner. 4. Select your preferred language, for example, ‘Hindi’. 5. Let us translate these three sentences using Google Translate. •

The room was filled with bright light from the lamp.

•

She carried a light backpack for the hike.

•

He turned on the light to read a book.

Note that in all three sentences, the word ‘light’ has the same spelling but different meanings and contexts. In the first sentence, “light” refers to the brightness or illumination. In the second sentence, “light” means not heavy. In the third sentence, “light” refers to an electrical device that produces illumination. 6. Take a picture of these sentences to translate using your smartphone’s camera. 7. The translated text appears as follows.

Chapter 23 • Introduction to Natural Language Processing

365


Activity Time (Group Work)

Activity 1: Real-world Applications of NLP

Divide the class into small groups of 4–5 students. Each group should research a specific application of NLP, such as search engines, spam detection, autocorrection, or voice recognition. Instruct each group to discuss their findings, focusing on how NLP is used in their chosen application, its benefits, and potential challenges.

(Individual Work)

Activity 2: NLP Innovations

Ask each student to select a recent innovation or advancement in NLP (e.g., GPT models or advances in sentiment analysis). Students should conduct individual research to understand the innovation’s purpose, how it works, and its significance in the field of NLP.

Chapter Checkup A Select the correct option. 1 Which of the following domains of AI deals with language-based interactions between a machine and a human? a NLP b Computer Vision c Machine Learning

d None of these

2 Which of the following is an application of NLP? a Chatbots b Sentiment analysis c Automatic summarisation

d All of these

3 Why do e-commerce giants use sentiment analysis? a Evaluate product reviews

b Identify top-selling products

c Uncover product flaws

d All of these

4 What is the term for the grammatical arrangement of words in a sentence? a Semantics b Syntax

c Tokenisation d Part-of-Speech Tagging

5 Which of the following sentences uses the word “bank” to refer to a financial institution? a “He sat by the bank of the river, enjoying the view.”

b “She deposited money into her savings account at the bank.”

c “The children played on the grassy bank near the playground.”

d None of these.

B Fill in the blanks with the most suitable words. 1 ...................... tagging involves assigning a tag to each token based on its grammatical function in the sentence. 2 ...................... are computer programs engineered to imitate human-like conversation using text or speech interfaces. 3 Converting the spoken content of YouTube videos to text-based representation is known as ....................... 4 Professionals can use ...................... to create content summaries for lengthy documents, research papers, or reports. 5 ...................... is an NLP technique used to analyse and interpret the emotion expressed in text data.

366


C

State whether the following statements are True or False. Correct the statements that are false. 1 Political campaigns use sentiment analysis to gauge voter sentiment. 2 ChatGPT uses NLP to provide a personalised learning experience. 3 NLP algorithms are trained on vast amounts of text data. 4 Google Translate allows users to translate text into different languages. 5 Virtual assistants come in the form of applications only.

D Answer the following questions. (Solved) Q1. Define NLP. A1. NLP, short for Natural Language Processing, is the domain of AI that deals with the language-based interactions between a machine and a human, as well as between two machines. Q2. How does NLP contribute to educational support? A2. Chatbots are used in the educational field to provide academic support, such as helping students with homework, providing conceptual explanations, quizzing students, offering study tips, etc. For example, ChatGPT provides personalised learning experiences and adaptive tutoring, catering to individual learning styles. Q3. What is a virtual assistant? Give examples. A3. Virtual assistant is one of the most common applications of NLP. A virtual assistant is an AI tool that understands and responds to voice commands or text inputs, such as questions and requests, or performs tasks for you. Siri on the iPhone, Alexa on the Amazon Echo device, and Google Assistant on the Android phone are some of the popular virtual assistants. You can ask a virtual assistant to set alarms, check the weather, play your favourite songs, or even tell you jokes. Q4. Aradhya visits her school’s website, where she encounters a robot that asks her questions like, ‘How may I help you?’ It then assists her with searching for study resources. What is this robot commonly referred to as, and why does it engage Aradhya with questions? A4. The robot is commonly referred to as a chatbot. It engages Aradhya with questions to understand what specific help she needs on the school website. By asking questions, the chatbot can guide her to the relevant study resources efficiently.

AI Activities 1 E xplore the following link and observe how NLP analyses your text: https://www.ibm.com/demos/live/natural-language-understanding/self-service

Answer Key A

1. a

B

1. Part-of-Speech

C

1. True.

2. d

3. d 2. Chatbots

4. b

5. b 3. Transcript

4. Google Docs

5. Sentiment Analysis

2. True. 3. True.

4. True.

5. False. Virtual assistants come in various forms, including applications, devices, and integrated systems.

Chapter 23 • Introduction to Natural Language Processing

367


Unit 6 • Natural Language Processing

24 Revisiting AI Project Cycle (NLP) W

e already know what an AI project cycle is. Now, let us learn how to develop an NLP project with the help of an example. This example will illustrate each stage of the AI project cycle, providing a clear framework for developing NLP-based solutions. By examining a step-by-step approach, we can better understand how to leverage NLP techniques to address specific problems and create impactful and user-friendly applications. Problem: People often find it difficult to stay informed about the topics they care about without being overwhelmed by the sheer volume of content. Whether it is staying updated on global news, following developments in a specific field, or tracking the latest trends, finding relevant, concise, and personalised content can be challenging. Solution using NLP: An AI-powered content curation tool can be developed using NLP to filter, summarise, and personalise news and articles based on user preferences. This tool would analyse vast amounts of text from various sources, identify key information, and deliver concise summaries tailored to the user’s interests, helping them stay informed without being overwhelmed.

AI Project Cycle Stages

Let us look at the various stages of the AI project cycle again for this scenario. Data Exploration

Problem Scoping

Data Acquisition

Evaluation

Modelling

Stage 1: Problem Scoping

Users often struggle to quickly grasp the key points of lengthy news articles due to excess information.

368


Who Canvas —Who has the problem? Who are the stakeholders?

{

The general public, news organisations, and content creators

What do we know about them?

{

They struggle with lengthy news, need better engagement, and seek impactful content.

What Canvas — What is the nature of the problem? What is the problem? How do you know it is a problem?

{

Stakeholders struggle with lengthy news articles, leading to difficulties in quickly understanding key points and engaging with content effectively.

{

Studies and surveys indicate a preference for concise news formats, and data reveals higher engagement with summarised content.

Where Canvas—Where does the problem arise? What is the context/situation in which the stakeholders experience this problem?

{

While consuming and managing large volumes of news content daily, often needing to quickly understand essential information amidst busy schedules.

Why Canvas—Why do you think it is a problem worth solving? What would be the key value to the stakeholders? How would it improve their situation?

{

Addresses the widespread challenge of overloaded information, enhances user engagement, and improves the efficiency of news consumption.

{

Providing quick, clear summaries that save time and enhance understanding, making news consumption more efficient and engaging.

{

Make it easier to stay informed.

Now that we have gone through all the factors around the problem, the problem statement template is as follows: Our

general public, news organisations, and content creators

Who?

Have a problem of

struggling with lengthy news articles and content overload

What?

While

trying to stay informed and engage audiences

Where?

An ideal solution would be

providing quick, clear summaries to enhance understanding and

Why?

engagement

Stage 2: Data Acquisition

To summarise news content effectively, we need to collect a variety of articles so the system can analyse and extract key information. This data can be obtained from sources such as: •

News Websites: Collect data from a wide range of reputable news sources and online publications.

•

Social Media Feeds: Extract trending topics and articles shared on platforms like Twitter, Reddit, and Facebook.

•

Surveys: Collect data on user preferences through surveys or by analysing their reading habits and bookmarked articles.

Stage 3: Data Exploration

Once the news articles have been collected, they need to be processed and cleaned to prepare them for summarisation. This involves normalising text. Text is normalised to standardise terms and phrases to reduce vocabulary complexity while retaining the essential meaning. It involves the following steps: Chapter 24 • Revisiting AI Project Cycle (NLP)

369


•

Tokenisation: Breaking down the articles into sentences and words.

•

Lowercasing: Converting all text to lowercase to ensure consistency.

•

Stopword removal: Eliminating common, non-essential words (e.g., “the,” “and”).

•

Text cleaning: Removing any irrelevant elements such as advertisements or unrelated content. You will study text normalisation in detail in the next chapter.

Stage 4: Modelling

The processed text is fed into an NLP model designed for summarisation. The model is trained to generate concise summaries from lengthy articles by learning patterns in the text. Fine-tuning the model with specific news data improves its ability to produce relevant and accurate summaries. This stage ensures the model can effectively summarise news content based on the cleaned and tokenised input.

Stage 5: Evaluation

Compare the AI-generated summaries with manually curated summaries to ensure they capture the most important information. Continuously refine the model based on user feedback, ensuring that it adapts to changing interests and news cycles.

Activity Chatbots As previously discussed, chatbots are a popular application of Natural Language Processing. Many existing chatbots use similar methods to those described in the scenario above. Let us explore some of these chatbots and see how they function. Follow the given steps to explore the Chai Bot: 1. Visit the link https://my.aiclub.world/chai-bot. This will direct you to a webpage as shown.

370


2. Ask your question to Chai, and it will answer you. Chai will not only write your answer in the chat box, but it will also read it out for you.

3. You can also try some other chatbots too, such as: Kuki Bot Link: https://chat.kuki.ai/chat

CleverBot Link: https://www.cleverbot.com/

Chapter 24 • Revisiting AI Project Cycle (NLP)

371


As you engage with various chatbots, you will notice that some are scripted, meaning they are traditional chatbots, while others are AI-powered and possess a greater depth of knowledge. This experience helps us recognise that there are two types of chatbots: Scriptbots and Smart-bots. Here’s the difference between the two: Script-bot

Smart-bot

Script bots are easy to create.

Smart-bots are flexible and powerful.

Script bots work around a script which is programmed into

Smart bots operate on larger databases and other resources

Script bots are mostly free and can be easily integrated into

Smart-bots learn and improve their responses with more data.

Script-bots have no or little language processing skills.

Smart-bots require coding skills to implement and maintain.

Script-bots have limited functionality.

Smart-bots offer wide functionality.

them.

messaging platforms.

directly.

Activity Time (Group Work)

Script-bots v/s Smart-bots

Divide the students into small groups of 4-5 members each. Ask each group to discuss the key differences between Script-bots and Smart-bots. Encourage them to consider aspects such as ease of creation, language processing capabilities, and overall functionality. After the discussion, have each group present their findings to the class, highlighting the most significant differences they identified.

Chapter Checkup A Select the correct option. 1 Which stage of the AI project cycle involves preparing and cleaning data? a Data Acquisition

b Data Exploration

c Modelling d Evaluation

2 In which stage do you choose and train an AI model based on the prepared data? a Data Exploration

b Problem Scoping

c Modelling d Data Acquisition 3 What does data normalisation typically involve? a Providing training data b Converting text to lowercase and removing stopwords c Collecting additional data d Evaluating model accuracy B Fill in the blanks with the most suitable words. 1 To evaluate the performance of an NLP model, you need to compare the model’s output with ....................... 2 ...................... is the stage where you gather data from various sources. 3 The stage of the AI project cycle where you define the problem, identify stakeholders, and set objectives is known as .......................

372


4 The process of evaluating a model’s performance involves using a separate set of data, known as the ......................, to test the model’s accuracy and effectiveness. 5 Surveys, interviews, sensor data, etc. are the various sources for ...................... collection. C

State whether the following statements are True or False. Correct the statements that are False. 1 Data exploration involves normalising the text by converting it to uppercase. 2 The modelling stage includes both training and evaluating the model. 3 The evaluation stage assesses how well the model generates accurate and relevant outputs. 4 Chatbot is an application of NLP. 5 Data normalisation helps to reduce the complexity of text by standardising terms and phrases.

D Answer the following questions. (Solved) Q1. What is the purpose of the data exploration stage in an AI project? A1. The purpose of the data exploration stage is to process and clean the collected data, making it suitable for analysis by removing unwanted data, normalising text, and preparing it for the next stages of the AI project, i.e., modelling. Q2. Explain the key steps involved in creating a chatbot. Include how you would approach problem scoping, data acquisition, data exploration, modelling, and evaluation. A2. Problem Scoping: Define the chatbot’s purpose and identify the specific needs and requirements of the target users. Data Acquisition: Collect relevant data, such as user queries and example responses, from sources like surveys or existing chat logs. Data Exploration: Process and clean the collected data to make it suitable for training. This involves tokenising the text, removing irrelevant content, and standardising the format. Modelling: Choose an appropriate NLP model and train it using the prepared data to generate accurate responses. Evaluation: Test the chatbot’s performance with a separate dataset to ensure it responds accurately and effectively. Q3. Sakshi wants to create a chatbot to assist users in brainstorming and organising ideas for writing an essay. How can the chatbot help Sakshi? A3. The chatbot can guide users through brainstorming by asking targeted questions and providing prompts to generate ideas. It can also help organise these ideas into a coherent structure, offering suggestions for an essay outline and ensuring a logical flow.

AI Activities Let’s revise the steps in AI project cycle: https://youtu.be/QvF8leX47Hw.

Answer Key A

1. b

B

1. actual results

C

1. False. Data exploration involves normalising the text by converting it to lowercase.

2. c

3. b 2. Data acquisition

3. problem scoping

4. testing data

5. Data

2. False. The modelling stage includes training the model, but the model is evaluated in the evaluation stage.

3. True.

4. True. 5. True.

Chapter 24 • Revisiting AI Project Cycle (NLP)

373


Unit 6 • Natural Language Processing

25 Data Processing

H

umans naturally communicate with each other with ease. Our languages are convenient, allowing us to speak and understand them effortlessly. However, for computers, human languages are very complex. Natural Language Processing (NLP) enables machines to understand and communicate in natural languages, much like humans do. As computers work with numerical data, translating human language into numbers is the initial stage in NLP. Text normalisation is the initial step in the conversion process. Human languages are complex; therefore, to make them easier for computers to understand, we must simplify them. By streamlining and standardising the textual data, text normalisation lowers its complexity and makes it easier for machines to comprehend.

Text Normalisation

Text normalisation is a crucial step in NLP that involves cleaning and standardising text data. This process ensures that the text is in a consistent format, making it easier for machines to process and understand. We will be working with a collection of written text from various documents, collectively known as a corpus. The steps of text normalisation will be applied to this corpus. The term used for the whole textual data from all the documents is known as ‘corpus’. The following are the key steps involved in text normalisation: Sentence Segmentation

Tokenisation

Removing Stopwords, Special Characters, and Numbers

Lemmatisation

Stemming

Converting Text to a Common Case

Sentence Segmentation

In sentence segmentation, we break down a large text (corpus) into individual sentences. Each sentence is then treated as a separate piece of data. This makes it easier to work with the text by focusing on smaller, more manageable parts.

374


For example: During the summer, we love going to the beach, swimming, and building sandcastles. It is fun to relax, enjoy the sun, and have picnics. What are your plans for the weekend? Maybe we can all hang out together!

1. During the summer, we love going to the beach, swimming, and building sandcastles. 2. It is fun to relax, enjoy the sun, and have picnics.

3. What are your plans for the weekend? 4. Maybe we can all hang out together!

Tokenisation

After segmenting the text into sentences, the next step is to divide each sentence into tokens. Tokens refer to individual elements of the sentence, such as words, numbers, and special characters. All these elements are handled independently throughout the tokenisation process, so each one becomes a different token. As it enables a more detailed comprehension of the text, this stage is crucial for additional analysis and processing in natural language tasks. For example: During During the summer, we love going to the beach, swimming, and building sandcastles.

love

the

summer

swimming

,

the

to

going and

building

, beach

we ,

sandcastles

.

Removing Stopwords, Special Characters, and Numbers

In the process of data preprocessing, we aim to retain only the most relevant tokens, removing those that do not contribute meaningfully to the analysis. This involves identifying and removing stopwords, special characters, and numbers when they are deemed unnecessary. Stopwords, such as “the”, “is”, “in”, “and”, etc., are words that appear frequently in a text but do not provide substantial value to it. These words are crucial for human readability and grammatical structure but often add little value in computational text analysis. By removing stopwords, we can streamline our data, focusing on the words that carry the most semantic weight. The examples of stopword are as follows: a

an it

on

and is

or

are into

such

as in

the

for if

there

to

Special characters (e.g., !, @, #, ?) and numbers may also be present in the corpus. The decision to remove these elements depends on the specific use case. For example, when analysing emails, special characters and numbers are essential (e.g., email addresses like john.doe123@example.com) and should be retained.

Chapter 25 • Data Processing

375


In contrast, for general data processing tasks where special characters and numbers do not add value, removing them along with the stopword can simplify the data and improve analysis accuracy.

Error Alert!

Did You Know?

Misconception: Removing stopword is always beneficial. Correction: In some contexts, stopword may carry significant meaning and should not be removed.

Stopwords can make up 50% or more of a text but add very little value in text analysis.

Converting Text to a Common Case

After stopword removal, we convert all characters to a standard case, typically lowercase. This ensures that the machine does not treat the same words as different due to variations in letter case. Welcome

WELCOME

WeLCoMe

WELcome

welcome

weLComE

welcome Here, we can see that all six forms of “welcome” would be converted to lowercase and would be treated as the same word by the machine. This is especially important in text processing tasks such as keyword matching or natural language processing, where variations in the text case can lead to inaccuracies. Another instance can be seen in email processing, where “Support@Company.com” and “support@company. com” would be treated as the same address, eliminating potential mismatches and improving data consistency.

Think and Tell

In what scenarios is converting text to a common case, especially useful?

Stemming

In NLP, stemming is a method for refining words to their most basic or root form. Words are stripped of their prefixes and suffixes in order to create a fundamental form called the root word. This guarantees that varied word forms are handled as a single item, which enhances the effectiveness and accuracy of numerous NLP tasks, including text mining, information retrieval, and search engines. For example:

376

Word

Affixes

Stem

jumps

-s

jump

jumped

-ed

jump

jumping

-ing

jump

studies

-es

studi

studied

-ed

studi

studying

-ing

study


In stemming, the resulting stemmed words, which are created by removing affixes, might not always be meaningful. For example, “jumps”, “jumped”, and “jumping” are all reduced to “jump”, which is a meaningful word. However, “studies” and “studied” are reduced to “studi”, which is not a meaningful word. Stemming focuses solely on removing affixes without considering the semantic validity of the resulting stems, thus prioritising speed over contextual accuracy. This characteristic of stemming makes it particularly useful for applications where processing speed is crucial, such as search engines and real-time data analysis. Simplifying words to their stems allows for faster and more efficient searching and indexing.

Lemmatisation

Lemmatisation is a NLP technique that involves reducing words to their base or root form. Unlike stemming, which simply cuts off prefixes or suffixes to achieve the root form, lemmatisation considers the meaning of the word. Lemmatisation ensures that the word we get after affix removal (also known as lemma) has a meaning, and hence it takes a longer time to execute than stemming. For example: Word

Affixes

Lemma

jumps

-s

jump

jumped

-ed

jump

jumping

-ing

jump

studies

-es

study

studied

-ed

study

studying

-ing

study

As shown in the example, after removing the affixes, the words “studies” and “studied” have been correctly transformed to “study” rather than “studi”. The following table shows the differences between stemming and lemmatisation: Feature Definition

Stemming Reduces a word to its base or root form by removing prefixes and suffixes.

Uses heuristic algorithms to strip affixes. This Method

involves applying a set of predefined rules to

remove prefixes and suffixes, often using trial and error.

Speed Accuracy

Use Case

Example

Typically, faster and more straightforward. Less accurate; may produce stems that are

not meaningful words (e.g., “studies” becomes “studi”).

Lemmatisation Reduces a word to its base or dictionary form (lemma), considering its meaning.

Uses vocabulary and morphological (word structure) analysis, including parts of speech and context. Typically, slower and more complex. More accurate; produces meaningful words (e.g., “studies” becomes “study”).

Useful in applications where speed is more

Useful in applications requiring high accuracy and

analysis.

information retrieval.

important than accuracy, such as real-time data

context understanding, such as text analysis and

“caring” → “car”

“caring” → “care”

“studies” → “studi”

“studies” → “study”

We have now normalised our text into tokens, which represent the most basic form of the word in the corpus. The next step is to convert these tokens into numerical values using the bag-of-words algorithm. Chapter 25 • Data Processing

377


Bag of Words

The Bag of Words (BoW) is a NLP model which helps in extracting features from the text, which can be helpful in machine learning algorithms. In this model, text (like a sentence or document) is shown as a collection of words without worrying about grammar or the order of the words. In this model, we count how often each word appears in the provided text and create a vocabulary for the entire text collection, or corpus. The following figure gives a simple explanation of how the bag of words works. In this figure, the text on the left side is a collection of words that we have processed and cleaned up. When we run this normalised corpus through the bag of words algorithm, it picks out all the unique words and counts how often each word appears. The list on the right shows these unique words and the number of times each word shows up in the text. in - 2

the - 2

field - 1 of - 2

computer - 3 science - 1

In the field of computer science, the development of computer systems is crucial. Computer systems play a significant role in processing data and performing tasks efficiently.

development - 1 systems - 2 is - 1

crucial - 1 play - 1 a-1

significant - 1 role - 1

processing - 1 data -1 and - 1

performing - 1 tasks - 1

efficiently - 1

So, the bag of words method gives us: 1. A list of all the unique words (vocabulary) in the text. 2. The number of times each word appears (frequency). The steps in the process of implementation of the bag of words algorithm are as follows: 1. Normalise the text: Collect data and pre-process it. 2. Create a dictionary: Next, you make a list of all the unique words in the corpus. This is called vocabulary. 3. Create document vectors: For each document in the corpus, find out how many times the word from the unique list of words has occurred. 4. Repeat: Create document vectors for all the documents. Let us understand the concept of the bag of words algorithm with the help of an example. Suppose there are three documents with one sentence each. 1. Document 1: I love to play football. 2. Document 2: Football is a great game. 3. Document 3: I love to watch football games.

378


Now, apply the bag-of-words algorithm to these sentences. Step 1: Normalise the text •

Document 1: [i, love, to, play, football]

•

Document 2: [football, is, a, great, game]

•

Document 3: [i, love, to, watch, football, games]

It is important to note that no tokens were removed during the stopword removal step. This is because we have a small dataset, and since the frequency of all words is nearly identical, no word can be considered less valuable than another. Step 2: Create a dictionary Our vocabulary (list of unique words) for the corpus is: i

love

to

play

football

is

a

great

game

watch

games

Step 3: Create document vectors In this step, we count how many times each word from our vocabulary appears: For Document 1: i

love

to

play

football

is

a

great

game

watch

games

1

1

1

1

1

0

0

0

0

0

0

Since in the first document, we have words: “i”, “love”, “to”, “play”, and “football”. So, all these words get a value of 1, and the rest of the words get a value of 0. Step 4: Create document vectors for all the documents For Document 2: i

love

to

play

football

is

a

great

game

watch

games

0

0

0

0

1

1

1

1

1

0

0

For Document 3: i

love

to

play

football

is

a

great

game

watch

games

1

1

1

0

1

0

0

0

0

1

1

Now, combine the count of words for all the three documents i

love

to

play

football

is

a

great

game

watch

games

1

1

1

1

1

0

0

0

0

0

0

0

0

0

0

1

1

1

1

1

0

0

1

1

1

0

1

0

0

0

0

1

1

In this table, the top row lists all the words in the collection of documents, and the next three rows represent three different documents. Look at the table to see where the 0s and 1s are placed. This creates a document vector table for our corpus, but the words have not been converted to numbers yet. The next step in the process is to apply TFIDF (Term Frequency and Inverse Document Frequency), which is a statistical measure used to evaluate the importance of a word in a collection of documents.

Chapter 25 • Data Processing

379


TFIDF: Term Frequency and Inverse Document Frequency**

The bag-of-words technique helps us determine how often a word appears in a document within a corpus, highlighting its significance. For example, in a document discussing artificial intelligence, words like “artificial” and “intelligence” would appear frequently. This technique helps identify the main themes, allowing readers to quickly grasp essential key points and topics. Imagine we have twenty documents, each on different topics such as women’s empowerment, unemployment, environmental preservation, healthcare, education, and so forth. In this case, words like “artificial” and “intelligence” would not appear often across all documents. However, common words like “and,” “this,”, “the”, etc., would be frequent, as they are essential for sentence structure. Although these common words are necessary for human comprehension, they don’t provide meaningful information about the topics of the documents. Machines see these words as irrelevant for analysis, so during preprocessing, they are typically removed as stopwords. Removing these stopwords makes the analysis more focused and relevant, improving the machine’s ability to accurately evaluate and classify documents based on their actual content. Stop words

Occurrence

The given graph represents a plot of the occurrence of words versus their value. Words that appear the most often in all the documents are called stopwords. They have little value and provide little meaningful contribution to the analysis. These stopwords are usually removed during the pre-processing stage. As we move past the stop words, the frequency of words drops sharply. Words that appear often enough but not excessively are called frequent words. These words usually indicate the main topic of the document. As the frequency of words continues to drop, the value of these words increases. These are called rare or valuable words. They appear the least but add the most value to the corpus. Therefore, when analysing text, we focus on frequent and rare words.

Frequent words

Rare / Valuable words

So, the bag-of-words technique lays the groundwork for understanding Value word frequency in documents. On the other hand, TFIDF builds upon that foundation to incorporate the importance of those words across a larger context, enhancing the overall analysis and information retrieval processes. The TFIDF algorithm is widely used in information retrieval and text mining. Here is a brief breakdown of its two terms: TF (Term Frequency): Measures how frequently a term appears in a document. IDF (Inverse Document Frequency): Measures how important a term is across the entire corpus by assessing how rare or common the term is. Let us understand this in more detail.

Term Frequency

Term frequency measures how often a word appears in a single document. You can easily find this using the document vector table, which lists how many times each word from the vocabulary appears in each document. i

love

to

play

football

is

a

great

game

watch

games

1

1

1

1

1

0

0

0

0

0

0

0

0

0

0

1

1

1

1

1

0

0

1

1

1

0

1

0

0

0

0

1

1

These numbers in the table are nothing but the term frequencies. ** Note: This topic is optional as per the CBSE syllabus and may not be covered in assessments.

380


Inverse Document Frequency

Now, let us examine the second part of TFIDF, known as Inverse Document Frequency. Document frequency refers to the number of different documents that contain a particular word, regardless of how often the word appears in each document. The example vocabulary’s document frequency would be as follows: i

love

to

play

football

is

a

great

game

watch

games

2

2

2

1

3

1

1

1

1

1

1

As you can see, the term “football” has three document frequencies because they appear in three different documents, and the terms “i”, “love”, and “to” have two document frequencies because they appear in two different documents. The remaining ones happened in a single document; therefore, their document frequency is one. For inverse document frequency, we need to put the document frequency in the denominator, and the total number of documents should be in the numerator. Since there are three documents in total in this case, the inverse document frequency is as follows: i

love

to

play

football

is

a

great

game

watch

games

3/2

3/2

3/2

3/1

3/3

3/1

3/1

3/1

3/1

3/1

3/1

In the end, the TFIDF formula for any word W is as follows: TFIDF(W) = TF(W) * log(IDF(W)) Log is to the base of 10 in this case. The IDF values will now be multiplied by the TF values. Keep in mind that the IDF values apply to the corpus, whereas the TF values are specific to each document. As a result, we must multiply each row in the document vector table by the IDF values. i

love

to

play

football

is

a

great

game

watch

games

1*log(3/2)

1*log(3/2)

1*log(3/2)

1*log(3)

1*log(3/3)

0*log(3)

0*log(3) 0*log(3) 0*log(3)

0*log(3) 0*log(3)

0*log(3/2)

0*log(3/2)

0*log(3/2)

0*log(3)

1*log(3/3)

1*log(3)

1*log(3) 1*log(3) 1*log(3)

0*log(3) 0*log(3)

1*log(3/2)

1*log(3/2)

1*log(3/2)

0*log(3)

1*log(3/3)

0*log(3)

0*log(3) 0*log(3) 0*log(3)

1*log(3) 1*log(3)

It is evident from this that all of the vocabulary terms follow a similar pattern, with IDF values being the same in every row. Once every value has been computed, we obtain: i

love

to

play

football

is

a

great

game

watch

games

0.176

0.176

0.176

0.477

0

0

0

0

0

0

0

0

0

0

0

0

0.477

0.477

0.477

0.477

0

0

0.176

0.176

0.176

0

0

0

0

0

0

0.477

0.477

The words have now been converted into numerical values, representing their significance in each document. Since we have a small dataset, even common words like ‘is’ and ‘a’ have relatively high values. However, as the IDF increases, the value of such words decreases. For example: Total number of documents: 10 Number of documents containing ‘is’: 10 IDF(‘is’) = 10/10 = 1 Chapter 25 • Data Processing

381


Since log(1) = 0, so the value of ‘is’ becomes 0. Number of documents containing ‘pollution’ word: 3 IDF(‘pollution’) = 10/3 = 3.3333... Since log(3.3333)≈0.522, indicating that ‘pollution’ has significant value in the corpus. Let us summarise: 1. Words that appear in all documents with high term frequencies have the lowest values and are typically considered stopwords. 2. A word with a high TFIDF value needs to have a high term frequency but a low document frequency, indicating its importance in a specific document rather than across all documents. 3. These values help the computer determine which words are important during natural language processing. The higher the value, the more critical the word is for the corpus.

Applications of TFIDF

TFIDF is a widely used technique in the field of NLP. Its applications include: •

Document Classification: TFIDF assists in categorising documents by type and genre. By analysing the significance of words within a document, it can help identify whether a document belongs to categories such as news, sports, or technology.

•

Topic Modelling: TFIDF aids in predicting the main topics of a corpus. It helps uncover the themes and subjects discussed in a collection of documents by identifying and ranking the most important words.

•

Information Retrieval Systems: TFIDF is crucial in extracting valuable information from a corpus. It enhances search engines and information retrieval systems by highlighting the most relevant documents based on the query terms.

•

Stopword Filtering: TFIDF helps remove unnecessary words from a text body. By identifying common but insignificant words, it ensures that only meaningful words are analysed, improving the efficiency and accuracy of NLP tasks.

•

Sentiment Analysis: TFIDF can be used to identify key terms that contribute to the sentiment of a document, helping in the analysis of opinions and emotions expressed in texts.

•

Content Recommendation: By understanding the importance of terms within documents, TFIDF can enhance recommendation systems, suggesting relevant articles or documents to users based on their reading history and preferences.

•

Text Summarisation: TFIDF helps in generating concise summaries of documents by identifying and retaining the most informative sentences.

•

Spam Detection: TFIDF can assist in distinguishing between spam and legitimate content by analysing the frequency and importance of terms commonly found in spam messages.

Try It Yourself

Consider the following corpus: Document 1: She enjoys hiking in the mountains. Document 2: The mountains are beautiful and peaceful. Document 3: Hiking is a great way to explore nature. Now, let us perform the following tasks in the given corpus using the following links: 1. Sentence Segmentation: https://tinyurl.com/y36hd92n 2. Tokenisation: https://text-processing.com/demo/tokenize/

382


3. Stopwords removal: https://demos.datasciencedojo.com/demo/stopwords/ 4. Lowercase conversion: https://caseconverter.com/ 5. Stemming: http://textanalysisonline.com/nltk-porter-stemmer 6. Lemmatisation: http://textanalysisonline.com/spacy-word-lemmatize 7. Bag of Words: Create a document vector table for all documents. 8. Generate TFIDF values for all the words. 9. Find the words having the highest value. 10. Find the words having the least value.

Natural Language Toolkit (NLTK)**

Natural language processing (NLP) is a field that focuses on making natural human language usable by computer programs. Natural Language Toolkit (NLTK) is a library in Python designed to help with various tasks in natural language processing and computational linguistics. It provides tools and resources to work with human language data, including text processing libraries and pre-trained models. A lot of the data that you could be analysing is unstructured data and contains human-readable text. Before you can analyse that data programmatically, you first need to preprocess it. This kind of text preprocessing task can be done with NLTK so that you will be ready to apply it to future projects. You will also learn how to do some basic text analysis and create visualisations. The command to install NLTK library is as follows: pip install nltk Python program to perform basic NLP tasks using NLKT library: import nltk from nltk.tokenize import word_tokenize, sent_tokenize from nltk import pos_tag, ne_chunk from nltk.corpus import stopwords # Download necessary NLTK datasets nltk.download(‘punkt’) nltk.download(‘averaged_perceptron_tagger’) nltk.download(‘maxent_ne_chunker’) nltk.download(‘words’) nltk.download(‘stopwords’) # Sample text text = “”” John and Mary went to the market to buy some fruits. They bought apples, oranges, and bananas. Later, they visited the new cafe downtown. Mary met her friend Lisa there. “””

** Note: This topic is optional as per the CBSE syllabus and may not be covered in assessments.

Chapter 25 • Data Processing

383


# Sentence Tokenization

sentences = sent_tokenize(text) print(“Sentences:”)

for sentence in sentences: print(sentence)

# Word Tokenization

words = word_tokenize(text) print(“\nWords:”) print(words)

# Removing Stop Words

stop_words = set(stopwords.words(‘english’))

filtered_words = [word for word in words if word.lower() not in stop_words] print(“\nFiltered Words (excluding stop words):”) print(filtered_words)

# Part-of-Speech Tagging

tagged_words = pos_tag(filtered_words) print(“\nPart-of-Speech Tags:”) print(tagged_words)

# Named Entity Recognition

named_entities = ne_chunk(pos_tag(filtered_words)) print(“\nNamed Entities:”) print(named_entities) Output: [nltk_data] Downloading package punkt to /root/nltk_data... [nltk_data]

Unzipping tokenizers/punkt.zip.

[nltk_data] Downloading package averaged_perceptron_tagger to [nltk_data] [nltk_data]

/root/nltk_data... Unzipping taggers/averaged_perceptron_tagger.zip.

[nltk_data] Downloading package maxent_ne_chunker to [nltk_data] [nltk_data]

/root/nltk_data... Unzipping chunkers/maxent_ne_chunker.zip.

[nltk_data] Downloading package words to /root/nltk_data... [nltk_data]

Unzipping corpora/words.zip.

[nltk_data] Downloading package stopwords to /root/nltk_data... [nltk_data] Sentences:

384

Unzipping corpora/stopwords.zip.


John and Mary went to the market to buy some fruits. They bought apples, oranges, and bananas. Later, they visited the new cafe downtown. Mary met her friend Lisa there. Words: [‘John’, ‘and’, ‘Mary’, ‘went’, ‘to’, ‘the’, ‘market’, ‘to’, ‘buy’, ‘some’, ‘fruits’, ‘.’, ‘They’, ‘bought’, ‘apples’, ‘,’, ‘oranges’, ‘,’, ‘and’, ‘bananas’, ‘.’, ‘Later’, ‘,’, ‘they’, ‘visited’, ‘the’, ‘new’, ‘cafe’, ‘downtown’, ‘.’, ‘Mary’, ‘met’, ‘her’, ‘friend’, ‘Lisa’, ‘there’, ‘.’] Filtered Words (excluding stop words): [‘John’, ‘Mary’, ‘went’, ‘market’, ‘buy’, ‘fruits’, ‘.’, ‘bought’, ‘apples’, ‘,’, ‘oranges’, ‘,’, ‘bananas’, ‘.’, ‘Later’, ‘,’, ‘visited’, ‘new’, ‘cafe’, ‘downtown’, ‘.’, ‘Mary’, ‘met’, ‘friend’, ‘Lisa’, ‘.’] Part-of-Speech Tags: [(‘John’, ‘NNP’), (‘Mary’, ‘NNP’), (‘went’, ‘VBD’), (‘market’, ‘NN’), (‘buy’, ‘VB’), (‘fruits’, ‘NNS’), (‘.’, ‘.’), (‘bought’, ‘VBD’), (‘apples’, ‘NNS’), (‘,’, ‘,’), (‘oranges’, ‘NNS’), (‘,’, ‘,’), (‘bananas’, ‘NNS’), (‘.’, ‘.’), (‘Later’, ‘RB’), (‘,’, ‘,’), (‘visited’, ‘VBD’), (‘new’, ‘JJ’), (‘cafe’, ‘JJ’), (‘downtown’, ‘NN’), (‘.’, ‘.’), (‘Mary’, ‘NNP’), (‘met’, ‘VBD’), (‘friend’, ‘NN’), (‘Lisa’, ‘NNP’), (‘.’, ‘.’)] Named Entities: (S (PERSON John/NNP) (PERSON Mary/NNP) went/VBD market/NN buy/VB fruits/NNS ./. bought/VBD apples/NNS ,/, oranges/NNS ,/, bananas/NNS ./. Later/RB ,/, visited/VBD

Chapter 25 • Data Processing

385


new/JJ cafe/JJ downtown/NN ./. (PERSON Mary/NNP) met/VBD friend/NN (PERSON Lisa/NNP) ./.) In the given program, •

The word_tokenize() function breaks the text into individual words, and sent_tokenize() function splits the text into sentences.

•

The pos_tag() function tags each word with its part of speech (e.g., noun, verb).

•

The ne_chunk() function identifies named entities, like people or organisations.

•

The nltk.download() function downloads required datasets for tokenisation, part-of-speech tagging, named entity recognition, and stopwords. These datasets help NLTK perform these tasks.

Activity Time Activity 1: Case Study Analysis

(Group Work)

1. Divide the class into groups of 3–4 participants. Each group will select a specific case where NLP techniques were

successfully implemented (e.g., sentiment analysis in social media, spam detection in emails, and language translation services). Each group should analyse the following aspects of their chosen case: •

The challenges faced before implementing NLP techniques.

•

The specific NLP techniques used (e.g., tokenisation, stemming, lemmatisation).

•

The solutions provided by these techniques and how they addressed the challenges.

•

The impact and effectiveness of the NLP implementation.

Each group will present their findings to the class, highlighting the key points of their analysis. Activity 2: Research Work

(Individual Work)

Research advanced applications of text normalisation and NLP techniques in various domains. Review scholarly articles

and case studies to analyse recent developments and technological trends. Write a comprehensive report and present your findings, highlighting their significance and future directions.

386


Chapter Checkup A Select the correct option. 1 What does sentence segmentation involve? a Combining multiple sentences into one b Breaking down a large text into individual sentences c Translating sentences into different languages d Removing punctuation from sentences 2 What are tokens in the context of NLP? a Individual elements of a sentence, such as words, numbers, and special characters b Entire paragraphs of text c Synonyms of words in a sentence d Annotations are added to the text for clarity 3 How does lemmatisation differ from stemming? a Lemmatisation ignores the context of the word b Lemmatisation only works with nouns c Lemmatisation increases the complexity of words d Lemmatisation considers the meaning of the word 4 What is the Natural Language Toolkit (NLTK)? a A software for voice recognition b A library in Python for natural language processing c A hardware tool for processing text d A programming language for web development 5 Which of the following words is considered a stopword in the sentence: “She went to the store after the meeting”? a Store b Meeting c Went d The B Fill in the blanks with the most suitable words. 1 Text normalisation is a crucial step in ...................... that involves cleaning and standardising text data. 2 Stemming reduces words to their most basic or ...................... form. 3 ...................... considers the context and meaning of the word. 4 NLTK provides tools and resources for working with human ...................... data. C

State whether the following statements are True or False. Correct the statements that are false. 1 Tokens include entire paragraphs of text. 2 Stemming increases the length of words. 3 The Bag of Words model maintains the order of words in a text. 4 Term frequency measures how often a word appears in a single document.

Chapter 25 • Data Processing

387


D Answer the following questions. (Solved) Q1. Why is sentence segmentation important? A1. Sentence segmentation is important because it breaks down a large text into individual sentences, making it easier to work with the text by focusing on smaller, more manageable parts. Q2. Discuss the significance of the Bag of Words (BoW) model in text representation and analysis. A2. The Bag-of-Words (BoW) model is significant in text representation and analysis as it simplifies the representation of text by treating it as a collection of words without considering grammar or word order. This model focuses on the frequency of words in the text, allowing for easy identification of important terms. The BoW model is widely used in various NLP tasks, including text classification, sentiment analysis, and information retrieval, where understanding the significance of words is crucial. By creating a vocabulary and counting word occurrences, the BoW model helps in converting textual data into a numerical form, making it suitable for machine learning algorithms and improving the accuracy and relevance of text analysis. Q3. What are the key steps involved in text normalisation? A3. The following are the key steps involved in text normalisation: Sentence Segmentation

Tokenisation

Removing Stopwords, Special Characters, and Numbers

Lemmatisation

Stemming

Converting Text to a Common Case

Q4. You are working on a sentiment analysis project involving customer reviews. Explain how sentence segmentation and tokenisation would be applied in this project and why they are important. A4. Sentence segmentation would be used to break down customer reviews into individual sentences, making the text easier to analyse. Tokenisation would then break these sentences into individual words or tokens. These steps are important because they help in focusing on smaller, more manageable parts of the text, allowing for a more detailed analysis of the sentiments expressed in the reviews.

AI Activities 1 Visit the link: https://www.youtube.com/watch?v=jnB-BVtucEY to learn more about text normalisation. 2 Visit the link: https://www.youtube.com/watch?v=ATK6fm3cYfI to learn more about text representation using TFIDF.

Answer Key 4. b

5. d

A

1. b

2. a

3. d

B

1. NLP

2. Root

3. Lemmatisation

C

1. False. Tokens refer to individual elements of a sentence, such as words, numbers, and special characters.

4. Language

2. False. Stemming reduces words to their most basic or root form.

3. False. Bag of Words algorithm represents text as a collection of words without worrying about grammar or order.

4. True.

388


Unit Reflection

Key Terms • NLP: NLP is the domain of AI that deals with the language-based interactions between a machine and a human, as well as between two machines. • Chatbots: Chatbots are computer programs designed to imitate human-like conversation using text or speech interfaces. • Virtual Assistant: A virtual assistant is an AI tool that understands and responds to voice commands or text inputs, such as questions and requests, or performs tasks for you. • Syntax: Syntax refers to the rules that establish the structure of a language, involving the grammatical arrangement of words in a sentence. • Text normalisation: Text normalisation is a crucial step in NLP that involves cleaning and standardising text data. • Corpus: The term used for the whole textual data from all the documents is known as corpus. • Tokens: Tokens refer to individual elements of the sentence, such as words, numbers, and special characters. • Lemmatisation: Lemmatisation is an NLP technique that involves reducing words to their base or root form. • Bag of Words: The Bag of Words (BoW) is an NLP model that helps in extracting features from text, which can be useful for machine learning algorithms.

Things to Remember • NLP enables computers to understand, comprehend, and generate human language in a way that is both meaningful and contextually appropriate. • Chatbots, virtual assistants, sentiment analysis, automatic summarisation, etc. are some of the numerous applications of NLP in our daily lives. • Part-of-speech tagging involves assigning a tag to each token based on its grammatical function in the sentence. • In natural language, a single word can have multiple meanings, and its significance changes according to the surrounding context. • Google Translate is an AI-powered translation app that allows users to translate text into different languages. • The various stages of an AI project cycle are problem scoping, data acquisition, data exploration, modelling, and evaluation. • Text normalisation is a process that ensures that the text is in a consistent format, making it easier for machines to process and understand. • In sentence segmentation, we break down a large text (corpus) into individual sentences. Each sentence is then treated as a separate piece of data. • After segmenting the text into sentences, the next step is to divide each sentence into tokens. • In the process of data preprocessing, we aim to retain only the most relevant tokens, removing those that do not contribute meaningfully to the analysis. This involves identifying and removing stopwords, special characters, and numbers when they are deemed unnecessary. Unit Reflection

389


• Stopwords, such as “the”, “is”, “in”, “and”, etc., are words that appear frequently in a text but do not provide substantial value to it. • After stopword removal, we convert all characters to a standard case, commonly lowercase. • In the process of stemming, words are stripped of their prefixes and suffixes in order to create a fundamental form called the root word. These root words might not always be meaningful. • Lemmatisation reduces words to their base or root form. Unlike stemming, lemmatisation considers the meaning of the word. • In the Bag of Words (BoW) model, text (like a sentence or document) is shown as a collection of words without worrying about grammar or the order of the words. • The steps in the process of implementation of the bag of words algorithm are normalising the text, creating a dictionary, and creating document vectors for all the documents. • Term frequency measures how often a word appears in a single document. • Document frequency refers to the number of different documents that contain a particular word, regardless of how often the word appears in each document. • Script bots work around a script which is programmed into them. • Smart bots operate on larger databases and other resources directly. • NLP can be used to auto-generate short and clear summaries of longer texts or documents through AI algorithms and techniques. • Human language operates according to specific rules. Within a sentence, we find nouns, verbs, adverbs, and adjectives—all essential for effective communication. • Sentiment analysis is an NLP technique used to analyse and interpret the sentiment expressed in text data. By comprehending human language, NLP enables computers to detect whether the sentiment conveyed in text is positive, negative, or neutral.

390


Test Your Knowledge A. Select the correct option. 1. What is the primary goal of Natural Language Processing (NLP)? a. To develop new programming languages. b. To enable computers to understand and generate human language. c. To create faster computer processors. d. To replace human language with computer code. 2. Which of the following applications heavily relies on NLP? a. Word processing software

b. Social media platforms

c. Virtual assistants like Siri and Alexa

d. Computer graphics design tools

3. How does sentiment analysis in NLP help businesses? a. By improving website design. b. By tracking user emotions in social media posts. c. By generating email content. d. By enhancing computer speed. 4. In the context of NLP, what is ’tokenisation’? a. Assigning grammatical tags to words. b. Analysing the emotional tone of a sentence. c. Translating text from one language to another. d. Splitting a sentence into individual words or tokens. 5. Which among the following is a chatbot? a. Chai Bot

b. Kuki Bot

c. CleverBot

d. All of these

B. Fill in the blanks with the most suitable words. 1. Chatbots use 2.

to comprehend user input and generate appropriate responses. analysis is an NLP technique used to determine the emotion or opinion in a text.

3. In NLP,

refers to the grammatical arrangement of words in a sentence.

4. The full form of NLTK is 5. In the AI project cycle, after the

Unit Reflection

. stage, data is gathered for NLP projects.

391


C. State whether the following are True or False. Correct the statements that are False. 1. NLP is a domain of AI that only deals with spoken language interactions between humans and machines. 2. Evaluation means to continuously refine the model based on user feedback to improve its performance and accuracy. 3. In an NLP project cycle, the modelling stage involves gathering and preparing data for training the AI model. 4. Part-of-speech tagging is a technique used to assign grammatical functions to tokens in a sentence. 5. The bag-of-words technique helps us determine how often a word appears in a document within a corpus.

D. Short-answer type questions. 1. How does part-of-speech tagging assist NLP algorithms in understanding a sentence? 2. Name any four applications of NLP. 3. Define lemmatisation.

E. Long-answer type questions. 1. Through a step-by-step process, calculate TFIDF for the given corpus and mention the word(s) having the highest value. Document 1: We are going to Mumbai Document 2: Mumbai is a famous place. Document 3: We are going to a famous place. Document 4: I am famous in Mumbai. 2. What are the steps of text normalisation? Explain them in brief. 3. Explain how NLP plays a pivotal role in enhancing chatbot capabilities.

F. Competency-based questions. 1. Ankita is working on an NLP project and encounters words with the same spelling but different meanings. Explain why context is important for determining the correct meaning by giving a suitable example.

2. Shalini needs an AI-powered tool that can translate text typed on a computer, handwritten notes, spoken words, and text captured in images. What application can she use for these translation needs?

3. The word “bark” has multiple meanings depending on the context. Consider the following examples: i. The dog barked loudly at the strangers. ii. The tree’s bark was rough to the touch. iii. The captain gave a command from the bark, a small sailing vessel. How does the meaning of “bark” change in each of the sentences above?

392


Unit 7 • Evaluation

26 Introduction to Model Evaluation

W

e have learnt about the five stages of the AI project cycle, i.e., Problem scoping, Data acquisition, Data exploration, Modelling, and Evaluation. In the Modelling stage, we make different types of models and then in the Evaluation stage, we check which model is better than the other model. Evaluation, the last stage of the AI project cycle, is important in ensuring that the selected AI model is reliable, effective, and safe for use. This stage helps to find the best model that accurately represents our data and produces the desired output. Data Exploration

Problem Scoping

Data Acquisition

Evaluation

Modelling

What is Evaluation?

Evaluation is the process of assessing an AI model to determine its value, quality, performance, and effectiveness. Evaluation helps select the best-performing model. It involves feeding test data into the model and comparing the outputs with actual answers.

Did You Know? AI systems can be evaluated using adversarial examples. Adversarial examples are specially designed inputs modified to trick the AI into making mistakes. For example, a small change in a pixel of an image might cause an AI

Evaluation ensures the following: Performance: Tests how well the AI model performs its task. Accuracy: Ensures the model produces correct outputs. Fairness: Verifies if the model makes unbiased decisions. Safety and Reliability: Checks whether the model operates safely and is reliable for deployment. Goal Achievement: Ensures the model meets its intended objectives and identifies areas for improvement.

393

system to misidentify a cat as a tiger. Testing AI systems with adversarial examples helps researchers understand the vulnerabilities of the models and develop techniques to make AI systems more robust and secure against potential attacks or errors.


Underfit, Overfit and Perfect Fit

In developing AI-based projects, the main goal is to build models that can effectively learn from data and perform tasks such as classification, regression, or prediction based on patterns in the dataset. This process involves training the model on a dataset and then evaluating its performance on new, unseen data. Model training is crucial for achieving the desired performance. If the model is too simple, it may fail to capture the underlying patterns in the data. Conversely, if the model is too complex, it might overfit the training data, meaning it performs well on the training data but poorly on unseen data. Therefore, finding the right balance in model training is essential for the model to perform well on both training and testing data. Let’s understand this concept precisely.

Underfitting

Underfitting occurs when the AI model is too simple to capture the underlying patterns of the data. It fails to learn trends and relationships from the training data and results in poor performance of the model on training and testing data. Example: Imagine you are building an AI-based model that predicts the number of mangoes on a tree based on the age of the tree and sunlight received by the tree in a day. Following is the training dataset for the model. Tree age (years)

Sunlight (Hours/day)

Number of mangoes

2

4

10

3

5

20

4

6

25

5

7

35

6

8

50

Now, here we are using a very simple model that predicts the number of mangoes based on the age of the tree without considering sunlight. In the underfitting scenario, the model predicts the number of mangoes based on the formula: Predicted number of mangoes = 5 * tree age Tree age (years)

Sunlight (Hours/day)

Predicted number of Mangoes

2

4

10

3

5

15

4

6

20

5

7

25

6

8

30

Now you can see that the model does not fit the training data well because it ignored the parameter sunlight, which plays an important role for the production of mangoes. This is a simple example of underfitting because the model fails to capture the relationship between tree age, sunlight, and the number of mangoes from the given dataset.

Overfitting

Overfitting happens when an AI model is very complex and learns the training data very well. It not only learns the general patterns in the training data but also captures the specific details that are unique to the training dataset. This results in memorising the training data extremely well without capturing the underlying relationships in the data. Such a model fails to generalise on new or unseen data and will perform well on the training data but poorly on new and unseen data.

394


Example: Consider a model where student scores are predicted based on the number of study hours. Following is the training dataset for the same. Study hours per day

Test Score

1

60

2

70

3

75

4

80

5

95

In an overfitting scenario, the model predicts the test score as follows: Predict Test Score = 40 + 10 * Study hours per day + 5 * (Study hours per day)^2 Here the model is too complex and will make the predictions as follows: Study hours per day

Actual Test Score

Predicted Test Score

1

60

55

2

70

80

3

75

115

4

80

160

5

95

215

You must be noticing that predicted test scores are increasing much faster than actual scores as the number of study hours increases. This reflects that the model not only learned training data but also captured the details that might not be true for new students or different study hours. A model should find a balance where it captures the general patterns without fitting the specific details of the data too closely.

Perfect Fit

A perfect fit refers to the AI model that has the right balance between underfit and overfit. Such a model captures the patterns in the training data without underfitting or overfitting. It generalises well on training data as well as on new and unseen data. Example: Consider a model where the student scores are predicted based on the number of study hours. Following is the dataset for the same. Study hours per day

Test Score

1

60

2

70

3

75

4

80

5

95

In the perfect fit scenario, the model predicts the test score as follows: Predict Test Score = 50 + 10 * Study hours per day

Chapter 26 • Introduction to Model Evaluation

395


Here, the model is neither too simple nor too complex. It will make the predictions as follows: Study hours per day

Actual Test Score

Predicted Test Score

1

60

60

2

70

70

3

75

80

4

80

90

5

95

100

In this scenario, the predicted test score shows a close match with actual test scores. The model has captured the general relationship between Study hours per day and Test scores, i.e., more study hours generally lead to more test scores, without overestimating and underestimating the training data.

Think and Tell

Why is it important to evaluate AI models on data that they have not seen before?

Remember

Evaluation must ensure that the AI system works well on real data, not only on data used for training the AI system.

Activity Time Activity 1: Prepare quiz

(Group Work)

Ask the students to prepare a quiz about model evaluation and the importance of achieving balance during training to avoid underfitting and overfitting. Conduct the quiz in the class and discuss why the answer is correct or incorrect. Activity 2: Research Task

(Group Work)

Ask students to research real-life examples that represent overfitting and underfitting in various fields like weather

forecasting and sports score prediction. The students will present their examples and discuss what could be done to achieve a perfect fit.

Chapter Checkup A Select the correct option. 1 What is the main purpose of evaluating the AI models? a To ensure that the model is complex enough.

b To increase the size of the dataset.

c To eliminate the need for human insight.

d To measure the model’s performance and reliability. 2 What does it mean when an AI model is underfitting the data? a The model performs well on new and unseen data. b The model performs poorly on training and test data. c The model performs exceptionally well on the training data. d The model performs well on training data but poorly on new data.

396


3 A perfect fit indicates that a model a Memorises the training data exactly. b Accurately captures the patterns in the training data without overfitting or underfitting. c Underperforms on the testing data. d Is the simplest model possible. 4 Given the following performance metrics for three different AI models on a classification task: Model A: Training Accuracy = 85%, Testing Accuracy = 50% Model B: Training Accuracy = 60%, Testing Accuracy = 58% Model C: Training Accuracy = 92%, Testing Accuracy = 89% Which model is most likely to be overfitting, underfitting, and perfectly fitting, respectively? a Model A is overfitting, Model B is underfitting, and Model C is perfectly fitting. b Model A is underfitting, Model B is overfitting, and Model C is perfectly fitting. c Model A is perfectly fitting, Model B is overfitting, and Model C is underfitting. d Model A is underfitting, Model B is perfectly fitting, and Model C is overfitting. B Fill in the blanks with the most suitable words. 1 Finding the right balance in model training is essential for the model to perform well on both ...................... and ...................... data. 2 ...................... is the process of assessing an AI model to determine its value, quality, performance, and effectiveness. 3 An AI model that performs very well on training data but poorly on new and unseen data is said to be....................... 4 Reducing ...................... of the model can help prevent overfitting. 5 A model that balances between underfitting and overfitting is said to have a ...................... fit. C

State whether the following statements are True or False. Correct the statements that are false.

1 Underfitting occurs when a model is too complex and captures too many specific details from the training data. 2 A perfect fit model should neither be too simple nor too complex. 3 Overfitting occurs when a model performs well on both training data as well as new and unseen data. 4 Evaluation helps to identify areas for improvement in AI systems.

D Answer the following questions. Q1. What does evaluation ensure about the AI model? A1. Evaluation ensures performance, accuracy, fairness, safety, reliability, and goal achievement of an AI model. Q2. Why is it important to evaluate the AI model on both training and test data? A2. Training data helps the model learn patterns, and test data ensures the model is well trained and works well on new and unseen data, leading to more reliable AI systems. Evaluating an AI model on both training and test data helps to identify overfitting and underfitting. Q3. Kashika is developing a machine learning model to predict house prices based on various features, such as size, location, and the number of rooms. She creates three different models: Model A: A simple AI model with only a few features. Model B: A complex model with many features and interactions. Model C: A balanced model with a reasonable number of features and interactions. Kashika evaluates the performance of each model using both training data and a separate testing dataset. Model A performs poorly on both the training and testing data.

Chapter 26 • Introduction to Model Evaluation

397


Model B shows excellent performance on the training data but performs poorly on the testing data. Model C achieves good performance on both the training and testing data. Based on this information, identify which model is likely underfitting, which one is overfitting, and which one has a perfect fit. A3. Model A is underfitting Model B is overfitting Model C is a perfect fit Q4. Identify the types of models in the figure given below.

Values

Values

Model A

Time

Values

Model B

Time

Model C

Time

A4. i. Model A: Underfitted ii. Model B: Perfect Fit iii. Model C: Overfitted

AI Activities 1 V isit the link: https://towardsdatascience.com/overfitting-and-underfitting-principles-ea8964d9c45c to explore solutions of underfitting and overfitting 2 V isit the link: https://www.youtube.com/watch?v=Y3xmxQgV4B4 to explore the examples of overfitting and underfitting. 3 V isit the link: https://www.kaggle.com/code/dansbecker/underfitting-and-overfitting to understand overfitting and underfitting through python code examples.

Answer Key A

1. d

B

1. Training, Testing

C

1. False. Overfitting happens when an AI model is very complex and learns the training data very well. 2. T rue.

2. b

3. b

4. a

2. Evaluation

3. Overfitting

4. Complexity

5. Perfect

3. False. Perfect fit occurs when a model performs well on both training data as well as new and unseen data.

4. True.

398


Unit 7 • Evaluation

27 Model Evaluation Terminologies

A

s already discussed, in the evaluation stage of the AI project cycle, we test all the models to see which one works best and gives the most reliable results. We try different ways to test our models to make sure they are accurate and efficient before we decide which one to use in the real world. During the process of evaluating our model, we come across different terms. Let us understand them with the help of an example.

Understanding Model Evaluation: Prediction Vs Reality

Imagine an AI-based prediction model deployed in a vegetable sorting factory. The model’s objective is to predict whether vegetables are fresh or rotten. To understand how well our model works, we compare its predictions with the actual scenario in the area in which this prediction model has been deployed. So, we have two conditions to consider: prediction and reality. •

Prediction: This is the output given by the machine.

•

Reality: This is the actual situation in the field at the time the prediction was made.

Now, let us look at various scenarios based on these conditions:

Scenario 1 Case 1: Are the vegetables fresh?

In the picture, we can see that the vegetables are fresh. True Positive (TP) Prediction: The model predicts the vegetables are fresh. Reality: The vegetables are indeed fresh. Output: Correct prediction. It indicates that the model successfully predicted fresh vegetables. Prediction

Yes

Reality

Yes TRUE POSITIVE

399


Case: 2 Are the vegetables fresh?

In the picture, we can see that the vegetables are rotten. True Negative (TN) Prediction: The model predicts the vegetables are rotten. Reality: The vegetables are indeed rotten. Output: Correct prediction. The machine correctly predicts that the vegetables are rotten. Prediction

NO

Reality

NO TRUE NEGATIVE

Case 3: Are the vegetables fresh?

Here, we can see that the vegetables are not fresh. False Positive (FP) Prediction: The model predicts the vegetables are fresh. Reality: The vegetables are not fresh. Output: Incorrect prediction. It indicates that the model incorrectly predicts that the vegetables are fresh when they are actually not. Prediction

Yes

Reality

NO FALSE POSITIVE

Case 4: Are the vegetables fresh?

Here, we can see in the picture that the vegetables are fresh. False Negative (FN) Prediction: The model predicts the vegetables are rotten. Reality: The vegetables are actually fresh. Output: Incorrect prediction. It indicates that the model incorrectly predicts rotten vegetables when the vegetables are actually fresh. Prediction

No

Reality

Yes FALSE NEGATIVE

Scenario 2

Consider that we use AI-based prediction model that checks and gives predictions if a patient has a particular disease. The main purpose of this model is to predict the possibility of disease of that patient. Thus, we need to check the accuracy of this model, and therefore, we check, whether the prediction is right or wrong. Let us consider different cases for the same scenario:

400


Case 1: Does the patient have a disease? Prediction: The model predicts that the patient has a disease.

Reality: As we can see in the provided picture, the patient does have the disease. Output: The machine correctly predicts that the patient has disease. Therefore, this is a case of True Positive. Prediction

YES

Reality

YES TRUE POSITIVE

Case 2: Does the patient have disease? Prediction: The model predicts that the patient does not have disease. Reality: As we can see in the provided picture, the patient does not have the disease. Output: The machine correctly predicts that the patient does not have the disease. Therefore, this is a case of True Negative. Prediction

NO

Reality

NO TRUE NEGATIVE

Case 3: Does the patient have disease? Prediction: The model predicts that the patient has disease. Reality: As we can see in the provided picture, the patient does not have the disease. Output: The model incorrectly predicts yes. There is a mismatch between reality and prediction. Therefore, this is a case of False positive. Prediction

YES

Reality

NO FALSE POSITIVE

Case 4: Does the patient have a disease? Prediction: The model predicts that the patient does not have a disease. Reality: As we can see in the provided picture, the patient does have the disease. Output: The model incorrectly predicts No when in reality it’s a Yes. Therefore, prediction is False Negative. Prediction

NO

Reality

YES FALSE NEGATIVE

Chapter 27 • Model Evaluation Terminologies

401


In summary, this is what the following terminologies mean: True Positive (TP): When the value predicted by the model is positive and the actual value is also positive. True Negative (TN): When the value predicted by the model is negative and the actual value is also negative. False Positive (FP) (Type I Error): When the value predicted by the model is positive but the actual value is negative. False Negative (FN) (Type II Error): When the value predicted by the model is negative but the actual value is positive.

Confusion Matrix

In the evaluation stage of an AI model, a confusion matrix is a table that helps visualise the performance of the model by summarising the counts of correct and incorrect predictions. It allows us to see the actual and the predicted results in a structured format. Reality

negative

positive

positive True Positive (TP)

False Positive (FP)

•

•

Prediction

•

Prediction and Reality matches (True)

Prediction is True (Positive)

negative

False Negative (FN) •

•

•

Prediction is True (Positive)

True Negative (TN)

Prediction and • Reality do not match (False) Prediction is False (Negative)

Prediction and Reality do not match (False)

•

Prediction and Reality matches (True)

Prediction is False (Negative)

The following is an example of a confusion matrix for predicting whether vegetables are fresh or not. Reality: Fresh

Reality: Rotten

Prediction: Fresh

True Positive (TP)

False Positive (FP)

Prediction: Rotten

False Negative (FN)

True Negative (TN)

Activity Containment Zone Prediction Model

Objective: To make a confusion matrix based on the data given for the containment zone prediction model.

Consider a scenario where an AI prediction model is deployed to predict whether a specific area will be a containment zone due to a disease outbreak. The aim of the model is to classify areas as either “containment zone” or “not a containment zone”.

402


Containment zone: A specific geographical area identified and isolated from other areas by government and health agencies to control the spread of an infectious disease. Consider and complete the following table. You need to identify areas as either “containment zone” or “not a containment zone” based on the scenario given in the table. Then, you need to classify each scenario as TP/FP/TN/ FN based on predicted and actual labels. One has been done for you. Actual (Reality) label

Scenario Description An area with a recent increase in reported cases is correctly identified as a containment zone.

Containment Zone

Predicted label

Classification (TP/FP/TN/FN)

Containment Zone TP

A previously declared containment zone shows no new cases for an extended period and is incorrectly classified as not a containment zone. A residential area is mistakenly marked as a containment zone due to misinterpreted data from neighbouring areas. An area with no reported cases is correctly identified as not needing containment precautions. A remote village, initially labelled a “no containment zone” later experiences a sudden increase in cases due to undetected transmissions. A densely populated area with initial positive report cases turns out to be false as later testing reveals no active infection cases.

Now, consider the data collected from the containment zone prediction model and create a confusion matrix for it. True Positive=50 (In 50 zones, the model predicted the area to be a containment zone, and the area actually turned out to be a containment zone) True Negative=40 (In 40 zones, the model predicted the area to be not a containment zone, and the area actually turned out to be not a containment zone) False Positive=10 (In 10 zones, the model predicted the area to be a containment zone, but the area actually turned out to be not a containment zone) False Negative=5 (In 5 zones, the model predicted the area to be not a containment zone, but the area actually turned out to be a containment zone) Confusion matrix for containment zone prediction is as follows: Reality: Containment Zone

Reality: Not Containment Zone

Predicted: Containment Zone

50 (TP)

10 (FP)

Predicted: Not Containment Zone

5 (FN)

40 (TN)

Chapter 27 • Model Evaluation Terminologies

Remember A confusion matrix is not an evaluation metric but a record which can help in evaluation.

403


Activity Time (Group Activity)

Activity 1: Identify model predictions

Instruct students to consider the case study of an assignment plagiarism detection system. Students need to identify the cases when the system will predict true positive, false positive, true negative, and false negative. Ask students to create aconfusion matrix for evaluating the system’s performance.

(Pair Activity)

Activity 2: Evaluating the disease test model

Make a group of two students and ask them to collect data on patients regarding test results and disease status. Ask students to explore model evaluation terminologies regarding the same dataset and create a confusion matrix for it.

Chapter Checkup A Select the correct option. 1 What does the true positive represent in the context of model evaluation? a Instances incorrectly predicted as positive b Instances correctly predicted as positive c Instances incorrectly predicted as negative

d Instances correctly predicted as negative

2 What does the false positive represent in the context of model evaluation? a Instances incorrectly predicted as positive b Instances correctly predicted as positive c Instances incorrectly predicted as negative

d Instances correctly predicted as negative

3 Which of the following best describes about the confusion matrix? a It only provides the accuracy of the model.

b It is used to evaluate regression models. c It visualises the performance of a model by showing actual vs predicted classifications.

d It provides information about True Positive and False Negative only. 4 In the context of AI, what is a True Negative (TN)? a Model predicts positive, but reality is negative. b Model predicts negative, and reality is also negative. c Model predicts positive, and reality is also positive. d Model predicts negative, but reality is positive. B Fill in the blanks with the most suitable words.

1 In a confusion matrix, instances that in reality are ...................... but predicted as ...................... is termed as False Negative (FN). 2

...................... in a confusion matrix indicates instances that are predicted as positive but are actually negative.

3 ...................... is the output given by the machine. 4 ...................... allows us to see the actual and predicted results in a structured format. C

State whether the following statements are True or False. Correct the statements that are false. 1 TP and TN represent correct predictions.

2 False Positive (FP) in a confusion matrix represents instances that are incorrectly predicted as positive by the model. 3 True Positive (TP) represents instances that are incorrectly predicted as negative by the model. 4 Each cell in a confusion matrix represents the count of instances that belong to a specific combination of actual and predicted classes.

404


D Answer the following questions. Q1. What does FP represent in the confusion matrix? A1. False Positive (FP) in a confusion matrix represents instances that are incorrectly predicted as positive by the model. Q2. Differentiate between true negative and false negative. A2.

True Negative

False Negative

Definition

Instances were correctly predicted as negative.

Instances were incorrectly predicted as negative.

Meaning

The model predicts negative correctly

The model predicts negative incorrectly

Example

A medical test correctly identifies healthy individuals as negative (no disease)

A medical test incorrectly identifies individuals with the disease as negative (no disease)

Outcome

Correct predictions of negatives

Missed predictions of positives.

Q3. Suppose you have developed a spam email classifier. After training your model and testing it on a dataset of 100 emails (50 spam and 50 non-spam), you obtain the following results: The model correctly identified 40 spam emails as spam.

•

The model correctly identified 45 non-spam emails as non-spam.

•

The model incorrectly classified 5 non-spam emails as spam.

•

The model incorrectly classified 10 spam emails as non-spam.

•

Based on the above results, construct the confusion matrix for your spam email classifier.

A3.

Reality: Spam

Reality: Not spam

Predicted: Spam

40 (TP)

5 (FP)

Predicted: Not spam

10 (FN)

45 (TN)

AI Activities 1 Visit the link: https://www.youtube.com/watch?v=lt1YxJ_8Jzs to explore more about the confusion matrix. 2 Visit the link: https://studio.code.org/s/coursef-2023/lessons/14 to learn about model evaluation.

Answer Key A

1. b

B

1. positive, negative

C

1. True

2. a

3. c

4. b

2. False Positive (FP)

3. Prediction

4. Confusion matrix

2. T rue

3. False. True Positive (TP) represents instances that are correctly predicted as positive by the model.

4. True.

Chapter 27 • Model Evaluation Terminologies

405


Unit 7 • Evaluation

28 Confusion Matrix

I

n machine learning, classification is the process of classifying a given collection of data into separate groups. We use the confusion matrix to evaluate the performance of a classification model. In this chapter, we will learn the importance of the confusion matrix.

Defining Confusion Matrix

A confusion matrix is a predictive summary that helps evaluate the performance of a classification model. Prediction and reality can be easily mapped together with the help of a confusion matrix. The matrix displays the number of accurate and inaccurate predictions for each class. It helps us analyse how well the AI model’s predictions match actual results or reality. We can get four possible combinations for the model’s predicted and actual values in the confusion matrix. TP

True Positive

Prediction & Reality Matches (True)

Prediction is True (Positive)

TN

True Negative

Prediction & Reality Matches (True)

Prediction is False (Negative)

FP

False Positive

Prediction & Reality Do Not Match (False)

Prediction is True (Positive)

FN

False Negative

Prediction & Reality Do Not Match (False)

Prediction is False (Negative)

This is how a confusion matrix looks like: Let us understand the conditions associated with the confusion matrix: True positives (TP): It happens when a positive data point is correctly predicted by the model.

Reality

The Confusion Matrix

True negatives (TN): It happens when a negative data point is correctly predicted by the model. False positives (FP): It happens when a negative data point is wrongly predicted by the model. It is also known as a Type I error.

Prediction

Yes

No

Yes

True Positive (TP)

False Positive (FP)

No

False Negative (FN)

True Negative (TN)

False negatives (FN): It happens when a positive data point is mis-predicted by the model. It is also known as a Type II error. Let us consider an example to better understand the concept of a confusion matrix.

406


Example

Suppose you have a model that predicts whether an animal is a dog or a cat. You test it on a set of 10, where 6 are dogs and 4 are cats. S.No

1

2

3

4

5

6

7

8

9

10

Actual

Dog

Dog

Dog

Cat

Dog

Cat

Dog

Dog

Cat

Cat

Predicted

Dog

Cat

Dog

Cat

Dog

Dog

Dog

Dog

Dog

Cat

Result

TP

FN

TP

TN

TP

FP

TP

TP

FP

TN

In the table above, you can clearly see that for each data point in the dataset that contains dogs and cats, the model predicts if an animal is a dog or a cat. If the prediction matches the reality, then the prediction is true; otherwise it is false. So, based on the same, a confusion matrix can be constructed. Reality

The Confusion Matrix Prediction

Yes

No

Yes

5 (TP)

2 (FP)

No

1 (FN)

2 (TN)

From this confusion matrix: •

TP (True Positive): 5 dogs correctly predicted as dog.

•

FP (False Positive): 2 cats incorrectly predicted as dogs.

•

TN (True Negative): 2 cats correctly predicted as cats.

•

FN (False Negative): 1 dog incorrectly predicted as a cat.

Did You Know? The confusion matrix was invented in 1904 by Karl Pearson.

Think and Tell

Why is it called the confusion matrix?

ActivityTime Time Activity Activity 1: Form groups of 3–4 students and design a 2x2 confusion matrix.

(Group activity)

Traffic jams are a common issue in urban areas, leading to frequent delays. Many school children rely on buses, which

often run late due to traffic, preventing students from arriving at school on time. Design a confusion matrix that predict whether they will encounter a traffic delay on their route to school. Activity 2: Form pairs and design a 2x2 confusion matrix.

(Pair activity)

Sudden rainfall can disrupt people’s plans. People wash their clothes and hang them to dry, but unexpected rain can ruin

their efforts.As a result, an artificially intelligent model has been developed to forecast whether or not rain will fall. Design a confusion matrix for this rainfall prediction model.

Chapter 28 • Confusion Matrix

407


Chapter Checkup A Select the correct option. 1

In a confusion matrix, what does the True Positive (TP) value mean? a When a positive data point is correctly predicted by the model.

b When a negative data point is correctly predicted by the model. c When a positive data point is wrongly predicted by the model.

d When a negative data point is mis-predicted by the model.

2 The confusion matrix is used to evaluate the performance of a ________________ model. a KNN b regression c classification d None of these 3 When both the predictive value and the actual value are negative, it is called a True positive b True negative

c False positive d False negative

B Fill in the blanks with the most suitable words. 1 A ________________ condition of the confusion matrix is also known as a type I error. 2 A confusion matrix represents the ________________ summary. 3 In machine learning, ________________ is the process of classifying a given collection of data into separate groups. 4 If the prediction matches the ________________, then the prediction is true else it is false. C

State whether the following statements are True or False. Correct the statements that are false. 1 False negatives (FN) are known as a Type I error.

2 We can get four possible combinations out of a classifier’s predicted and actual values. 3 True positives happen when a positive data point is wrongly predicted by the model. 4 Prediction and reality can be easily mapped together with the help of a confusion matrix. D Answer the following questions. (Solved) Q1. What is a confusion matrix ?

A1. A confusion matrix is a predictive summary that helps evaluate the performance of a classification model. Q2. Explain the various conditions associated with a confusion matrix. A2. The various conditions associated with the confusion matrix are:

True positives (TP): It happens when a positive data point is correctly predicted by the model.

True negatives (TN): It happens when a negative data point is correctly predicted by the model. False positives (FP): It happens when a negative data point is wrongly predicted by the model. False negatives (FN): It happens when a positive data point is mis-predicted by the model.

Q3. We have a dataset of ten students with their actual genders and the predicted genders from our classification method. Design a confusion matrix to determine the accuracy of predicting whether a student is classified as a boy or not.

408

S.No.

Actual

Predicted

1

Boy

Boy

2

Boy

Girl

3

Boy

Boy


A3. S.No

S.No.

Actual

Predicted

4

Girl

Girl

5

Boy

Boy

6

Girl

Boy

7

Boy

Boy

8

Boy

Boy

9

Girl

Boy

10

Boy

Boy

1

2

3

4

5

6

7

8

9

10

Actual

Boy

Boy

Boy

Girl

Boy

Girl

Boy

Boy

Girl

Boy

Predicted

Boy

Girl

Boy

Girl

Boy

Boy

Boy

Boy

Boy

Boy

Result

TP

FN

TP

TN

TP

FP

TP

TP

FP

TP

Reality

The Confusion Matrix Prediction

Yes

No

Yes

6 (TP)

2 (FP)

No

1 (FN)

1 (TN)

AI Activities 1 V isit this link: https://www.youtube.com/watch?v=AOIkPnKu0YA and explore the topic: ‘Confusion Matrix—Model Building and Validation’. 2 Visit this link: https://www.shiksha.com/online-courses/articles/confusion-matrix-in-machine-learning/ and learn

more about the confusion matrix. 3 V isit this link: https://www.shiksha.com/online-courses/articles/confusion-matrix-in-machine-learning/ and understand the concept of confusion matrix in machine learning.

Answer Key A

1. a

B

1. False positive

C

1. False. False negatives (FN) are known as a Type II error.

2. c

3. b 2. Prediction

3. Classification

4. Reality

2. True

3. False. False negatives happen when a positive data point is wrongly predicted by the model. 4. True.

Chapter 28 • Confusion Matrix

409


Unit 7 • Evaluation

29 Evaluation Methods

I

n the previous chapter, we discussed the confusion matrix, which records the comparison between predictions and reality. This matrix helps us analyse how well the AI model’s predictions match actual results or reality. Although the confusion matrix itself is not an assessment metric, it is a useful tool for assessing our predictions. In this chapter, we will study about several evaluation techniques that will help us evaluate the effectiveness of predictive models and make informed decisions based on the results.

Evaluation Methods

There are various evaluation methods used to assess the efficiency of a predictive model. Evaluation methods help in determining how effectively a model can generate correct predictions or classifications on previously unknown data.

Accuracy

Accuracy is the percentage of total correct predictions to total observations. A prediction is considered correct if it matches reality. Accuracy =

Correct prediction * 100% Total cases

Accuracy =

(TP + TN) * 100% (TP + TN + FP + FN)

In the formula, the numerator represents two conditions in which the prediction matches reality: True Positive (TP) and True Negative (TN). The denominator represents total observations that cover all the possible cases of prediction, i.e., True Positive (TP), True Negative (TN), False Positive (FP) and False Negative (FN). Example Let us consider a model that predicts whether an email is spam or not. Assume that the model consistently predicts that the email is not spam. However, in reality, there is a 5% chance that the email is indeed spam. In this case, for 95 cases, the model will predict right, but for the remaining 5 cases where the email is spam, the model still predicts it as not spam.

410


This implies that: True Positives = 0 True Negatives = 95 False Positives = 0 False Negatives = 5 Total Cases = TP + TN + FP + FN = 100 (TP + TN) Accuracy = * 100% (TP + TN + FP + FN) =

Prediction: Always Not Spam

0 + 95 95 × 100 = × 100 = 95% 100 100

Even though the model accurately predicts the cases where the mail is not spam, it fails to predict the cases where the mail is spam. Now, let us look at another evaluation method that takes into account such cases too.

Precision

Reality: 5% Probability of Spam Mail

Accuracy: 95%

Think and Tell

What percentage of accuracy is reasonable to show good performance?

It is defined as the percentage of true positive predictions to the total number of positive predictions. It is also known as a positive predictive value. It is beneficial, especially when false positives are extremely costly. Precision = Precision = Example

True Positive * 100% All predicted Positives TP * 100% (TP + FP)

Reconsidering the email spam example, let us assume that the model always predicts that an email is spam. In this case, we will consider the positive condition, that is, True Positive and False Positive. However, if the model always predicts that the mail is spam, people will not check their email and eventually might lose important information. This implies that a false positive condition (predicting the mail as spam while the mail is not spam) would have a high cost. This makes precision an important evaluation criteria. If precision is high, the true positive cases outweigh false alarms.

Error Alert! You might remember the story of the boy who repeatedly cried wolf when there were none, causing everyone to ignore him when wolves actually appeared. Similarly, if a spam filter’s precision is low (which means the model often falsely predicts mails as spam when the mails are not actually spam) then the users would get complacent and start ignoring the spam filter altogether, considering it could be a false alarm. Let us consider that a model has 100% precision. This means that 1. Whenever the machine says there’s a spam mail, there is actually a spam (True Positive).

2. In the same model, there can be a rare, exceptional case where there was actual spam mail but the system could not detect it. This is the case of a false negative condition. But the precision value would not be affected by it because it does not take FN into account.

Chapter 29 • Evaluation Methods

411


This implies that:

True Positives = 100

False Positives = 0 TP Precision = * 100% (TP + FP) = [100/(100+0)]*100% = 1*100%

100% Precise

=100%

Recall

It is defined as the ratio of the number of true positive (TP) predictions to the sum of true positive (TP) and false negative (FN) predictions. It is beneficial, especially when false negatives are extremely costly. It is also known as the sensitivity, hit rate, or true positive rate (TPR). Recall =

TP * 100% (TP + FN)

In the formula, the denominator represents the true reality cases where, in reality, the mail was spam but the model either predicted it correctly or it did not. The numerator only represents the cases where the model correctly predicted the mail to be spam.

Remember The formula for both precision and recall is almost identical; they have the same numerator: True Positives. But in the denominator, precision counts the False Positives while recall takes False Negatives into account.

True Positive: The model predicted spam mail, and in reality, too, the mail was spam. False Negative: The model predicted mail to be not a spam, but in reality, the mail was spam.

Which Metric is Important?

Choosing between precision and recall depends on the specific context in which the model is being used. Consider the following examples: 1. If the model consistently predicts that an email is spam (even when it is not), people may neglect checking their mails and eventually might lose important information. Here, a false positive condition (predicting the mail as spam while the mail is not spam) would have a high cost. 2. Imagine a scenario where no alert is given even when there is a forest fire. In such cases, false negatives (predicting no fire when in reality there is fire) can be extremely costly. The lack of an alarm could lead to extensive forest damage. 3. Suppose a highly dangerous virus begins to spread, and the model designed to predict outbreaks fails to detect it. As a result, the virus could spread extensively, infecting a large population. In this case also, false negative will be extremely dangerous. 4. There are situations where a false positive can be more costly than a false negative. Imagine a model that predicts the presence of treasure at a certain location, prompting extensive digging, only to find out it was a false alarm. In this scenario, the false positive (predicting the presence of treasure when there is none) can be costly.

412


Cases with high FN cost

Cases with high FP cost

Forest fire

Spam

Viral

Mining

Which one is more important? Recall or Precision? According to the definitions of precision and recall, recall determines a classifier’s performance in terms of false negatives, whereas precision provides information on a classifier’s performance in terms of false positives. Accordingly, recall should be as close to 100% as feasible if we want to limit false negatives, and precision should be as close to 100% as possible if we want to avoid false positives. In simple words, if we maximise precision, it will minimise the FP errors, and if we maximise recall, it will minimise the FN errors. We must remark that if we want to know if our model’s performance is good, we must consider two metrics: recall and precision. In some circumstances, you may have high precision but low recall, or low precision but high recall. However, because both metrics are significant, there is a need for a parameter that considers both precision and recall.

F1 Score

It is used to evaluate the overall performance of a classification model. The F1 score can be defined as the measure of balance between precision and recall.

Precision* Recall Precision + Recall When the F1 Score is 1 (or 100%), it indicates a perfect score. For this to happen, both precision and recall must also be 1 (or 100%). As the values of both precision and recall range from 0 to 1, the F1 score also ranges from 0 to 1.

F1 Score =2*

There can be a lot of variations in the F1 score, as given in the following table: Precision

Recall

F1 Score

Low

Low

Low

Low

High

Low

High

Low

Low

High

High

High

Did You Know?

Think and Tell

The F1 score is the harmonic mean

Which of the following evaluation methods is better: precision or recall? Why?

between precision and recall.

Activity Suppose you have a model that predicts whether an animal is a dog or a cat. You test it on a set of 10, where 6 are dogs and 4 are cats. Calculate accuracy, precision, recall, and F1 score. S. No

1

2

3

4

5

6

7

8

9

10

Actual

Dog

Dog

Dog

Cat

Dog

Cat

Dog

Dog

Cat

Cat

Predicted

Dog

Cat

Dog

Cat

Dog

Dog

Dog

Dog

Dog

Cat

Result

TP

FN

TP

TN

TP

FP

TP

TP

FP

TN

Chapter 29 • Evaluation Methods

413


Reality

The Confusion Matrix

Prediction

Yes

No

Yes

5 (TP)

2 (FP)

No

1 (FN)

2 (TN)

Solution: From this confusion matrix: •

TP (True Positive): 5 Dogs correctly predicted as dogs.

•

FP (False Positive): 2 cats incorrectly predicted as dogs.

•

TN (True Negative): 2 cats correctly predicted as cats.

•

FN (False Negative): 1 dog incorrectly predicted as a cat.

(TP + TN) 100% (TP + TN + FP + FN) * Here, TP + TN + FP + FN = Total Cases = 10 Accuracy =

TP 100% TP + FP * = [5/(5+2)]*100

Precision =

Accuracy = [(5 + 2)/(10)]*100

Recall =

= (5/7)*100

= (7/10)*100

= 0.7143*100

=70%

= 71.43%

TP 100% TP + FN *

F1 Score = 2*

= [5/(5+1)]*100 = (5/6)*100 = 0.8333*100 = 83.33%

Precision* Recall Precision + Recall

= 2 *(71.43*83.33)/(71.43+83.33) = 2 * (5952.26)/(154.76) = 2 * 38.46 = 76.92%

Activity Time Activity: Find out the accuracy, precision, recall, and F1 score for the given problems. Scenario 1: In some parts of the country, the flood situation has gotten worse recently. It not only devastates the entire area but also drives people from their houses and into other places. To solve this issue, an AI model has been created that can predict if there is a chance of floods or not. Refer to the confusion matrix to evaluate the model using various evaluation methods. Scenario 2: Many times, there is no water available in rural areas. In a few villages, water shortages are quite common and problematic. To solve this issue, an AI model is created which can predict if there is going to be a water shortage in the rural areas in the near future or not. Refer to the confusion matrix to evaluate the model using various evaluation methods.

414

(Group activity)

The Confusion Matrix

Actual: 1

Actual: 0

Predicted: 1

50

50

Predicted: 0

0

0

The Confusion Matrix

Reality: 1

Reality: 0

Predicted: 1

22

12

Predicted: 0

47

118


Chapter Checkup A Select the correct option. 1 In which of the following cases is the F1 score the highest? a When both precision and recall are low

c When both precision and recall are high

2 The F1 Score is calculated as ........................

a Harmonic mean of precision and recall.

c Geometric mean of precision and recall.

b When precision is high and recall is low d When precision is low and recall is high b Arithmetic mean of precision and recall. d Product of accuracy and precision.

3 The accuracy of a model evaluates:

a The ratio of true positive predictions to the total number of positive observations.

b The ratio of true negative predictions to the total number of negative observations. c The ratio of total accurate predictions to total observations.

d The difference between the predicted values and the actual values. B Fill in the blanks with the most suitable words. 1 ....................... is also known as the true positive rate (TPR). 2 If we maximise precision, it will minimise the ....................... errors. 3 The evaluation method is used to evaluate the ....................... of a machine-learning model. 4 ....................... is also known as a positive predictive value. C

State whether the following statements are True or False. Correct the statements that are false. 1 Precision is beneficial, especially when false positives are extremely costly. 2 The F1 score can be defined as the measure of balance between precision and accuracy. 3 Recall is beneficial, especially when false positives are extremely costly. 4 Accuracy is one of the evaluation methods.

D Answer the following questions. (Solved) Q1. What is the evaluation method? A1. Evaluation methods help in determining how effectively a model can generate correct predictions or classifications on previously unknown data. Q2. For each of the following cases, determine whether the scenario has a high cost associated with false positives (FP) or false negatives (FN). Provide a justification for your answer. a A forest fire detection system that fails to alert authorities when there is an actual fire. b A viral outbreak prediction model that does not detect the presence of a deadly virus. c A spam filter that consistently misclassifies legitimate emails as spam. d A mining prediction model that incorrectly identifies a location as having a treasure. case of a forest fire has a high cost associated with a false negative (predicting no fire when in reality there is fire). A2. 1 A Imagine no alert being given even when there is a forest fire. This might burn the whole forest because of no alarm. 2 A case of a viral outbreak has a high cost associated with a false negative (predicting no viral outbreak when in reality there is an outbreak). If the model designed to predict this outbreak fails to detect it, the virus could spread extensively, infecting a large population.

Chapter 29 • Evaluation Methods

415


3 A case of a spam filter has a high cost associated with a false positive (predicting that the mail is spam even when it is not). In such a scenario, people would not check their mails and eventually might lose important information.

4 A case of mining has a high cost associated with a false positive (predicting the presence of treasure when there is none). If the model predicts a treasure at a certain location, prompting extensive digging, only to find out it was a false alarm, this can result in significant expenses. Q3. Given the confusion matrix for an AI model below, compute all the evaluation metrics for the model. Reality

The Confusion Matrix Prediction A3.

Accuracy =

Yes

No

Yes

60 (TP)

20 (FP)

No

20 (FN)

100 (TN)

(TP + TN) * 100% (TP + TN + FP + FN)

Precision =

= [60/(60 + 20)]*100

Here, TP + TN + FP + FN = Total Cases = 200

= [60/80]*100

Accuracy = [(60 + 100)/(200)]*100

= 0.75*100

= [160/200]*100

= 75%

= 80% Recall =

TP * 100% TP + FP

TP * 100% TP + FN

F1 Score = 2*

Precision* Recall Precision + Recall

= [60/(60 + 20)]*100

= 2 *(75*75)/(75 + 75)

= 0.75*100

= 2 * 375

= [60/80]*100

= 2 * (5625)/(150)

= 75%

= 75%

AI Activities 1 Visit the link: https://www.dataschool.io/simple-guide-to-confusion-matrix-terminology/ to learn more about the evaluation methods. 2 Visit the link: https://www.shiksha.com/online-courses/articles/confusion-matrix-in-machine-learning/ and understand the different scenarios of confusion matrix.

Answer Key A

1. c

B

1. Recall

C

1. True.

2. a

3. c

2. FP (False Positive)

3. Efficiency

4. Precision

2. F alse. The F1 score can be defined as the measure of balance between precision and recall. 3. False. Recall is beneficial especially when false negatives are extremely costly. 4. True

416


Unit Reflection

Key Terms • Evaluation: Evaluation is the process of assessing an AI model to determine its value, quality, performance, and effectiveness. • Prediction: This is the output given by the machine. • Reality: This is the actual situation in the field at the time the prediction was made. • True Positive (TP): When the value predicted by the model is positive and the actual value is also positive. • True Negative (TN): When the value predicted by the model is negative and the actual value is also negative. • False Positive (FP) (Type I Error): When the value predicted by the model is positive but the actual value is negative. • False Negative (FN) (Type II Error): When the value predicted by the model is negative but the actual value is positive. • Confusion Matrix: In the evaluation stage of an AI model, a confusion matrix is a table that helps visualise the performance of the model by summarising the counts of correct and incorrect predictions.

Things to Remember • Evaluation, the last stage of the AI project cycle, is important in ensuring that the selected AI model is reliable, effective, and safe for use. This stage helps to find the best model that accurately represents our data and produces the desired output.

• Underfitting occurs when the AI model is too simple to capture the underlying patterns of the data. It fails to learn trends and relationships from the training data and results in poor performance of the model on training and testing data. • Overfitting happens when an AI model is very complex. Such a model fails to generalise on new or unseen data and will perform well on the training data but poorly on new and unseen data.

• A perfect fit refers to the AI model that has the right balance between underfit and overfit. It generalises well on training data as well as on new and unseen data. • Accuracy: Accuracy is the percentage of total correct predictions to total observations. Accuracy = Accuracy =

Correct prediction Total cases (TP + TN)

(TP + TN + FP + FN)

* 100% * 100%

• Precision: It is defined as the percentage of true positive predictions to the total number of positive predictions. Precision = Precision =

Unit Reflection

True Positive

All Predicted Positives TP

TP + FP

* 100%

* 100%

417


• Recall: It is defined as the ratio of the number of true positive predictions to the sum of true positive and false negative predictions. Recall = Recall =

True Positive

True Positive + False Negative TP

TP + FN

• F1 Score: The F1 score can be defined as the measure of balance between precision and recall. F1 Score =2*

Precision* Recall

Precision + Recall

• Predicting the presence of treasure when there is none has a high false positive (FP) cost. Similarly, predicting the mail as spam while the mail is not spam also has a high false positive (FP) cost. • Predicting no fire when in reality there is fire has a high false negative cost. Similarly, predicting no virus outbreak when in reality there is a viral outbreak also has a high false negative cost. • When the F1 Score is 1 (or 100%), it indicates a perfect score. For this to happen, both precision and recall must also be 1 (or 100%). As the values of both precision and recall range from 0 to 1, the F1 score also ranges from 0 to 1.

418


Test Your Knowledge A. Select the correct option. 1. What is underfitting in an AI model? a. The model is too simple to capture data patterns. b. The model is too complex and memorises the training data. c. The model generalises well on unseen data. d. The model produces random predictions. 2. Which of the following metrics is used to minimise False Positives? a. Recall

b. Accuracy

c. Precision

d. F1 Score

3. What does the F1 Score measure? a. Complexity of testing data b. Balance between precision and recall c. Model complexity d. Training time of a model 4. Which evaluation metric should be prioritised in a model predicting the outbreak of a dangerous virus? a. Precision

b. Accuracy

c. Recall

d. F1 Score

5. If a model achieves a high precision but low recall, what does it indicate? a. High false negatives

b. High false positives

c. Both high false positives and negatives

d. Low accuracy

6. What does the confusion matrix help to visualise? a. The accuracy of the training data.

b. The distribution of data features.

c. The performance of the AI model.

d. The loss function over time.

B. Fill in the blanks with the most suitable words. 1. Overfitting occurs when a model is too 2. The process of 3. 4. A 5.

involves comparing a model’s predictions with actual outcomes to assess its performance. is also known as a true positive rate. occurs when the model predicts negative and the reality is also negative. is the ratio of correct predictions to total observations in a model.

6. Precision is important when

Unit Reflection

and captures specific details from the training data.

positives are extremely costly.

419


C. State True or False. Correct the statements that are False. 1. Precision considers both True Positives and False Negatives in its calculation. 2. Overfitting refers to a model that generalises well on both training and unseen data. 3. A confusion matrix only visualises the True Positive and True Negative predictions. 4. The F1 score is the harmonic mean of precision and recall. 5. Accuracy is always the best metric for evaluating a model.

D. Short-answer type questions. 1. Explain underfitting and overfitting in the context of AI model development. 2. Why is the F1 Score important when evaluating a model? 3. List four common methods used to evaluate the performance of machine learning models.

E. Long-answer type questions. 1. Find out the accuracy, precision, recall and F1 score for the given problem: People frequently face the problem of sudden rain ruining their clothes that they have just washed and hung out to dry. To help with this, an AI model has been created to predict whether it will rain. Here is the confusion matrix for the model: The Confusion Matrix

Actual: 1

Actual: 0

Predicted: 1

5

0

Predicted: 0

45

50

2. A medical AI model predicts whether patients have a specific disease. For the following situations, identify if the outcome is a True Positive, True Negative, False Positive, or False Negative:

i. The model predicts the disease, and it is confirmed. ii. The model predicts no disease, but the patient actually has it. iii. The model predicts no disease, and this is confirmed. iv. The model predicts the disease, but the patient is healthy. Provide a brief explanation for each.

F. Competency-based Question. 1. In a quality control system for manufacturing, a defective product is correctly identified as defective. What is this situation called? 2. In a facial recognition system at an airport, a person who is not on the watchlist is correctly identified as not being a security threat. What is this situation called?

420


Assertion Reasoning Questions Unit 1 1.

Assertion (A): We often need to make decisions for various situations in life.

Reason (R): Decision-making is fundamental to solving life’s complexities.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

2.

Assertion (A): A fully automatic washing machine functions through automation, not AI.

Reason (R): A fully automatic washing machine does not learn or adapt based on past washes but performs tasks based on pre-set instructions.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

3.

Assertion (A): A smart home security system makes use of computer vision.

Reason (R): In medical imaging, computer vision aids in diagnostics by analysing images from X-rays, MRIs, and CT scans.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is NOT the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

4. Assertion (A): The Moral Machine is an online platform developed by researchers at the Massachusetts Institute of Technology (MIT). Reason (R): The Moral Machine presents users with scenarios where they must make decisions about how selfdriving cars should prioritise lives in various hypothetical crash situations.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

5.

Assertion (A): Most virtual assistants have traditionally been given female voices.

Reason (R): AI bias makes sure that AI tools and technologies are made available for people and businesses across various fields.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

Assertion Reasoning

421


c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

Unit 2 6. Assertion (A): When we gather data from various sources, we need to explore the data to clean it up and make it useful. Reason (R): Data exploration helps us understand the data and determine if it is suitable for training AI algorithms.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

7. Assertion (A): Sustainable Development Goals, which are often referred to as ‘Global Goals’, are a set of 17 goals adopted by the United Nations General Assembly in September 2015.

Reason (R): Data acquisition is the first phase of the AI project cycle.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

8. Assertion (A): Web Scraping are tools that enable different software applications to communicate and exchange data seamlessly.

Reason (R): As data is crucial for AI systems, data must be accurate to get correct output from AI system.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

9. Assertion (A): AI modelling involves creating algorithms (models) that learn from data to make predictions or decisions. Reason (R): Once trained on historical data, the model can accurately predict, classify, or detect patterns in new datasets.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

10. Assertion (A): Microsoft Excel is a widely-used spreadsheet tool to effectively visualise and analyse data. Reason (R): Microsoft Excel enables users to generate various types of charts and graphs, including bar charts, line charts, pie charts, and scatter plots.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

422


c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

Unit 3 11. Assertion (A): Jupyter Notebooks have become a must-have tool for data science.

Reason (R): Jupyter Notebooks help data scientists analyse data, explore new ideas, and share their results easily.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

12. Assertion (A): The simplest method to install and use Jupyter Notebook is by using Anaconda. Reason (R): Anaconda is a free and open-source environment for writing and executing Python programs and includes numerous pre-installed packages that do not need to be installed separately.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is NOT the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

13. Assertion (A): List is an immutable data type.

Reason (R): Immutable data types are those that cannot have their values changed once declared.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

14. Assertion (A): Dynamic typing is a feature of Python where the data type of a variable is not determined until runtime. Reason (R): You can assign a variable to a value of any type, and the variable will automatically take on that type.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is NOT the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

15. Assertion (A): The output of the expression: 10 + 7 * (4 - 2) / 2 - 3**2 is 9.0.

Reason (R): Python follows the PEDMAS rule.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

Assertion Reasoning

423


Unit 4 16. Assertion (A): When you write a query in a search engine, data science helps by offering autocomplete suggestions and predicting relevant content.

Reason (R): These search results are based on past searches, ensuring you find what you seek more efficiently.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

17. Assertion (A): If a model’s predicted values do not match the actual values at all, it is considered to be underfitting.

Reason (R): A model that is underfitting fails to capture the underlying patterns in the data.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

18. Assertion (A): Numpy is a commonly used package when it comes to working around numbers.

Reason (R): Numpy is usually imported under the np alias.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

19. Assertion (A): Matplotlib is open source and we can use it freely.

Reason (R): Matplotlib is a popular Python library for creating static, animated, or interactive visualisations.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

20. Assertion (A): When the standard deviation is low, it means the data points are near the mean. Reason (R): The standard deviation represents the dispersion or variance in a set of data values around its mean value.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

424


Unit 5 21. Assertion (A): High-resolution images, with their more tightly packed pixels, look sharper and more detailed.

Reason (R): Resolution determines the image’s clarity and detail.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

22. Assertion (A): Taking a picture of an item and locating it on the internet is a common practice today.

Reason (R): Finding items, people, and places can be highly efficient with the NLP technology.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

23. Assertion (A): Grayscale images are a type of digital image that contains varying shades of grey without any visible colour.

Reason (R): The smallest unit of a digital image is called a pixel.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

24. Assertion (A): OpenCV is a powerful library for computer vision tasks in Python. Reason (R): Splitting a colour image into its individual colour channels (Red, Green, and Blue) can be done easily using OpenCV in Python.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

25. Assertion (A): Convolution is the process of multiplying an image array element-by-element with another array called the kernel and then adding up the results. Reason (R): By changing the values in the kernel, you can achieve different results and enhance specific features of the image.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

Assertion Reasoning

425


Unit 6 26. Assertion (A): Google Docs offers a feature that allows you to use NLP to create content summaries for lengthy documents, research papers, or reports. Reason (R): Sentiment analysis is an AI tool that understands and responds to voice commands or text inputs, such as questions and requests, or performs tasks for you.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

27. Assertion (A): Lemmatisation takes a longer time to execute than stemming. Reason (R): Unlike stemming, which simply cuts off prefixes or suffixes to achieve the root form, lemmatisation considers the meaning of the word.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

28. Assertion (A): Any information sent to a computer must be converted into numerical data.

Reason (R): Computers understand only numbers, typically in binary form.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

29. Assertion (A): Google Transfer is an AI-powered translation app that allows users to translate text into different languages. Reason (R): Google Translate can translate texts entered by typing, text scanned through the camera, or captured in images.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

30. Assertion (A): In data preprocessing, we retain relevant tokens and remove stopwords. Reason (R): Stopwords like “the,” “is,” and “and” are common in text but offer little value in computational analysis, allowing us to focus on more meaningful words by removing them.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

426


Unit 7 31. Assertion (A): Prediction is the output given by the machine.

Reason (R): Reality is the actual situation in the field at the time the prediction was made.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

32. Assertion (A): True Positive (TP) is when the value predicted by the model is positive and the actual value is also positive. Reason (R): False Positive (FP) is when the value predicted by the model is negative but the actual value is positive.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

33. Assertion (A): False Negative in the case of a forest fire can be extremely costly.

Reason (R): When no alert is given, even when there is a forest fire, it could lead to extensive forest damage.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

34. Assertion (A): False Positive in the case of mining can be extremely costly. Reason (R): If a model predicts the presence of treasure at a certain location, prompting extensive digging, only to find out it was a false alarm, it can be extremely costly.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

35. Assertion (A): Evaluation parameter recall is beneficial, especially when False Negatives are extremely costly.

Reason (R): Precision is beneficial, especially when False Positives are extremely costly.

a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A.

c. A is correct, but R is not correct.

d. A is not correct, but R is correct.

Assertion Reasoning

427


Competency-Based Questions

Unit 1 Read the following paragraphs and answer the given questions. 1. According to the theory of Multiple Intelligences, developed by psychologist Howard Gardner in 1983, individuals possess several distinct types of intelligences in varying degrees. Gardner’s theory suggests that each person has a unique mix of these intelligences, which explains their diverse talents and ways of learning. For example, a person can use their intelligence to solve complex problems efficiently and effectively, while another person can be creative and can come up with unique ideas to create thought-provoking art that challenges viewers’ perspectives. i. Which type of intelligence involves the ability to analyse problems logically and discern numerical patterns?

a.

Musical Intelligence

b. Spatial and Visual Intelligence

c.

d. Linguistic Intelligence

Mathematical and Logical Intelligence

ii. People with high ....................... intelligence are skilled in physical activities like sports, dance, and acting.

a.

Kinaesthetic Intelligence

b. Naturalist Intelligence

c.

d. Musical Intelligence

Intrapersonal Intelligence

iii. Which intelligence is associated with the ability to understand and interact effectively with others, involving verbal and nonverbal communication?

a.

Intrapersonal Intelligence

b. Interpersonal Intelligence

c.

d. Naturalist Intelligence

Existential Intelligence

2. Biases are inherent in everyone, regardless of efforts to remain neutral. While biases are not always negative and can sometimes be useful for effective decision-making, they pose unique challenges in the realm of AI. Machines cannot think independently; while they can possess intelligence, they do not inherently have biases. Any bias in an AI system arises from the choice made by developers while developing the algorithms. i. Why are most virtual assistants traditionally given female voices?

a.

b. Societal stereotypes associate female voices with helpfulness and approachability.

c.

d. Female voices are more efficient for AI processing.

428

Female voices are more technically advanced. Male voices were not available until recently.


ii. What bias is reflected in search engine results for salons?

a.

The majority of salons are owned by females.

c.

Search engines are not optimised for salon searches.

b. Search engines assume that most people searching for salons are female. d. Male salons are not listed in search results.

iii. What is a potential problem with AI hiring algorithms?

a.

AI hiring algorithms increase job diversity.

b. AI hiring algorithms are not used for technical roles.

c.

d. AI can continue biases from historical hiring data, favouring certain demographics.

AI hiring algorithms are always fair and unbiased.

3. Similar to how humans apply their intelligence to solve certain problems, machines can also possess intelligence. This ability of machines to mimic human intelligence is called artificial intelligence (AI). AI is a branch of computer science that deals with the study of principles, concepts, and technology for building machines that can think, act, and learn like humans. AI has become an essential part of our daily lives, making certain tasks more efficient, personalised, and entertaining. There are many amazing applications of AI that we experience in our daily life. i. Which of the following is not a function of virtual assistants?

a.

Setting reminders

c.

Driving autonomous vehicles

b. Controlling smart home devices d. Providing weather updates

ii. How do streaming services like Netflix and Spotify use AI to personalise recommendations?

a.

By analysing preferences, frequently watched or listened content, and ratings.

c.

By tracking your location.

b. By controlling the speed of your internet connection. d. None of these

iii. Which of the following is the primary role of AI in autonomous vehicles?

a.

Recommending entertainment options to the driver.

c.

Powering the vehicle’s audio system.

b. Processing sensor and camera data to navigate and make real-time decisions. d. Managing fuel efficiency by analysing driving patterns.

Unit 2 4. Data visualisation is the graphical representation of information and data. You can use various data visualisation techniques like charts, graphs, and maps to see and understand trends, patterns, and relationships in the data. Data visualisation enables the identification of trends, outliers, and patterns within the data. i. Which of the following is NOT a common data visualisation technique?

a.

Bar Chart b.

Line Graph

c.

Scatter Plot d.

Data Table

Competency-Based Questions

429


ii. What is the primary benefit of using data visualisation in decision-making?

a.

It makes raw data more readable.

c.

It eliminates the need for data collection.

b. It adds additional data to the dataset.

d. It hides complex data from decision-makers.

iii. In which data visualisation technique are data values represented as parts of a whole?

a.

Line Graph b.

Bar Chart

c.

Scatter Plot d.

Pie Chart

5. AI modelling refers to the process of creating algorithms, known as models, that can learn from data and make predictions or decisions based on new data. The output of the modelling process is a model that can make accurate predictions, classify information, or identify patterns in new datasets once the AI models are trained using historical data. There are two main methods for building AI models: the rule-based approach and the learning-based approach. i. Which of the following is an example of a rule-based AI system?

a.

Recommendation system on streaming platforms

c.

Autonomous vehicles

b. Automated diagnostic system in healthcare d. None of these

ii. In a rule-based approach, what is the main challenge when dealing with new or unforeseen data?

a.

The model can update itself to handle new data automatically.

c.

The model cannot handle new data if specific rules for it are not predefined.

b. The model ignores the new data and uses old rules to make decisions. d. None of these.

iii. What is a key feature of a learning-based AI approach?

a.

It requires predefined rules to operate.

b. It can adapt to new and unseen patterns in data.

c.

d. It uses a set of medical rules for decision-making.

It performs well only on data it has been trained on.

6. Supervised learning is a machine learning method that uses well-labelled datasets to train models to predict outcomes and recognise patterns. In supervised machine learning, developers are very familiar with the data. In other words, the dataset is known to the developer, allowing them to label the data accurately. They provide this labelled data to the machine learning model, which then learns from it. Once the model understands the relationship between the input and output data, it becomes capable of classifying new and unseen datasets as well as predicting outcomes. There are broadly two types of supervised learning models: classification and regression. i. What is the main goal of a regression model?

a.

To predict a label representing a category.

c.

To classify objects into discrete categories.

430

b. To predict a continuous numerical value. d. To identify patterns in unlabelled data.


ii. When predicting the price of a house, which of the following features could be used as input data?

a.

Colour of the house

b. Number of bedrooms

c.

d. Owner’s name

Car model in the garage

iii. Which of the following is true about classification models?

a.

They predict continuous values like house prices.

b. They do not require labelled data for training.

c.

d. None of these.

This model works on a discrete dataset.

Unit 3 7. Python is a high-level programming language that is easy to learn and simple to use. It comes with a lot of pre-installed features. Python stands out from other programming languages due to its simplicity and readability, making it an ideal choice for beginners. It was created by Guido van Rossum and first released in 1991. i. Which of the following is a feature of Python that makes it easy for beginners to learn?

a.

Complex syntax

b. Lack of portability

c.

d. None of these

Few keywords and simple structure

ii. What type of application can Python help you create with its built-in support?

a.

Graphical User Interface (GUI) applications

b. Operating systems

c.

d. None of the above

Web browsers

iii. Which of the following statements about Python is true?

a.

Python can only run on a limited number of hardware platforms.

b. Python requires manual data type assignment for all variables.

c.

d. All of these.

Python supports dynamic data type checking.

8. A Python library is a set of modules. Modules that are linked to one another are often placed in the same package. When a module from another package is required in a program, the package can be imported and its modules used. i. Which Python package is commonly used for working with arrays and matrices?

a.

Pandas b.

NumPy

c.

Matplotlib d.

OpenCV

Competency-Based Questions

431


ii. What is the primary use of the OpenCV library?

a.

Data manipulation and analysis

b. Creating static, animated, or interactive visualisations

c.

d. Sentiment analysis of text

Processing photos and videos to recognise objects, people, or handwriting

iii. Which of the following is a fundamental data structure in the Pandas library that represents a two-dimensional and tabular data structure with labelled axes?

a.

DataFrame

b. Series

c. ndarray

d.

Line2D

Unit 4 9. Artificial Intelligence (AI) depends on data for its effectiveness. The quality and type of data fed into AI systems determine how smart they become. We can categorise AI into three main domains based on the type of data they use: Data Science, Computer Vision, and Natural Language Processing (NLP). Data science is the study of data to extract meaningful patterns and trends, which can help us make better choices. Data science is used in many fields and impacts our daily lives in many ways. i. How do streaming services like Netflix use data science to enhance user experiences?

a.

By creating static, animated, or interactive visualisations.

c.

By processing photos and videos to recognise objects.

b. By recommending new films and shows based on what users watch. d. By detecting fraud in financial transactions.

ii. What role does data science play in the sports industry?

a.

Enhancing performance analysis and strategy development.

c.

Detecting fraud in financial transactions.

b. Suggesting autocorrection in search engines.

d. Creating personalised playlists in music apps.

iii. How do smart wearable devices use data science?

a.

To create personalised playlists

c.

To recommend new films and shows

b. To track athletes’ health and fitness data in real time d. To detect fraud in financial transactions

10. Maya opened a boutique in her neighbourhood, offering unique, stylish clothing and accessories. Despite initial excitement, she faced challenges with inventory management. Popular items were often out of stock, while others remained unsold. Customers frequently requested specific styles or sizes that were unavailable. Additionally, Maya struggled to predict and stock seasonal trends, leading to missed sales opportunities. These issues resulted in customers leaving without making purchases, affecting her sales and customer retention. i. What is one of the main challenges Maya faces in her boutique?

a.

Deciding the location of her boutique

c.

Hiring staff for the boutique

432

b. Managing inventory effectively

d. Designing the interior of the boutique


ii. Why do customers often leave Maya’s boutique without making a purchase?

a.

The boutique is located in a remote area

c.

Specific styles or sizes are not available

b. The prices are too high

d. The boutique is too small

iii. What is one strategy Maya could use to improve her sales and customer retention?

a.

Lowering the prices of all items

c.

Predicting and stocking up on seasonal trends

b. Moving the boutique to a different neighbourhood d. Reducing the variety of items in the boutique

11. The K-Nearest Neighbour (KNN) algorithm is a basic supervised learning technique. It is a popular choice for solving classification and regression problems. The KNN algorithm is useful for the interpolation of missing data values, i.e., it estimates the missing value based on the nearest known data point. It assumes that similar things tend to be close to each other, following the idea that “like things attract like”. i. What does the ‘K’ in KNN represent?

a.

The number of data points in the dataset.

c.

The number of categories in the data.

b. The number of dimensions in the data.

d. The number of the nearest neighbours considered when categorising a data point.

ii. Which distance measure is commonly used in the KNN algorithm to determine similarity between data points?

a. c.

Manhattan distance

b.

Euclidean distance d.

Hamming distance Cosine similarity

iii. What is one disadvantage of the KNN algorithm?

a.

It cannot handle classification tasks.

b. It does not perform well with high-dimensional data.

c.

d. It does not use the entire training dataset for prediction.

It cannot adapt to new data without retraining.

Unit 5 12. A neural network is a computational model inspired by the human brain, consisting of interconnected nodes (neurons) that process and transmit information. A type of neural network particularly effective for image processing tasks is the Convolutional Neural Networks (CNNs). CNNs, also known as ConvNets, are a type of deep learning algorithms created especially for processing and analysing visual data. CNNs are excellent at identifying patterns and structures in images, which sets them apart from standard neural networks. i. What is the primary function of the convolution layer in a CNN?

a.

To serve as an entry point for raw data

b. To extract significant features from an input image

c.

d. To eliminate negative values in the feature map

To reduce the spatial dimensions of the input feature maps

Competency-Based Questions

433


ii. What does the ReLU function do in a CNN?

a.

It selects the maximum value from each window of the feature map.

b. It reduces the spatial dimensions of the input feature maps.

c.

d. It serves as the entry point for raw data.

It preserves the positive value in the feature map by eliminating all negative values.

iii. Which type of pooling selects the maximum value from each window of the feature map covered by the kernel?

a.

Average Pooling b.

Max Pooling

c.

Min Pooling d.

Sum Pooling

13. In digital imaging, every pixel that constitutes an image stored on a computer has an associated pixel value. This value determines the brightness and the specific colour of the pixel. The most common format for storing these pixel values is the byte image, where each pixel’s value is represented as an 8-bit integer. This format allows each pixel to have a value ranging from 0 to 255. In this context, a pixel value of 0 typically represents no colour or black, while a value of 255 represents full colour or white. i. Why is the maximum pixel value 255 in an 8-bit system?

a.

Because it is the highest number in the decimal system.

b. Because it is the maximum value a single bit can represent.

c.

d. Because it is the standard value set by image processing software.

Because an 8-bit sequence can represent 256 different values, ranging from 0 to 255.

ii. What does a pixel value of 0 represent in a grayscale image?

a.

White b.

Black

c.

Gray d.

Red

ii. How are the shades of grey achieved in a grayscale image?

a.

By combining different intensities of red, green, and blue.

b. By using only the red colour.

c.

d. By using only the blue colour.

By using only the green colour.

Unit 6 14. NLP enables humans to interact with computers more naturally, using spoken or written language rather than highly developed programming languages. NLP involves a variety of algorithms that process and analyse large amounts of natural language data from users’ interactions, including text and speech. Human language operates according to specific rules. Within a sentence, we find nouns, verbs, adverbs, and adjectives—all essential for effective communication. These rules establish the structure of a language, a concept known as syntax, which involves the grammatical arrangement of words in a sentence. Understanding this structure allows us to interpret the meaning of a message. i. In the sentence “The cat sat on the mat,” what part of speech is the word “sat”?

a.

Noun b.

Adjective

c.

Verb d.

Adverb

434


ii. What does the word “bark” mean in the sentence “The dogs bark was loud”?

a.

The outer covering of a tree

b. A sound made by a dog

c.

d. A command

A type of boat

iii. In the sentence “She quickly ran to the store,” what part of speech is the word “quickly”?

a.

Noun b.

Adjective

c.

Verb d.

Adverb

15. Text normalisation is a crucial step in NLP that involves cleaning and standardising text data. This process ensures that the text is in a consistent format, making it easier for machines to process and understand. The steps of text normalisation are applied to a corpus. The term used for the whole textual data from all the documents is known as a ‘corpus’. i. What is the purpose of sentence segmentation in text processing?

a.

To translate text into different languages.

b. To break down a large text into individual sentences.

c.

d. To detect spelling errors in a text.

To count the number of words in a text.

ii. What is the main goal of tokenisation in natural language processing?

a.

To remove all punctuation from the text.

b. To translate text into different languages.

c.

d. To divide each sentence into individual elements like words, numbers, and special characters.

To count the number of sentences in a text.

iii. Why are stopwords often removed during data preprocessing?

a.

They are always misspelled.

b. They are too difficult to process.

c.

d. They are always special characters.

They do not provide substantial value to the analysis.

Unit 7 16. In the evaluation stage of the AI project cycle, we test all the models to see which one works best and gives the most reliable results. We try different ways to test our models to ensure they are accurate and efficient before deciding which one to use in the real world. To understand how well our model works, we compare its predictions with the actual scenario in the area where the prediction model has been deployed. So, we have two conditions to consider: prediction and reality. i. What does a True Positive (TP) indicate in a medical diagnosis model for detecting a disease?

a.

The model incorrectly identifies a healthy patient as having the disease.

c.

The model incorrectly identifies a patient with the disease as healthy.

b. The model correctly identifies a patient with the disease as having the disease. d. The model correctly identifies a healthy patient as healthy.

Competency-Based Questions

435


ii. In the context of an email spam filter, if the filter fails to mark a spam email as spam, what is this situation called?

a.

True Positive b.

True Negative

c.

False Positive d.

False Negative

iii. For a machine learning model predicting fraudulent transactions, if the model correctly predicts a non-fraudulent transaction, what is this called?

a.

True Positive b.

True Negative

c.

False Positive d.

False Negative

17. There are various evaluation methods used to assess the efficiency of a predictive model. Evaluation methods help in determining how effectively a model can generate correct predictions or classifications on previously unknown data. There are various evaluation techniques that allow us to assess the effectiveness of predictive models and make informed decisions based on the results. Some of these evaluation methods are accuracy, precision, recall, and F1 score. i. In which scenario is it more important to prioritise recall over precision?

a.

Predicting spam emails

b.

Detecting forest fires

c.

Predicting treasure locations

d.

Filtering advertisements

ii. What does a model with high precision aim to minimise?

a.

False negatives b.

True positives

c.

True negatives d.

False positives

iii. Which metric should be maximised if you want to limit False Negatives in a model?

a.

Precision b.

Recall

c.

Accuracy d.

F1-score

436


Part-C Practical Work


List of Practicals Python Basics 1. Create a Python program to calculate simple interest. 2. Create a Python program to check whether a string is a palindrome. 3. Create a Python program to convert celsius to fahrenheit. 4. Create a Python program to find the factorial of a number. 5. Create a Python program to convert kilometres to miles. 6. Create a Python program to print the fibonacci series up to n terms. 7. Generate the following pattern using a Python program. Take the number of rows as an input from the user. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8. Create a Python program to count vowels in a string. 9. Create a Python program to check if a number is prime. 10. Create a Python program to find the sum of digits of a number. 11. Create a Python program to generate random numbers. Python Strings 12. Create a Python program to count the number of vowels in a string. 13. Create a Python program to convert a string to title case. 14. Create a Python program to count words in a string. 15. Create a Python program to remove punctuation from a string. 16. Create a Python program to replace a substring in a string. 17. Create a Python program to convert a string into a list of characters. 18. Create a Python program to find the frequency of each character in a string. 19. Create a Python program to remove whitespace from a string. Python Lists 20. Create a Python program to find the largest number in a list. 21. Create a Python program to reverse a list. 22. Create a Python program to find the second-smallest element in a list. 23. Create a Python program to count occurrences of an element in a list. 24. Create a Python program to remove duplicates from a list.

438


25. Program to swap the numbers divisible by 3 in the following list: [9, 18, 27, 5, 6, 30, 15] 26. Create a Python program to merge two lists without duplicates. 27. Create a Python program to multiply all elements in a list. 28. Create a Python program to find the intersection of two lists. 29. Create a Python program to split a list into even and odd numbers. 30. Create a Python program to concatenate all elements of a list into a string. 31. Create a Python program to add the elements of the two lists. Python Tuples 32. Create a Python program to find the length of a tuple. 33. Create a Python program to convert a tuple into a list. 34. Create a Python program to reverse a tuple. 35. Create a Python program to check if an element exists in a tuple. 36. Create a Python program to find the index of an element in a tuple. 37. Create a Python program to remove an element from a tuple. (Tuples are immutable, so you must first convert them to a list.) 38. Create a Python program to find the maximum and minimum elements in a tuple. 39. Create a Python program to concatenate two tuples. 40. Create a Python program to count occurrences of an element in a tuple. 41. Create a Python program to find the second largest number in a list. 42. Create a Python program to check if two strings are anagrams. 43. Create a Python program to convert a list of strings to uppercase. 44. Create a Python program to sort a list of tuples. 45. Create a Python program to calculate the sum of even numbers in a list. Python Programs for Data Science 46. Create a Python program to create a dataframe of employee details: name, age, and department. 47. Create a Python program to add a new column in a dataframe. 48. The following is a list that contains the test scores of 10 students in a class test. Create a Python program to calculate the mean, median, and standard deviation. [78, 85, 90, 95, 88, 76, 89, 92, 84, 77] 49. Suppose you have the following sales data: Product

Sales

Region

B

520

South

A C

List of Practicals

D

450

700 350

North East

West

439


Condition: Sales > 500 Create a Python program to filter rows in a dataframe based on the given condition. 50. Consider the following employee data: Name

Department

Salary

Shalini Ahuja

IT

35000

Aman Jain

Charu Mittal Dev Sharma

HR HR

25000 22500

IT

37200

Create a Python program to group data by the Department column and calculate the average salary. 51. Create a Python program to create a bar plot using Matplotlib and Pandas for the following sample data: ‘Region’: [‘North’, ‘South’, ‘East’, ‘West’] ‘Products Sold’: [100, 150, 200, 120] 52. Consider the following dataframes: Dataframe 1: Employee Details Emp_ID

Name

0

101

Aman Jain

1

102

Shalini Ahuja

2

103

Charu Mittal

3

104

Dev Sharma

Dataframe 2: Salary Details Emp_ID

Salary

0

101

25000

1

102

35000

2

103

22500

3

104

37200

Create a Python program to merge the two dataframes. 53. Create a Python program to create a pie chart using Pandas and Matplotlib for the following dataset: ‘Product’: [‘A’, ‘B’, ‘C’, ‘D’] ‘Market Share (%)’: [30, 25, 20, 25] 54. Create a Python program to calculate the mean, median, and mode for the given data: 100, 102, 104, 98, 105, 99, 100, 101, 97, 103 55. Create a Python program to display a line chart from (2,5) to (9,10). 56. Create a Python program to display a scatter chart for the following points: (2,5), (9,10), (8,3), (5,7), (6,18). 57. Create a Python program to read the CSV file saved in your system and display 10 rows. 58. Create a Python program to read the CSV file saved in your system and display its information.

440


Python Programs for Computer Vision 59. Create a Python program to load and display an image using OpenCV. 60. Create a Python program to convert an image to grayscale. 61. Create a Python program to resize an image using OpenCV. 62. Create a Python program to add text to an image. 63. Create a Python program to read an image and identify its shape. 64. Do the following tasks in OpenCV: a. Load an image and give the title of the image. b. Change the image to grayscale. c. Print the shape of the image. d. Display the maximum and minimum pixels of the image. e. Crop the image. f.

Save the image.

List of Practicals

441


Viva-Voce Questions 1. Define artificial intelligence. Ans. AI can be defined as a branch of computer science concerned with creating intelligent machines that can learn from data, solve problems, and make decisions. 2. What is machine learning? Ans. Machine learning is a subset of AI that enables machines to improve at a task. It enables a computer system to learn from experiences using the provided data and make accurate algorithms for predictions or decisions. 3. Define deep learning. Ans. Deep learning is a subset of machine learning in which a machine is trained with vast amounts of data. It is an AI function that mimics the working of the human brain, processing information for tasks, and decision-making. 4. Name the three domains of AI. Ans. The three main domains of AI are Data Science, Computer Vision, and Natural Language Processing (NLP). 5. Define data and data science. Ans. Data is a collection of raw facts that can be transformed into useful information. It can be in the form of text, images, audio, or video. Data science is a vast and interdisciplinary field that involves extracting knowledge and insights from data. 6. Define computer vision. Ans. Computer Vision is another important domain of AI which uses cameras to see and understand visual information. 7. Expand the term NLP and explain it. Ans. NLP stands for Natural Language Processing. It is a domain of AI that enables computers to understand human language and generate appropriate responses when we interact with them. 8. What do you mean by data privacy? Ans. The appropriate management, collection, storage, and sharing of individual information is referred to as data privacy. 9. How does a machine become artificially intelligent? Ans. A machine becomes intelligent by training with data and algorithms. AI machines keep updating their knowledge to optimise their output. 10. Mention four examples of machines that are smart but not AI. Ans. Automatic gates in shopping malls/ remote control drones/ a fully automatic washing machine/ an air conditioner/ a refrigerator/ robotic toy cars/ a television, etc. 11. Name the five stages of the AI project cycle. Ans. The five stages of the AI project cycle are: problem scoping, data acquisition, data exploration, modelling and evaluation.

442


12. Define problem scoping. Ans. This is the initial stage that helps us understand the problems that need to be addressed and defines the goals to be achieved, with the help of an AI system. Identifying such a problem and having a vision to solve it is what problem scoping is about. 13. Define data acquisition. Ans. The process of collecting accurate and reliable data from various sources is called data acquisition. 14. What is data exploration? Ans. Data exploration is the process of examining data to understand its characteristics before starting its analysis. It involves looking at the data in detail to understand what insights it can provide. 15. What do you mean by the SDGs? Ans. SDGs, or the Sustainable Development Goals, which are often referred to as ‘Global Goals’, are a set of 17 goals adopted by the United Nations General Assembly in September 2015 to meet the needs of the world’s citizens without compromising the planet’s resources. 16. What is 4Ws Canvas and what is its significance? Ans. The 4Ws Canvas is a strategic tool that focuses on four fundamental questions: Who, What, Where, and Why. The 4Ws Canvas is a problem framing tool used to define and explain issues when solving a problem. 17. What is data visualisation? Ans. Data visualisation is the graphical representation of information and data. You can use various data visualisation techniques like charts, graphs, and maps to see and understand trends, patterns, and relationships in the data. 18. What do you understand about the AI modelling phase of the AI project cycle? Ans. AI modelling refers to the process of creating algorithms, known as models, that can learn from data and make predictions or decisions based on new data. 19. Define the rule-based approach. Ans. Rule-based AI, also known as expert systems, operates on a set of pre-defined rules created by developers. The machine is programmed with these rules and performs tasks according to the defined guidelines. 20. Define the learning-based approach. Ans. Learning-based AI empowers systems to learn patterns and make decisions from data without defining rules. As no predefined rules are framed, these approaches use algorithms that learn from data iteratively to improve their performance on a task. 21. Define supervised learning. Ans. Supervised learning is a machine learning method that uses well-labelled datasets to train models to predict outcomes and recognise patterns. In supervised machine learning, the dataset is known to the developer, which allows them to label the data accurately. 22. Define neural networks. Ans. A neural network can be thought of as a smart system that can learn to perform a task by looking at examples. It mimics how the human brain works, using neurons connected to form a network. 23. What is a virtual environment in Python? Ans. A virtual environment is a tool that allows you to have different dependencies and libraries for each project, preventing conflicts.

Viva-Voce Questions

443


24. Define syntax errors. Ans. Syntax errors are mistakes that happen when we don’t write our code correctly, such as using incorrect function names or missing quotes and brackets. 25. What are variables in Python? Ans. A variable is a reference name given to a location in the computer’s memory. 26. Give two rules for naming a variable. Ans. Two rules for naming a variable are: 1. A variable name starts with a letter or the underscore character. It cannot start with a number or any special character like $, (, *, %, etc. 2. A variable name can only contain alpha-numeric characters. 27. What are control statements in Python? Ans. The control statements in Python are used to control the flow of execution of the program. 28. What is indentation and how is this helpful in Python programs? Ans. Indentation refers to a fixed number of spaces (or sometimes tabs) added at the beginning of each line of code. Indentation helps Python understand which lines of code belong together and should be executed as a single unit. 29. How do you use modules and packages in Python? Ans. A Python library is a set of modules. Modules that are linked to one another are often placed in the same package. When a module from another package is required in a program, the package can be imported and its modules used. 30. Define NumPy. Ans. The term “NumPy” is an abbreviation for “Numerical Python”. NumPy is a commonly used package for working with numbers. It provides support for arrays and matrices, along with a collection of mathematical functions to operate on them efficiently. It has built-in mathematical tools that make calculations easy. 31. Define OpenCV. Ans. OpenCV stands for Open Source Computer Vision Library. It plays an essential role in real-time operation, which is important in modern systems. It allows you to process photos and videos in order to recognise objects, people, or even human handwriting. OpenCV supports several different programming languages, including Python, C++, and Java. 32. What would be the full form of NLTK? Ans. NLTK stands for Natural Language Toolkit. This toolkit allows for sentiment analysis of a given text, which is useful for applications like social media monitoring and product review analysis. 33. Define the function of the Pandas library. Ans. Pandas makes data processing, data manipulation, and data cleaning easier. 34. For what purpose do we use the Matplotlib library of Python? Ans. Matplotlib was created by John D. Hunter. It is a popular Python library for creating static, animated, or interactive visualisations. It is capable of generating visually detailed representations such as pie charts, histograms, scatter plots, bar graphs, etc.

444


35. Define Pandas. What are Pandas used for in Python? Ans. The name “Pandas” refers to “Panel Data” and “Python Data Analysis”. It is useful for handling two-dimensional data tables. It is used to work with data from Excel sheets and other databases. It makes data processing, data manipulation, and data cleaning easier. 36. What do you mean by image classification? Ans. Image classification is the process of assigning an input image a label from a predetermined list of categories. 37. What are pixels? What role do they play in image classification? Ans. The smallest unit of a digital image is called a “picture element,” which is what the name “pixel” refers to. A digital photograph is made up of thousands or even millions of these pixels. Pixels are usually square but occasionally round and are carefully organised in a two-dimensional grid to form the entire image. 38. Define resolution in the context of images. Ans. Resolution refers to the total number of pixels contained within an image. Resolution determines the image’s clarity and detail. 39. What are chatbots? How do they work? Ans. Chatbots are computer programs designed to imitate human-like conversation using text or speech interfaces. NLP is essential for chatbots to comprehend the user’s input, generate appropriate responses, and engage in meaningful conversations. 40. Define the following terms: a. Text Normalisation b. Sentence Segmentation c. Tokenisation d. Stemming e. Lemmatisation Ans. a. Text normalisation is a crucial step in NLP that involves cleaning and standardising text data. This process ensures that the text is in a consistent format, making it easier for machines to process and understand. b. In sentence segmentation, we break down a large text (corpus) into individual sentences. Each sentence is then treated as a separate piece of data. c. After segmenting the text into sentences, the next step is to divide each sentence into tokens. Tokens refer to individual elements of the sentence, such as words, numbers, and special characters. All these elements are handled independently throughout the tokenisation process, so each one becomes a different token. d. In NLP, stemming is a method for refining words to their most basic or root form. Words are stripped of their prefixes and suffixes in order to create a fundamental form called the root word. e. Lemmatisation is a NLP technique that involves reducing words to their base or root form. Unlike stemming, which simply cuts off prefixes or suffixes to achieve the root form, lemmatisation considers the meaning of the word.

Viva-Voce Questions

445


Part-D Project Work

446


Projects Project 1: Establish the relationship between various data features that are used to train an AI model using an animated tool called LOOPY. Follow the given steps: 1. Visit this link: https://ncase.me/loopy/ 2. The following window opens. Click on the OR, MAKE A MODEL FROM SCRATCH button.

Projects

447


You will be directed to a web page as shown.

Now, use the various tools provided by the online platform LOOPY to create a system map representing the relationship between various data features essential for predicting the quantity of food dishes to be prepared for everyday consumption in restaurant buffets. [Hint: Various factors or data features that affect the quantity of food to be prepared for the next day consumption in buffets can include the total number of customers, the price of dish, and the quantity of dish prepared per day, etc.]. Project 2: Create a student marks prediction model.

448


Develop a machine learning model that predicts student marks based on historical data, related to their study habits, attendance, past performances, etc. You will go through all the stages of the AI project cycle, from problem scoping to evaluation, and analyse the model’s effectiveness.

Problem Scoping

Data Acquisition

Data Exploration

Modelling

Evaluation

Project Stages: 1. Problem Scoping: Create the 4Ws Canvas: •

Who: School administrators, teachers, and students.

• What: Predicting students’ final exam marks based on factors such as attendance, study hours, previous grades, and extracurricular involvement. •

When: At the start of the academic year or before important assessments to identify at-risk students.

• Why: To support students and educators in identifying areas where extra help may be required, allowing for targeted interventions. 2. Data Acquisition: •

Collect historical student performance data (e.g., grades, study hours, class attendance).

•

Collect Teacher feedback (categorical: Excellent, Good, Average, Poor)

3. Data Exploration: •

Clean and prepare the dataset (handle missing data, outliers, and correct data types).

•

Visualise key relationships between variables using plots (e.g., correlation between study hours and marks).

4. Modelling: •

Split the data into training and testing sets.

•

Train the model on the training set and test it on the testing set.

5. Evaluation: Analyse model performance: •

Consider whether the model is underfitting or overfitting based on the error rates.

• Assess the performance of the model using a confusion matrix to visualise the performance of the model by summarising the counts of correct and incorrect predictions. Projects

449


•

Then, evaluate the performance of the model using metrics like accuracy, precision, recall, and F1 score.

• Provide recommendations for improving the model (e.g., using additional data or more complex algorithms). Students can also develop a user-friendly interface or web-based application where teachers or students can input relevant data and predict marks.

450


Sample Paper – 1 Artificial Intelligence (Subject Code - 417) Class X (Session 2024–2025) Max. Time: 2 Hours

Max. Marks: 50

General Instructions: 1.

Please read the instructions carefully.

3.

Section A has Objective type questions, whereas Section B contains Subjective type questions.

2.

This Question Paper consists of 21 questions in two sections: Section A & Section B.

4. Out of the given (5 + 16 =) 21 questions, a candidate has to answer (5 + 10 =) 15 questions in the allotted (maximum) time of 2 hours. 5. 6.

All questions of a particular section must be attempted in the correct order. SECTION A - OBJECTIVE-TYPE QUESTIONS (24 MARKS): i.

ii.

This section has 05 questions.

Marks allotted are mentioned against each question/part.

iii. There is no negative marking. 7.

iv. Do as per the instructions given.

SECTION B – SUBJECTIVE-TYPE QUESTIONS (26 MARKS): i.

ii.

This section has 16 questions.

A candidate has to do 10 questions.

iii. Do as per the instructions given.

iv. Marks allotted are mentioned against each question/part.

SECTION A: OBJECTIVE-TYPE QUESTIONS Q1. Answer any 4 out of the given 6 questions on Employability Skills.

(1 x 4 = 4 marks)

1. Ankita always organises her tasks for the day, prioritises them based on importance, and ensures she completes them efficiently, maintaining a balance between work and personal life. Which self-management skill is clearly visible in the given statement? 2. When you bring the mouse over a file in File Explorer, it will show the details of that file. This is known as a. Drag and drop c. Hover

b. Double-click d. Single-click

3. Assertion (A): Entrepreneurs play a crucial role in driving economic growth by creating new businesses and generating employment opportunities. Reason (R): Entrepreneurs primarily focus on sustaining existing market trends rather than innovating or taking risks in order to develop new products or services.

Sample Paper – 1

451


a. Both A and R are correct, and R is the correct explanation of A b. Both A and R are correct, and R is the correct explanation of A c. A is correct, but R is not correct d. A is not correct, but R is correct

4. ............................... is a process by which a receiver interprets and understands a message sent by a sender. a. Encoding

c. Feedback

b. Transmitting d. Decoding

5. In a classroom with poor lighting, students struggle to read the teacher’s notes on the board and have difficulty seeing the teacher’s facial expressions. This issue is an example of ............................... a. Linguistic barrier

c. Interpersonal barrier

b. Physical barrier d. Cultural barrier

6. A company implements policies to ensure equal pay for equal work, regardless of gender, and it provides opportunities for women in leadership positions. Which SDG can you relate this statement to? a. SDG 5: Gender Equality

b. SDG 8: Decent Work and Economic Growth c. SDG 3: Good Health and Well-being d. SDG 4: Quality Education

Q2. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Assertion (A): Intelligence involves the ability to learn, solve problems, think critically, and manage emotions. Reason (R): Intelligence is limited to only academic knowledge and does not include creativity or emotional management. a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A. c. A is correct, but R is not correct. d. A is not correct, but R is correct. 2. An international tech organisation discovered that an algorithm used in a widely used app consistently favoured certain groups over others, leading to unequal outcomes for underrepresented users. They decided to intervene and address the issue. Which terminology suits best for this action? a. AI Ethics

c. AI Access

b. Data Privacy d. AI Bias

3. Statement 1: Filters in image editing software modify pixel values to enhance the appearance of images. Statement 2: Advanced image editing techniques only involve cropping and resizing images. a. Both Statement 1 and Statement 2 are correct b. Both Statement 1 and Statement 2 are incorrect

c. Statement 1 is correct but Statement 2 is incorrect d. Statement 2 is correct but Statement 1 is incorrect

452


4. Look at the graph and fill in the blank: Values

Time The above model is said to be ............................... as the model’s performance is trying to cover all the input data samples even if they are out of alignment with the actual values. 5. ............................... is a simple file format that stores data separated by commas. a. jpg

c. csv

b. doc

d. png

6. A corpus contains 10 documents in which the word ‘health’ appears in 8 of them. Identify the term in which we can categorise the word ‘health’. a. Stop word

c. Rare word

b. Frequent word d. None of these

Q3. Answer any 5 out of the given 6 questions. 1. Read the examples given below— a. Using a self-driving car

c. Automatic washing machine

Choose the options that are not AI: a. i and ii

c. iii and iv

(1 x 5 = 5 marks) b. Remote-controlled AC using IoT

d. Temperature-controlled coffee maker b. ii and iii

d. ii, iii and iv

2. ............................... mimics how the human brain works, using neurons connected to form a network. 3. Which of the following is an application of computer vision? a. Facial recognition for security systems c. Predictive text in messaging apps

b. Text-to-speech conversion

d. Voice-controlled virtual assistant

4. ............................... is a collection of raw facts that can be transformed into useful information. 5. Identify the method used for building AI models: Once the model has learnt from the data during training, it can be tested to predict the output using new and unseen data. The major feature of this approach is that it updates itself with changes in the data, allowing it to improve its performance over time and adapt to new and unseen patterns. 6. ............................... is defined as the percentage of true positive predictions to the total number of positive predictions. a. Accuracy c. Recall

Sample Paper – 1

b. Precision d. F1 Score

453


Q4. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Srishti learnt about AI terminologies but was not able to recall the term that is used to refer to machines that perform tasks with vast amounts of data using neural networks. Help her with the correct term. 2. Statement 1: A False Positive (FP) occurs when the model predicts a positive value, but the actual value is negative. Statement 2: A True Negative (TN) occurs when the model predicts a negative value, and the actual value is also negative. a. Both Statement 1 and Statement 2 are correct.

b. Both Statement 1 and Statement 2 are incorrect. c. Statement 1 is correct, but Statement 2 is incorrect.

d. Statement 2 is correct, but Statement 1 is incorrect. 3. Ananya has developed a model to predict house prices in various cities. She collected data on factors such as the location, number of bedrooms, square footage, and the age of the house. Her model works well, providing accurate predictions with a high recall value. Which of the statements given below is incorrect?

a. Data gathered on location, number of bedrooms, square footage, and age of the house is known as testing data. b. Data given to an AI model to evaluate its performance is testing data.

c. Training data and testing data are acquired during the data acquisition stage. d. Training data is typically larger than testing data. 4. What is the smallest unit of a digital image called? 5. Which domain of AI is primarily used for sentiment analysis in text data? a. Computer Vision

b. Natural Language Processing (NLP)

c. Robotics d. Data Statistics

6. Sneha used charts, graphs, and maps to represent information and data, which helped her identify trends, patterns, and relationships. What concept is she using? Q5. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Deeksha is using a wristband that tracks her heart rate and converts it into digital data. This data is then analysed to monitor her cardiovascular health and provide insights or alerts. What term best describes the technology being used in this scenario? a. Sensor

c. Surveys

b. Web scraping d. APIsg

2. What is the term used for a subset of AI that allows machines to improve their performance on a task through learning from experiences and data? 3. What is the term for the middle value in a dataset, which requires sorting the data in ascending order before calculation? a. Mean

c. Mode

454

b. Median

d. Standard Deviation


4. Which algorithm represents text as a collection of words, disregarding grammar and word order, and focuses on counting word frequencies to create a vocabulary for the text? a. Word2Vec

c. Bag of Words (BoW)

b. Corpus

d. Named Entity Recognition

5. What term refers to individual elements of a sentence, such as words, numbers, and special characters, which are treated independently? a. Tokens

b. Vocabularies

c. Corpus

d. Features

6. Which one of the following scenarios results in a high false negative cost?

a. A model incorrectly predicts an email as spam when it is actually not spam. b. A model failing to detect a disease in a patient who is actually sick.

c. A model predicting the stock price will go up when it actually goes down. d. A model mistakenly identifies a cat as a dog in a photo.

SECTION B: SUBJECTIVE-TYPE QUESTIONS Answer any 3 out of the given 5 questions on Employability Skills.

(2 x 3 = 6 marks)

Answer each question in 20–30 words. Q6.

List two best practices for effective communication.

Q7.

What is the importance of stress management in our daily lives?

Q8. A computer virus is a program or set of programs that interrupts a computer’s normal functioning and can infect or destroy data.

How can we protect our computer against viruses?

Q9. What are the qualities of a successful entrepreneur? Q10. Mention any two key and popular sustainable practices that help reduce environmental impact. Answer any 4 out of the given 6 questions in 20–30 words each.

(2 x 4 = 8 marks)

Q11. Mention four examples of artificially intelligent applications in our smartphones. Q12. Shivam is analysing a dataset with hundreds of features related to customer behaviour for a marketing campaign. To focus on the most significant features and streamline his analysis, which technique should he use, and what is its primary benefit? Q13. Aadya is concerned about the impact of excessive technology use on young children’s cognitive development. What are some potential drawbacks of relying too heavily on AI-driven educational tools for young kids? Q14. What is data science? Q15. Identify any two words in the following sentence that are considered stopwords and explain why they should not be removed: “Get help and support whether you’re shopping now or need help with a past purchase. Contact us at support@example.com or on our website www.example.com”

Sample Paper – 1

455


Q16. Draw the confusion matrix for the following data:

•

Number of True Positive = 120

•

Number of True Negative = 85

•

Number of False Positive = 30

•

Number of False Negative = 50

Answer any 3 out of the given 5 questions in 50–80 words each.

(4 x 3 = 12 marks)

Q17. Sanya is working on a project that involves analysing and presenting data visually. She wants to understand how data visualisation can enhance her analysis. Explain how data visualisation can benefit her project and name any four tools that can assist her in creating detailed charts and graphs. Q18.

Akhil wants to learn how to scope the problem for an AI project. Explain to him the following: a. 4W Problem Canvas

b. Problem Statement Template Q19. Identify and explain the types of the computer vision tasks in each part of the figure given below.

a.

b.

c.

d.

Q20. What are the applications of NLP? Q21. Consider the following confusion matrix: Confusion Matrix Prediction

Reality

Yes

Yes

No

No

120

30

a. Identify the total number of wrong predictions made by the model. b. Calculate precision, recall, and F1 score.

456


Sample Paper – 2 Artificial Intelligence (Subject Code - 417) Class X (Session 2024–2025) Max. Time: 2 Hours

Max. Marks: 50

General Instructions: 1.

Please read the instructions carefully.

3.

Section A has Objective type questions, whereas Section B contains Subjective type questions.

2.

This Question Paper consists of 21 questions in two sections: Section A & Section B.

4. Out of the given (5 + 16 =) 21 questions, a candidate has to answer (5 + 10 =) 15 questions in the allotted (maximum) time of 2 hours. 5. 6.

All questions of a particular section must be attempted in the correct order. SECTION A - OBJECTIVE-TYPE QUESTIONS (24 MARKS): i.

ii.

This section has 05 questions.

Marks allotted are mentioned against each question/part.

iii. There is no negative marking. 7.

iv. Do as per the instructions given.

SECTION B – SUBJECTIVE-TYPE QUESTIONS (26 MARKS): i.

ii.

This section has 16 questions.

A candidate has to do 10 questions.

iii. Do as per the instructions given.

iv. Marks allotted are mentioned against each question/part.

SECTION A: OBJECTIVE-TYPE QUESTIONS Q1. Answer any 4 out of the given 6 questions on Employability Skills.

(1 x 4 = 4 marks)

1. Despite facing financial challenges and criticism, Ritika continued to work hard and remained focused on her startup. She stayed committed to her vision without relying on others for motivation. Eventually, her startup succeeded. Which self-management skill does Ritika display? 2. Neha is working on her computer and needs quick access to several programs she uses frequently. She notices a horizontal bar at the bottom of her desktop with shortcuts to open apps, a clock, and a notification area. Which desktop feature is Neha using to access her programs quickly? 3. Assertion (A): Vikas effectively manages his time, sets goals, and maintains a balanced life, which leads to increased productivity and happiness.

Sample Paper – 2

457


Reason (R): Self-management is a critical life skill that helps individuals prioritise tasks, maintain focus, and achieve their goals while balancing personal and professional responsibilities. a. Both A and R are correct, and R is the correct explanation of A b. Both A and R are correct, and R is the correct explanation of A c. A is correct, but R is not correct d. A is not correct, but R is correct

4. Ravi believes that to become a successful entrepreneur, he needs to come up with a completely unique idea that no one has ever thought of before. He feels discouraged because he thinks all the good ideas are already taken. Which myth about entrepreneurship is Ravi believing in? a. Entrepreneurs are born, not made b. Entrepreneurship requires a completely unique idea

c. Entrepreneurs don’t face failure d. None of these

5. The process of transmitting information from one source to another through speech, writing, gestures, visuals, or symbols is called ................................ a. Coordination

c. Collaboration

b. Communication d. Computation

6. Efforts are being made to ensure that cities are safe, resilient, and sustainable by improving infrastructure, enhancing public transportation, and promoting inclusive urban planning. Which SDG can you relate this statement to? a. Sustainable cities and communities b. Good health and well-being

c. Industry, innovation, and infrastructure d. Clean water and sanitation

Q2. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Assertion (A): Projects using sensors for automation are not considered AI if they don’t use data for learning. Reason (R): AI needs to learn from data to make decisions, while basic sensor automation does not involve learning. a. Both A and R are correct, and R is the correct explanation of A.

b. Both A and R are correct, but R is not the correct explanation of A. c. A is correct, but R is not correct. d. A is not correct, but R is correct. 2. A tech company is implementing measures to ensure that user information collected through their app is protected from unauthorised access and misuse. They are focusing on securing personal data and ensuring it is not shared without consent. Which terminology suits best for this action? a. AI Ethics c. AI Bias

458

b. Data Privacy

d. Generative AI


3. Statement 1: There are three types of layers in a neural network. Statement 2: The neurons in a neural network are not connected in a way that mimics the human brain. a. Both Statement 1 and Statement 2 are correct.

b. Both Statement 1 and Statement 2 are incorrect.

c. Statement 1 is correct, but Statement 2 is incorrect. d. Statement 2 is correct, but Statement 1 is incorrect.

Occurence

4. Observe the given graph and fill in the blank:

Frequent words Rare/Valuable words Value

As the frequency of words continues to drop, the value of these words _______________. 5. NLP algorithms convert the spoken content of YouTube videos into text, producing a text-based representation known as a ................................ a. Caption

c. Transcript

b. Summary d. Pixel

6. A text analysis project involves processing a large dataset where various forms of the word ‘running’ are being reduced to their base form. Unlike another technique that simply trims word endings, this technique ensures that the base form has a meaningful representation and takes more time to execute. Which NLP technique is used in this scenario? a. Stemming

c. Tokenisation

b. Lemmatisation

d. Normalisationr

Q3. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Read the examples given below: i. Virtual assistants predominantly use female voices due to societal stereotypes associating female voices with helpfulness. ii. Facial recognition systems have higher error rates for people with darker skin tones. iii. AI algorithms used for screening job applicants may perpetuate historical gender preferences. iv. AI-driven apps for essay writing may impact teenagers’ critical thinking skills. Choose the options that are not examples of AI bias: a. i and ii

c. Only iii

b. ii and iv d. Only iv

2. ............................... is the stage in the AI project cycle that involves gathering or collecting data to address the problem defined.

Sample Paper – 2

459


3. Which of the following is an application of computer vision? a. Voice recognition

c. ext summarisation

b. Image classification d. Speech synthesis

4. ............................... is widely used in social media monitoring, customer review analysis, and market research to gauge public opinion and emotion towards products or brands. a. Sentiment analysis

c. Predictive analytics

b. Image classification d. Speech recognition

5. Identify the given Chat bot type: It learns from its environment and experience, building on its capabilities based on acquired knowledge. These systems can collaborate with humans, working along-side them and learning from their behaviour. ..... ........................... 6. F1 score is the measure of the ............................... between precision and recall. a. Harmonic mean

c. Geometric mean

b. Arithmetic mean d. Median

Q4. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Manas learnt about AI technologies and came across a term used for videos where someone’s appearance is convincingly altered to look like someone else, but the person in the video is actually someone different. What is this technology called? a. Deepfake

c. Facial Recognition

b. Augmented Reality d. Virtual Reality

2. Statement 1: The term used when an AI model correctly identifies a positive instance is known as a True Positive. Statement 2: The term used when an AI model incorrectly classifies a negative instance as positive is known as a False Negative. a. Both Statement 1 and Statement 2 are correct.

b. Both Statement 1 and Statement 2 are incorrect. c. Statement 1 is correct but Statement 2 is incorrect.

d. Statement 2 is correct but Statement 1 is incorrect. 3. Aisha has developed a model to predict which customers are likely to cancel their subscriptions for a telecom company. She collected data on customer usage patterns, billing information, and customer service interactions. Her model is evaluated for its accuracy and performance. Which of the statements given below is incorrect?

a. Data related to customer usage patterns, billing information, and customer service interactions is known as training data.

b. Data used to evaluate the model’s performance and accuracy is known as testing data c. Training data is used to build and train the model.

d. Testing data is typically larger compared to training data. 4. Name the intelligence that refers to the ability to use one’s body effectively to solve problems or create products, involving a keen sense of body awareness, coordination, etc.

460


5. What is the purpose of using a scatter plot in data visualisation? a. To show the distribution of a single variable.

b. To display the relationship between two variables.

c. To represent the frequency of categories in a dataset. d. To illustrate changes over time in a variable. 6. Riya developed a model to predict student performance but used a very simple model with minimal features. The model performed poorly on both the training data and new, unseen data, failing to capture the complexities of the data. Name the concept that describes this issue. Q5. Answer any 5 out of the given 6 questions.

(1 x 5 = 5 marks)

1. Raj developed a system that can understand and respond to spoken commands related to controlling smart home devices, such as adjusting the thermostat or turning on lights. Identify the domain of AI in the given scenario. a. Computer Vision

c. Natural Language Processing

b. Data Science d. Robotics

2. Write the formula used to calculate the precision of a model. 3. What does AI access refer to?

a. The rapid development of AI technologies without affecting everyday life.

b. The increasing availability of AI tools and technologies for people and businesses across various fields. c. The restriction of AI technologies to large corporations only. d. The focus on developing new hardware for AI systems.

4. Which AI tool uses Natural Language Processing to understand and respond to user commands for tasks such as setting alarms and checking the weather? a. Autonomous vehicles

c. Recommendation systems

b. Virtual assistants

d. Facial recognition systems

5. Which algorithms result in two things, a vocabulary of words and frequency of the words in the corpus? a. Sentence segmentation c. Bag of words

b. Tokenisation

d. Text normalisation

6. In which scenario would a high false positive cost be most concerning? a. Spam email detection

c. Predicting movie ratings

b. Online shopping recommendations d. Weather forecasting

SECTION B: SUBJECTIVE-TYPE QUESTIONS Answer any 3 out of the given 5 questions on Employability Skills.

(2 x 3 = 6 marks)

Answer each question in 20–30 words. Q6. Q7.

What are various elements of a communication cycle?

What are some effective strategies for managing stress?

Q8. The Trojan Horse was a wooden horse said to have been used by the Greeks during the Trojan War to enter the city of Troy and win the war.

What does Trojan horse mean in computer terminology?

Sample Paper – 2

461


Q9. What are the characteristics of entrepreneurs? Q10. Mention any two human activities that lead to environmental degradation. Answer any 4 out of the given 6 questions in 20–30 words each.

(2 x 4 = 8 marks)

Q11. What is machine learning? Q12. If Aman and Deepika are developing an AI model to categorise data based on predefined rules and fixed criteria, which approach should they use for building the AI model and why? Q13. Suppose you are developing a “fitness tracking application” for a school project. What types of data will your app need to collect to provide accurate fitness tracking and personalised recommendations? Q14. Define the term pixel. Q15. What are the key steps involved in text normalisation? Q16. Draw the confusion matrix for the following data

• True Positive (TP) = 85

• True Negative (TN) = 130

• False Positive (FP) = 55

• False Negative (FN) = 70

Answer any 3 out of the given 5 questions in 50–80 words each.

(4 x 3 = 12 marks)

Q17. Your friend thinks that everything around us is AI because there are many advanced technologies today. Help them understand the difference by providing two examples of what is AI and two examples of what is not AI. Also give an explanation for the same. Q18. Rudraksh wants to learn about the AI project cycle. Explain to him the following stages of the AI project cycle: a. Problem Scoping

b. Modelling

Q19. Identify and explain the types of the learning-based approaches in the figures given below.

Dog

I think you’re a dog.

Dog What am I?

Cat

Cat Figure 1

I have no idea what you gave me, but I can tell you these two on the left are different from the two in the right.

Figure 2

462


Q20. Explain how increased AI access can lead to both positive and negative outcomes in society. Provide examples of how AI access benefits various fields and discuss the potential challenges associated with unequal access to AI technologies. Q21. Consider the following confusion matrix: Confusion Matrix Prediction

Yes No

Reality Yes

No

5

0

45

50

a. Identify the total number of wrong predictions made by the model. b. Calculate precision, recall, and F1 score.

Sample Paper – 2

463


Employability Skills

Unit 1: Communication Skills-II Answer Key A. 1.

b

2.

9.

b

10. c

B. 1. 5. C. 1.

b

3.

c

misunderstanding/miscommunication Visual

6.

linking

7.

4.

c

2.

interpersonal

Coherence

5.

8.

c

6. a 3.

receiver

Negative

False. All regions have their own languages and not knowing them may create misunderstandings. True.

3.

True.

4.

False. Feedback is an important component of effective two-way communication.

5.

True. False. Non-verbal communication refers to the ideas and information that are conveyed by using body language, posture,

gestures, facial expressions, and so on.

7.

False. We use ’the’ before the names of newspapers.

8.

True.

D. 1.

4.

8. a

interpersonal

2.

6.

7. a

An organisational barrier refers to any obstacle or challenge within a company or institution that affects the effective flow of

communication among individuals, teams, or departments. Hierarchical structures, ineffective communication channels, lack

of transparency, conflicting objectives, and varying priorities are few causes of this barrier. Organisational barrier can make it difficult for information to be shared timely and accurately, which can result in misunderstandings, decreased efficiency, and general communication failures within the company.

Example: In a large organisation, there is no standardised method for employees to communicate important updates or

information. Some teams rely on email, others on instant messaging, and some prefer in-person meetings. The lack of clear communication channels can result in employees missing critical information, duplication of efforts, and confusion about where to find the latest updates.

2.

Encoding

Decoding

Encoding is the process of converting the sender’s thoughts

Decoding is the process by which the receiver interprets

and ideas into a form that can be understood by others.

It involves choosing relevant words, arranging sentences, and using symbols to create a message that can be effectively transmitted. 3.

and understands the message sent by the sender.

It involves analysing the words, symbols, and context to derive the intended meaning.

Written communication is communicating using written words.

a. It is a formal and structured mode of communication that uses written language to record and transmit information. It involves creating messages that other people can read, using symbols like letters and numbers.

b. For official purposes, written communication is frequently utilised since it leaves a permanent record that may be consulted and evaluated in the future. It is also useful for legal purposes, historical records, and documentation.

464


4.

Every sentence can be broken down into two essential parts: a subject and a predicate. A subject in a sentence is a word or a group of words that tells the name of a person or thing that the sentence is about. A

predicate in a sentence is the part of a sentence that tells what the subject is doing or what the subject is. Example:

He

enjoys going to the cinema.

Subject

Predicate

5. The process of exchanging ideas, opinions, knowledge, and facts in order to ensure that the message is received and

understood with clarity and purpose is known as effective communication. Effective communication means we know what we are trying to communicate and the audience/receiver is getting exactly what we are trying to say.

E. 1.

Factors contributing to communication barriers are:

a. Lack of Clarity: Unclear or incomplete messages can lead to confusion, misunderstanding, and misinterpretation. b. Lack of Feedback: Effective communication includes continuous feedback and without the feedback, it becomes difficult for the sender to make necessary adjustments.

c. Too Much Information: Providing excess or too much information overwhelms the receiver and makes it challenging for them to process the main points.

d. Distractions: Any type of noise or interruptions can divert the attention of the receiver, which can lead to incomplete communication, where the receiver may not have perceived it correctly.

e. Cultural Differences: What may be considered appropriate and respectful communication behaviour in one culture might be seen as disrespectful or confusing in another culture.

f. Power Dynamics: Unequal power relationships can hamper the communication within any organisation. Subordinates might hesitate to express their opinions to their seniors.

g. Perceptual Differences: People interpret messages based on their individual perspectives or experiences; this can lead to interpreting the same message in a different way.

h. Technological Issues: Poor internet connectivity, software errors, or not understanding the communication tools can disrupt the flow of information.

2.

Specific and Non-specific feedback can be differentiated in the following way: Specific Feedback It gives elaborate information on particular aspects of

It talks about the entire performance while giving a

suggestions to the receiver.

specific thing/ feature.

communication or performance and offers substantial It is advantageous because it provides the receiver directly

with valuable points to consider and enables them to focus on the areas that need improvement.

Example – ’I like the way you described your uncle’s character. it makes me feel like I know him too.’ 3.

Non-specific Feedback general overview. It does not particularly pinpoint a

It lacks the necessary details to guide someone on how to enhance their performance or work.

Example- ’I like your story. It is good.’

Non-verbal communication refers to the messages and information that are delivered without using words or spoken

language and involves expressing thoughts, ideas, and sentiments through gestures, facial expressions, and body language. For Example, using the thumbs-up sign to indicate that you have understood. The advantages of non-verbal communication are:

a. Making Messages Clearer: It adds extra information to what you’re saying with words. b. Quick Communication: It can be faster than talking. For example, you can signal ’stop’ with your hand without saying a word, and people will understand.

c.

Building Trust: It helps build trust and connections with others.

Unit 1: Communication Skills-II

465


d. Conveys Emotions and Feelings: Facial expressions, body language, and tone of voice can convey happiness, sadness, anger, fear, and other emotions.

e.

Support Verbal Communication: Nonverbal cues can support, enhance, and strengthen verbal information.

f.

Helpful for Specially Abled People: They can use gestures to convey their ideas and thoughts.

4.

A phrase is a collection of words used to express a single idea. They do not have both subject and predicate, so they do

not express a complete thought on their own. They add depth, detail, and nuances to the sentences, making them crucial components. For better writing, it is crucial to understand phrases. They enrich and elaborate sentences, enhancing their vividness and interest.

a. Noun Phrase: A group of words centred around a noun, which can include articles, adjectives, and other modifiers.

Example – Those new pink shoes are mine.

b. Verb Phrase: A group of words centred around a verb, often containing auxiliary verbs and other elements.

Example – They were playing football.

c.

Adjective Phrase: A group of words centred around an adjective, providing additional information about a noun.

Example – He bought a car with a sleek, modern design. d. Adverb Phrase: A group of words centred around an adverb, providing more details about a verb, adjective, or adverb. Example – She sings melodiously. 5. The process of exchanging ideas, opinions, knowledge, and facts in order to ensure that the message is received and understood with clarity and purpose is known as effective communication. Following are the principles of effective communication: a. Simple Language: Using language that is easy to understand helps ensure that both the sender and receiver grasp the message without confusion.

b. Definite Purpose: Having a clear purpose in mind while communicating prevents misunderstandings and ensures the message’s intent is well-understood.

c. Completeness and Concision: Providing all the information required to the recipient in a clear and straightforward manner, guarantees that they will understand everything without feeling overburdened.

d. Appropriate Medium: Choosing the right communication medium, considering factors, such as timing, distance, and the nature of interaction, ensures effective communication.

e.

Authenticity: Sharing accurate and honest information builds trust and credibility in communication.

f.

Courtesy: Politeness and respect in communication contributes to a positive atmosphere and healthy relationships.

g. Active Listening: Effective communication involves not only speaking or writing, but also actively listening to others. h. Adaptability: Tailor your communication to the needs and preferences of your audience. Consider their level of knowledge, communication style, and the context of the interaction.

F.

1.

To ensure a successful speech in a university at Delhi, Professor Krishna can take several actions, including:

a. Language Preparation: Familiarize himself with the local language commonly spoken in North India. This will help him connect with the audience and convey his message effectively.

b. Cultural Sensitivity: Respecting local customs and incorporating them into his speech can establish rapport with the audience.

c. Visual Aids and Clarity: Using visual aids, such as slides or props, can aid in conveying the message even if there are language barriers.

d. Engage with the Audience: Encourage interaction with the audience through questions to maintain their interest and ensure better comprehension.

2.

Rakesh and Vinay need to consider the following factors before giving descriptive feedback to the junior employee:

a. Goal-Oriented: Feedback should align with the intended goals. b. Actionable: It should provide actionable steps for improvement and suggest specific strategies or changes.

466


c.

User-Friendly: Feedback should be easy to understand and easily comprehensible.

d. Giving Timely Feedback: Feedback should be on time to ensure its relevance and impact on the receiver’s work or communication.

e. 3.

Positive Feedback: Feedback should include the strengths and positive points of the employee.

Prakshi should acquire some non-verbal skills to increase her chances of getting selected in the interview. She should focus on:

a. Professional Appearance: Dress appropriately, according to the job profile and company culture. b. Eye Contact: Maintain consistent and friendly eye contact with the interviewer to convey confidence and engagement. c.

Smile: Offer a warm and genuine smile when appropriate. It creates a positive and approachable impression.

d. Body Language: Sit up straight and maintain a good posture. e. 4.

Active Listening: Show that you’re actively listening to the interviewer by nodding and asking relevant questions.

There are three factors to keep in mind while writing a well-structured paragraph. I would suggest Moksh to write a

paragraph on teamwork with:

a. Topic Sentence: The topic sentence is like the headline of your paragraph. It introduces the main idea or point that the paragraph will discuss. It is a crucial element that guides the reader’s understanding of what’s to come.

b. Supporting Details: Supporting details are sentences or examples that provide evidence or an explanation for the topic sentence. They add depth and context to your main idea.

c. Concluding Sentence: The concluding sentence summarises the paragraph’s main point and often provides a smooth transition to the next paragraph.

5.

The bank manager should have made sure that the following points are kept in mind while conveying information:

a. The message should be communicated in simple, clear, and easy-comprehend language. b. There should be no scope for incomplete information and ambiguity. Information shared should be complete in every way. c.

If the information or message has to travel to multiple employees, it should be communicated formally through an email,

a notice, or in a formal gathering.

d. It is advisable to take feedback to ensure that the message is communicated clearly, with no confusion.

Unit 1: Communication Skills-II

467


Unit 2: Self-Management Skills-II

Answer Key A. 1.

d

2.

a

3.

B. 1.

goals

2.

self-regulation

C. 1.

True.

c

4. 3.

a

5.

b

Self-management

4.

Extrinsic

5.

endorphins.

2.

False. Stress is an automatic physical, mental, and emotional response to a challenging and difficult event.

3.

False. Independent workers are very determined about work and set their own goals.

4.

False. Stress can have a negative impact on our physical and mental health.

5.

True.

D. 1.

Intrinsic self-motivation is the drive that comes from inside to achieve a specific goal by working very hard and putting in a

lot of effort. This usually consists of a profession or a hobby that a person enjoys and does not feel burdened by performing it. In this, finishing a task is more satisfying than succeeding at it. This motivation comes from within, and the person is not bothered with the benefits or compliments that come with it. For example: You enjoy music; therefore, you finish all the

assignments for the music lessons quickly. 2.

Self-motivation refers to the internal drive and determination that inspires an individual to take an action, achieve goals, and

put efforts even when faced with challenges or obstacles. Rashika can stay motivated by following these tips:

a. Establishing healthy habits for progressing toward her objectives. b. Setting SMART (Specific, Measurable, Achievable, Relevant, and Time-bound) goals. She should work on priorities and stay away from any obstructions.

c.

Self-evaluation is crucial in determining one’s development, flaws, and strengths. She can evaluate her work.

d. She can develop time-management skills and maintain a healthy lifestyle. 3.

Yoga helps in managing stress by:

a. Yoga’s different physical postures, meditation, breathing exercises, and relaxation techniques are very useful in reducing stress.

b. The yoga exercises that focus on slow movement, stretching, and deep breathing are the best for lowering your anxiety and stress levels.

c.

It can reduce stress hormones and relax your mind to help you sleep better.

d. Yoga promotes self-care and helps in keeping your emotions in control. It ensures more energy, a sense of happiness, and brighter moods.

E. 1.

Public Self-awareness

Private Self-awareness

When you are conscious of how you are perceived publicly by

When you are conscious of how you behave about certain

awareness. Some people behave in a certain manner which

have developed private self-awareness. In this type of self-

other individuals or society, you have developed public selfis acceptable in the society as they are aware that they are being evaluated by other people.

Example: Putting up your hand in the class to respond to the teacher’s question is a sign that you want everyone to see

that you know the answer.

468

things or situations and how it will impact others, you

awareness, you are able to notice and examine your own thoughts, feelings, and motivations.

Example: When you become conscious that you have

broken something even though no one else has noticed.


2.

Stress management refers to the numerous strategies, plans, techniques and tactics used to manage and diminish the

negative impact of stress on one’s physical, emotional, and psychological health. Various stress management techniques that we can follow are:

a. Physical Exercise: It includes all the activities that help an individual to maintain physical fitness, enhance mental well-

b. Yoga: The yoga exercises that focus on slow movement, stretching, and deep breathing are the best for lowering your

being, and help improve their sleep.

anxiety and stress levels. It should be a part of your daily schedule so that it can have a positive impact, both physically and mentally.

c. Meditation: A person’s life becomes more peaceful and balanced after practicing meditation. It has several advantages

d. Enjoying: Enjoyable activities are a great approach to enhance your mental health and general well-being. One should

and has worked miracles for many people.

take out time for their favourite pastimes, events, and activities.

3.

The ability to work independently means being capable of completing tasks and responsibilities on your own, without

needing constant guidance from others. It means that you have to make your own decisions and organise your work properly because only you are accountable for it. It will increase your confidence and self-esteem. Working independently is significant because: a. Boosts Confidence: Working individually without any other support, boosts the confidence of an individual.

b. Improves Decision Making Skills: An independent worker needs to take all the important decisions on their own to

c.

d. Makes You More Accountable: If you are working without any team, then you are responsible for both accurate and

e.

Increases Self-esteem: When people accomplish a goal on their own, it boosts their self-esteem.

f.

Time Management: Working independently also teaches you a very important skill – time management.

F.

keep moving ahead. This helps in building decision-making skills in an individual.

Brings Out the Best In a Person: If you work alone, then you put more efforts to make your work stand out. inaccurate outcomes.

1. Sakshi can motivate herself to work by the following steps:

a. Setting New Goals: Sakshi needs to set new goals for herself so that she does not find her job monotonous and starts

b. Maintaining a Positive Mindset: She needs to remind herself of the importance of her role and how she contributed

c. Time Management: She needs to prioritise her tasks, manage her time, and complete her assignments on time. As a

2.

working towards them.

to the company’s success. This will help her to stay motivated. result, she will have more time for herself.

As a true friend, I will explain to Jay about the importance and need for stress- management. I shall highlight the benefits

listed below:

a. Improved Physical Health: Stress can lead to high blood pressure, cholesterol, obesity, and other lifestyle diseases. Jay

b. Improved Mental Health: Apart from physical health, stress will have an equal amount of negative impact on Jay’s

c. Enhanced Productivity: Excessive stress decreases one’s productivity as it leads to distraction and reduction in focus.

d. Quality of Life and Relationships: Destressing leads to improved communication and a better lifestyle, thus improving

e. Emotional Regulation and Adaptability: Stress management helps in regulating one’s emotions and adapting to a

has to manage his stress to remain physically fit.

mental health and can lead to depression, anxiety, and other related issues. Stress management can make him more productive.

the quality of Jay’s life and his relationships. He will be less irritable.

changing environment. It will enhance Jay’s performance as he will be able to control his emotions better.

Unit 2: Self-Management Skills-II

469


Unit 3: Information and Communication Technology Skills-II

Answer Key A. 1.

b

2.

a

3.

d

4.

b

5.

d

B. 1.

delete

2.

Icons

3.

Computer Viruses

4.

Taskbar

C. 1.

True.

2.

False. To rename a file, right-click on the file or the folder, choose the Rename option from the context menu.

3.

True.

4.

False. Email services have a Filter feature to stop the spam messages from reaching your mail inbox.

D. 1.

Computers are complex devices with many delicate electronic components that require protection from dust and potential

damage. Neglecting their maintenance can result in reduced efficiency. Considering the expense associated with repairing computers and mobile phones and to ensure their smooth operation, it becomes essential to take consistent and vigilant care of them.

2.

Multi-user Operating System Multi-user operating systems enable multiple users to

These operating systems were designed to accommodate

Example: Linux, Unix, and various versions of Microsoft

Example: Microsoft Windows 3.1,

utilise the same computer, simultaneously. Windows. 3.

Single-user Operating System just one user performing a single task at a time. Microsoft Windows 95, and Microsoft DOS.

Managing files and folders is important because:

• Organisation: Proper file and folder management helps you keep your digital life organised. When files are well-

• Efficiency: An organised file structure boosts productivity. You can work more efficiently because you know where to

• Preventing Data Loss: Good file management reduces the risk of losing important data. When you organise files

organised, you can quickly find what you need without wasting time searching.

locate your documents, photos, or projects. This reduces frustration and helps you complete tasks faster.

into folders and regularly back up your files, you have a safety net in case of computer crashes, hardware failures, or accidental deletions.

E. 1.

Functions of an operating system are:

• Processor Management: The operating system oversees the functioning of the processor by assigning tasks to it and

• Memory Management: The operating system handles the distribution of internal memory (like RAM, cache, etc.) among

• Device Management: An operating system controls the operation of input and output devices, receiving their requests,

• File Management: The operating system maintains organized records of file actions, such as creation, deletion, transfer,

• Security: An operating system employs various techniques to safeguard user’s data confidentiality and integrity, typically

• Error Detection: The operating system periodically checks for external threats, malicious software, and hardware issues

470

ensuring that each process and application gets sufficient time for proper operation. various applications to ensure smooth execution of each process.

performing specific tasks, and communicating with requesting processes.

copying, and storage. It also preserves data integrity and directory structures. involving usernames, passwords, and firewalls. and alerting users when necessary.


2.

Computer Virus A computer virus is a program or set of programs that interrupts a computer’s normal functioning and can infect or destroy

data. It enters a computer without the user’s permission or knowledge through infected storage devices, like CDs or pen drives, and can even enter while browsing the internet. To avoid detection, these viruses hide silently. They can remain undetected and inactive for a long time, waiting for a specific signal or event to activate them.

Harms Caused by a Computer Virus: If your computer is attacked by a virus, it can affect your computer in the following ways:

•

Decreases the speed of the computer

•

Damages or deletes files

•

Displays strange messages

•

Leads to the formatting of the hard disk

•

Leads to frequent computer crashes

•

Leads to the loss of data

3.

Feature Definition

Purpose

Function

Example

Usage

F.

1.

Menu

Icons

Taskbar

A digital menu card for your

Tiny pictures or symbols

A bar usually at the bottom

options.

folders on your screen.

manage open programs.

computer’s programs and

Helps you find and open

programs and options easily. Lists all available programs and options on your computer.

Imagine that it is like a restaurant

menu, showing all the dishes you can order.

representing programs, files, or

Visual shortcuts for quick

access to programs and files. Represents programs, files, or folders visually.

Think of them as road signs on

your computer screen that help you find what you need.

of your screen that helps to Manages open programs and allows you to switch between them quickly.

Displays icons for open

programs and provides quick access to them.

It is like having a personal

assistant on your computer desk, keeping things organized.

You use it to open programs

Click on the icons to open

Helps you switch between

functions.

without reading long names.

you are working on.

and access various computer

programs, files, or folders

different tasks or programs

In order to avoid any type of computer virus, Smita needs to:

• Use Security Software: Install a trustworthy antivirus software and keep it updated. Regularly scan and identify

•

• Be Cautious Online: Exercise caution when sharing information online. Use secure websites for financial transactions,

•

Update Software: Keep her computer’s software and applications up-date to patch security vulnerabilities.

•

Beware of Spam: Delete emails from unknown sources without opening them or downloading attachments.

•

Backup Your Data: Regularly back up her data for protection against loss and use encryption software to secure it.

•

Scan Portable Devices: Before using USB drives or other portable storage devices, scan them for viruses.

•

Disable Cookies: To protect her personal information, consider disabling cookies in her web browser.

potential threats.

Employ Firewalls: Configure her web browser settings to block access to unwanted websites. avoid saving personal data on websites, and restrict herself from downloading software from unauthorized sources.

Unit 3: Information and Communication Technology Skills-II

471


2.

To create a new file on Mukesh’s desktop, he has to follow these steps:

1.

Right-click on an empty area.

2.

From the menu that appears, choose the ‘New’ option. He will then see a list of file types and applications, like MS Excel,

3.

472

MS Word, LibreOffice Writer, or any other application. Pick the one he needs.

Enter a file name where the cursor is and press Enter, and a new file will be generated.


Unit 4: Entrepreneurial Skills-II

Answer Key A. 1.

b.

2.

a.

3.

d.

4.

d.

5.

c.

B. 1.

Make in India

2.

competition

3.

entrepreneurial

C. 1.

True.

4. internet

2. False. Atal Innovation Mission (AIM) which was launched in 2016, focuses on promoting innovation and entrepreneurship among students and start-ups.

3.

False. Whether big or small, every business owner is an entrepreneur.

4.

True.

D. 1.

Relationship between entrepreneurship and the society:

• Entrepreneurship and society have a direct relationship. In order to build a business, an entrepreneur requires the support of the community, and the community depends on entrepreneurs to identify its issues and provide solutions in the form of ideas, goods, and services.

• The relationship between entrepreneurship and society is dynamic and very powerful. The act of creating and pursuing opportunities through entrepreneurship has significant impacts on many sectors of society.

• By creating job possibilities, they aid in the nation’s economic growth, which in turn promotes social advancements. 2. Entrepreneurs are deeply passionate about their work. They are not motivated only by money or other materialistic gains. They also love what they do and are willing to work hard and dedicate extra hours to make their business successful. If a

person follows their passion, then they don’t feel burdened while working and are instead more motivated to bring the final product in the market.

For example, the founder and CEO of MDH, an Indian spice producer, was Mahashay Dharampal Gulati. His love for creating and experimenting with spices propelled him to create a global brand and now, his company’s spices are used in many homes across the world. 3.

Two government initiatives to promote entrepreneurship in India are:

a. Mudra Yojana: The Pradhan Mantri Mudra Yojana (PMMY) was initiated to provide financial support to small businesses and micro-enterprises. It offers loans at different stages of business development, from startup to growth, and expansion.

b. National Entrepreneurship Development Program (NEDP): The NEDP, run by various agencies including the Ministry of Skill Development and Entrepreneurship, offers training and skill development programs to aspiring entrepreneurs.

E. 1. Entrepreneurship is the process of transforming an idea into a big business enterprise by identifying an opportunity and

creating a market through thorough planning and management skills, typically with the goal of achieving financial profitability and long-term success. An entrepreneur:

a. Helps in Wealth Creation: Successful entrepreneurs have the potential to accumulate wealth, which can be reinvested in their businesses or new businesses. This can result in the creation of more jobs, stimulating economic activities, and benefiting the community.

b. Adds to the National Income: Entrepreneurs drive economic growth by identifying and grabbing opportunities,

introducing innovative products and services, and contributing to increased productivity. They contribute to the national income by earning revenue and paying taxes.

Unit 4: Entrepreneurial Skills-II

473


c. Creates Employment Opportunities: Entrepreneurs are significant job creators. They start and expand businesses, which in turn leads to hiring of employees and thus, they reduce unemployment and stimulate economic activities.

d. Improve the Standard of Living: Entrepreneurs enhance the standard of living by introducing products or services that enhance convenience. They help in improving the standard of living not just by providing income to families

through job opportunities, but also by fostering new products and services that enhance the living standard of all the stakeholders.

e. Creates Social Change: Social change denotes significant alterations in societal norms, behaviours, or structures. Entrepreneurs drive social change by introducing innovations that challenge existing practices.

f. Helps in Community Development: Community development refers to initiatives aimed at enhancing the wellbeing of a local community. Entrepreneurs contribute by supporting local causes, schools, and charities.

2. ‘You need a lot of money to become a successful entrepreneur.’ According to me, this statement is a myth because not every business requires a substantial amount of money or capital at the beginning. There are start-ups that began with very little funds and have now achieved a lot of success. Typically, a significant sum of money that is required to launch a business, is

used to cover the costs of renting office spaces, purchasing supplies, paying employees, and other necessities. However, not every business begins in a large office space; some of them begins in a single room of a house.

For example, Reshma is a talented tailor who can sew any style of outfit by simply looking at the picture. With the use of the internet, Reshma set up her own webpage where she sold custom-made designer outfits and began accepting requests

to design more of such dresses. She gradually launched her own fashion business and used the money she made to buy a design studio. She became an entrepreneur without any external financing.

Successful entrepreneurs often begin with innovative ideas and skills. If an entrepreneur has a ground-breaking concept, a

unique product or service, or a valuable skill set, they can attract investors or secure loans even without a significant amount of personal capital. While capital is essential, it is not always the determining factor of success.

3.

An entrepreneur must have the following skills to be successful in the business world:

a. Decision-making: They need to make decisions about the product or service they offer, the policy of production, purchase and sell of the goods and services, and the marketing strategies they employ.

b. Management Control: Entrepreneurs are responsible for managing and controlling their businesses. They are

responsible for overseeing the day-to-day operations of their businesses, ensuring that resources are utilised efficiently, and goals are met.

c. Division of Income: Entrepreneurs need to make arrangements for the division of the total income among different factions of production like rent, interest, purchase of raw material, and so on.

d. Risk-taking: They identify opportunities and are willing to invest time, effort, and resources into pursuing these opportunities, even if success is uncertain.

e. Bearing of Uncertainties: They must make decisions and take actions in the face of uncertainty. Bearing uncertainty

involves making informed judgements, adapting to changing circumstances, and being resilient in the face of setbacks.

f. Innovation: Entrepreneurs are changemakers who drive economic growth, improve quality of life, and shape the future through their innovative efforts.

F.

1.

Latika possesses the following qualities which made her a successful entrepreneur:

a. Passion: Latika is passionate about baking, which led her to start a home-based bakery. Her enthusiasm for creating delicious baked goods is the driving force behind her business.

b. Creativity: She consistently comes up with unique and delicious recipes, showcasing her creativity in baking. This creativity is a key asset for developing new products and attracting customers.

c. Adaptability: Latika started small by selling to friends and family but is now considering expanding her business. Her ability to adapt to changing circumstances and explore new avenues for growth is a valuable entrepreneurial trait.

474


d. Risk-Taking: Starting a home-based bakery business involves a significant degree of risk. Latika took the initiative to turn her passion into a business venture, demonstrating her willingness to take calculated risks.

e. Persistence: Entrepreneurship often comes with challenges and setbacks. Latika’s determination to continue baking and grow her business despite obstacles shows her persistence.

2. The Indian government has implemented several schemes and initiatives to support entrepreneurs. These schemes aim to provide financial assistance, promote innovation, and facilitate the growth of businesses.

a. Atal Innovation Mission (AIM): Launched in 2016, it focuses on promoting innovation and entrepreneurship among students and start-ups. It includes initiatives, such as Atal Tinkering Labs in schools and Atal Incubation Centres, to support start-ups.

b. Startup India: Launched in 2016, it aims to promote entrepreneurship and innovation in the country. It provides various benefits to start-ups, including tax exemptions, funding support, and simplification of regulatory procedures.

c. Make in India: Make in India is a campaign launched in 2014 to encourage manufacturing and production within India. It seeks to transform the country into a global manufacturing hub by promoting ease of doing business, simplifying regulations, and attracting foreign investments.

Unit 4: Entrepreneurial Skills-II

475


Unit 5: Green Skills-II

Answer Key A. 1.

b

B. 1.

social inclusion

C. 1.

False. Reduced chemical use and biodiversity preservation will promote the health of soil.

2.

2.

c

3. 2.

a

4.

biodiversity

d

5.

d

3. United Nations

4.

environment

True.

3. False. Developed countries can provide financial and technical assistance to developing nations to support their sustainable development efforts.

4.

True.

D. 1. Sustainable water practices involve conserving water and using it responsibly. This can be achieved through various methods, such as:

a.

Rainwater Harvesting: Rainwater is stored and reused for household consumption and other purposes.

b. Effective Irrigation Practice: Using sprinkler irrigation and drip irrigation methods to control the flow of water across farmlands can help to prevent water loss, which typically results from an excessive water supply.

c.

Fixing Leaks: One common and significant form of water loss is leaking, which results in significant water loss.

Repairing the leaks stop them from occurring again and conserve water.

d. Low-flow Fixtures: It is a water-saving plumbing fixture created to reduce the water flow rate in order to save water. Showerheads and toilets with low-flow fixtures use a lot less water.

2. Sustainable development is about improving the quality of life for all individuals. It involves creating a world where future

generations can look forward to a better future, safe environment to live in, clean water to drink, and clean air to breathe.

a. Everyone gets the opportunity to live a decent life and have access to natural resources. b. It ensures economic growth and prosperity to improve the standard of living, create job opportunities, and reduce poverty.

c. 3.

Preserves biodiversity, protects ecosystems, and reduces pollution to maintain the health of the planet for current and

future generations.

Different ways to follow the sustainable practice of ‘reduce, reuse, and recycle’ at home are:

a. We can reduce the amount of plastic by using reusable cloth bags for shopping, instead of plastic bags. b. Reduce food wastage by planning meals and storing food properly. Use reusable containers to store food instead of disposable ones.

c.

Get creative and find new uses for old items. We can reuse glass bottles and old clothes to make flower pots and dusting

clothes, respectively.

d. Set up a recycling station at home to separate recyclable materials from regular trash. Support the recycling industry by purchasing products from recycled materials.

E. 1.

Three main pillars of sustainable development are: Environmental: It is about preserving and protecting the environment. It involves conserving energy, cutting back on waste

and pollution, utilising natural resources wisely, and protecting biodiversity.

Economic: This means using assets and resources wisely and efficiently to ensure economic growth and produce operational

profit. It aims to improve the standard of living of the public. The resources should be used responsibly to meet the goals of development and build a competitive economy.

476


Social: It’s all about looking out for people. Making sure that the general population is secure, healthy, and treated fairly is a

part of it. It also includes being welcoming and inclusive of individuals from various social and cultural backgrounds. 2.

Sustainable practices are the actionable steps we take to achieve the objectives of sustainable development. Following are the sustainable practices: a.

Conservation of Water: Sustainable water practices call for resposible water use and the reduction of waste. This can

be accomplished by using effective irrigation techniques, rapidly repairing leaks, and installing low-flow fixtures.

b. Energy Efficiency: Sustainable practices are based on the principle of using energy more effectively. It includes

measures, such as improving lighting systems, insulating buildings, and purchasing energy-efficient appliances. We can lessen our carbon footprint and energy costs by consuming less energy.

c.

Sustainable Transportation: Reducing greenhouse gas emissions and reducing traffic congestion are achieved

by choosing environmentally-friendly means of transportation, including walking, bicycling, carpooling, or public transportation.

d. Sustainable Agriculture: Sustainable agriculture methods prioritise biodiversity, improve soil health, and use fewer chemicals.

e. 3.

Reduce, Reuse, Recycle: Reducing waste at the source, reusing items whenever possible, and recycling materials are

fundamental practices that conserve resources and reduce landfill waste.

Sustainable development faces challenges because it calls for resources, focused efforts, and a change in society’s mind-set.

Following are the two problems related to sustainable development: a.

Limited Resources: The lack of essential resources is one of the biggest problems. Freshwater, land, and energy

resources are under more stress as the world’s population continues to rise. We must carefully manage these resources for sustainable development, which often requires innovation and conservation measures.

b. Short-Term vs. Long-Term Interests: Balancing short-term economic interests with long-term sustainability goals can

be challenging. Some policies and practices prioritise immediate gains over the well-being of future generations, making it crucial to shift this mind-set.

c.

Global Cooperation: Many sustainability challenges are global in nature, such as climate change. Addressing these

issues requires cooperation among countries, which can be complicated because of differing priorities and interests.

d. Lack of Awareness: The importance of sustainable development and its effects are not fully understood by everyone. Community awareness building and education regarding the importance of sustainable living are on-going challenges.

F.

1.

Rakesh can take several steps to change his means of transportation and promote sustainable development: a.

Carpooling: Rakesh can explore carpooling options with colleagues or neighbours who have a similar route. This would

reduce the number of vehicles on the road, easing traffic congestion, and lowering carbon emissions per person.

b. Public Transportation: Rakesh can switch to buses, metro, or train for his daily commute. This will support public transport system which is often more sustainable.

c. 2.

Electric or Hybrid Car: Rakesh can switch to an electric or hybrid vehicle. These vehicles produce fewer emissions,

compared to traditional gasoline or diesel cars.

Kanha can adopt the following sustainable agriculture practices to improve the long-term health and productivity of his land: a.

Crop Rotation: Rotate crops to break the cycle of pests and diseases this improve soil fertility, and reduce the need for

chemical pesticides and fertilizers.

b. Organic Farming: Shift to organic farming which avoids synthetic chemicals and instead uses natural inputs, like compost, manure, and biopesticides.

c.

Natural Fertilisers: Natural fertilisers are particularly beneficial for crop growth and are also easy on finances because

they are commonly found in daily life.

Unit 5: Green Skills-II

477


Artificial Intelligence Unit 1: Introduction to Artificial Intelligence Answer Key A. 1. b

2. c

B. 1. data privacy 4. Data Science

3. d

4. b

2. robots

3. Machine Learning

5. b

6. c

5. chatbot or virtual assistant

C. 1. True. 2. True. 3. True. 4. False. Wordtune is an AI-powered writing assistant based on NLP. 5. True. D. 1. Streaming services like Netflix and music platforms like Spotify use AI algorithms to analyse our preferences. They recommend films, shows, or songs based on the time spent watching or listening to certain types of content, frequently played songs, and feedback given through ratings, making content suggestions as per the user’s preferences. 2. A fully automatic washing machine can work on its own, but it requires human intervention to select the parameters of washing and to do the necessary preparation for it to function correctly before each wash, which makes it an example of automation, not AI. 3. Some companies use AI to screen job applicants. However, these algorithms can inherit biases from historical hiring data. For instance, if a company has historically favoured male candidates for technical roles, AI might continue this trend, disadvantaging female applicants. This perpetuates gender bias. E. 1. A potential concern regarding young children using cutting-edge technology is that overindulgence in such tools could hinder their ability to develop critical thinking and problem-solving skills. For example, relying heavily on AI-driven apps for tasks like essay writing or instructional games could make them less capable of solving basic problems on their own and affect their cognitive development.

2. Computer vision is an important domain of AI which uses cameras to see and understand visual information. Two applications of computer vision are:

478

• Autonomous Vehicles: Computer vision enables vehicles to perceive and understand their surroundings, identifying objects like pedestrians, traffic signs, and other vehicles to navigate autonomously. • Security and Surveillance: Video surveillance systems use computer vision to monitor environments in real-time, detecting suspicious activities, recognising faces, and alerting authorities to potential threats.


3. The differences between artificial intelligence, machine learning, and deep learning are as follows: Aspect Definition

Artificial Intelligence (AI)

Example

Components

Deep Learning (DL)

Study of principles and

A subset of AI that enables

A subset of machine learning

machines that can think, act,

through experience.

using neural networks.

technology for building and learn like humans.

Functionality

Machine Learning (ML)

machines to improve at a task

that processes information

Machines should mimic human Machines learn from data to

Machines process vast

predicting outcomes

human brain for tasks like

traits like decision-making and

make accurate predictions or decisions.

amounts of data to mimic the object detection.

Self-driving cars use various

Algorithms in self-driving cars

Deep learning in self-driving

like driving.

traffic behaviour.

detection and lane detection.

components to mimic human-

analyse data to learn about

cars for tasks like object

Integrates sensors, cameras,

It uses data from sensors

Employs neural networks

algorithms.

improvement.

recognition and translation.

GPS, and decision-making

and cameras for learning and

for complex tasks such as

F. 1. To remain relevant in the changing job market impacted by AI, Neelanjali should consider acquiring new skills and adapting to the evolving job demands to avoid being at risk of job loss. 2. Moral Machine

Unit 1 • Introduction to Artificial Intelligence

479


Unit 2: AI Project Cycle

Answer Key A. 1. a

2. b

3. d

B. 1. Sustainable Development Goals (SDGs) 4. AI project cycle

4. b

5. c

2. Testing

3. Data

5. Neural network

C. 1. False. In supervised machine learning, the developers are familiar with the data. 2. False. Data visualisation allows us to spot trends and patterns that might not be evident in raw data. 3. True. 4. True. 5. True. D. 1. Modelling is the process of creating various AI models based on visualised data from the Data Exploration stage of the AI project cycle, enabling predictions and conclusions. 2. Sustainable Development Goals (SDGs), which are often referred to as ‘Global Goals’, are a set of 17 goals adopted by the United Nations General Assembly in September 2015 to meet the needs of the world’s citizens without compromising the planet’s resources. The goal is to achieve these objectives by the end of 2030. 3. Sensors are devices that collect real-time information and transform it into digital data, which can be analysed by computers. For instance, a heart rate monitor worn on a wristband tracks a person’s heart rate and converts it into digital data. 4. i. Scatter plot ii. 90 marks E. 1. Data visualisation is important because it:

• Simplifies Complex data: Data visualisation transforms complex data into simple visuals, making it easier to interpret large datasets quickly. It also helps extract insights from the data that may not be apparent from raw numbers.

• Identifies trends and patterns: Data visualisation allows us to spot trends, patterns, and relationships that might not be evident in raw data. • Facilitates Decision-making: It helps decision-makers in making informed decisions based on clear and understandable visual data. It aids in proactive decision-making by highlighting potential risks and opportunities. • Aids in effective communication: Data visualisation techniques are more engaging and effective for communicating data insights to a wider audience.

480


2. The following are the components of a neural network:

i. Neurons: Neurons are small decision-making nodes. Each neuron takes some information, processes it, and passes it on. ii. Layers: There are three types of layers in a neural network:

• Input Layer: This is the layer where the neural network receives information. For example, if you are teaching a neural network to recognise images of birds, the input layer receives the value of the pixels of the images here. • Hidden Layers: These are intermediate layers between the input and output layers. These layers perform a lot of calculations to identify patterns and details. In a neural network, there can be many hidden layers.

• Output Layer: This layer produces the output of the neural network. For example, it may say “yes, this is a bird” or “no, this is not a bird”.

iii. Weights and Biases: Weights can be designated as important levels. Each layer consists of many numbers of nodes called neurons connected with the nodes of other layers. Each connection between these neurons is assigned a weight that shows the importance of the connection. iv. Activation Function: After processing the inputs, the neuron sends the result through an activation function which assists the network in learning complex patterns. 3. The learning-based AI empowers systems to learn patterns and make decisions from data without defining rules. These approaches rely on the large datasets. The major feature of a learning-based approach is that the model updates itself with changes in the data, allowing it to improve its performance over time and adapt to new and unseen patterns. For example, you have a dataset of 100 images of cats and dogs. The images showing cats are labelled as “cat”, and the images showing dogs are labelled as “dog”. An AI model is trained with this dataset, and the model is programmed so that it can distinguish between images of a cat and a dog based on the various features of cats and dogs. Once the model is trained with the dataset, a testing dataset is fed to the model. The testing dataset may contain images of cats and dogs that are not exactly similar to the images with which the model is trained. But a learning-based AI model adapts itself to the features of a new image and predicts if the image is of a cat or a dog. F. 1. Pie chart 2. The data collected from the survey can help the AI system by identifying areas for improvement and help it suggest personalised recommendations based on consumer preferences and satisfaction.

Unit 2 • AI Project Cycle

481


Unit 3: Advance Python (To be assessed through Practicals) Answer Key A. 1. c

2. c

3. b

4. b

5. b

B. 1. faster

2. skip

3. indentation

4. changed

5. reverse

C. 1. True 2. False. The replace() function cannot modify a string directly. The replace() function returns a new string with the specified replacements, and the original string remains unchanged. 3. True 4. False. Lists can store different types of elements. 5. True D. 1. You can use the slicing operator to extract a substring in Python by specifying the start and the end indices in the format string[start:end]. For example, string[2:5] extracts the substring from index 2 to index 4. 2. The simplest method to install and use Jupyter Notebook is by using Anaconda. Anaconda is a free and opensource environment for writing and executing Python programs. It offers a significant benefit because it includes numerous pre-installed packages often used in machine learning and data science. 3. DataFrame is a fundamental data structure in Pandas. It represents a two-dimensional and tabular data structure with labelled axes (rows and columns). DataFrames are commonly used for data analysis and manipulation. 4. The output of the code is: 2 E. 1. Code:

sentence = 'Learning Python is fun!'

new_sentence = sentence.replace('fun', 'awesome')

print(new_sentence) Output: Learning Python is awesome! 2. The term “NumPy” is an abbreviation for “Numerical Python”. NumPy is a commonly used package for working with numbers. It provides support for arrays and matrices, along with a collection of mathematical functions to operate on them efficiently. It has built-in mathematical tools that make calculations easy.

482


3.

Lists

Tuples

Lists are mutable.

Tuples are immutable.

You can easily insert or delete data items in a list.

You cannot directly insert or delete data items in a tuple.

Lists have several built-in methods.

Due to immutability, a tuple does not have many built-in

Lists are generally slower than tuples because of their

Tuples are faster than lists.

Lists are created using square brackets [].

Tuples are created using parentheses ().

Example: list1 = [1, 2, 3]

Example: tuple1 = (1, 2, 3)

mutability.

methods.

4. pop(): This method is used to remove the element at the specified position. Syntax: list.pop(position)

For example, remove the third element from the list = [5, 2, 7, 5, 8, 5, 1].

[Hint: The third element has an index 2.]

Code:

list = [5, 2, 7, 5, 8, 5, 1]

list.pop(2) print(list) Output: [5, 2, 5, 8, 5, 1] remove(): This method is used to remove the first occurrence of the specified element. Syntax: list.remove(element)

For example, remove 5 from the list = [5, 2, 7, 5, 8, 5, 1]. Code:

list = [5, 2, 7, 5, 8, 5, 1]

list.remove(5) print(list) Output:

[2, 7, 5, 8, 5, 1]

F. 1. Code:

Stu_list = ['Lata', 'Rama', 'Ankit', 'Vishal']

Stu_list.append('Sushma') print(Stu_list) Output: ['Lata', 'Rama', 'Ankit', 'Vishal', 'Sushma']

Unit 3 • Advance Python (To be assessed through Practicals)

483


2. Code:

str1 = 'Hello'

str2 = 'World'

result = str1 + str2

print(result) Output: HelloWorld 3. The error is that the input() function returns values as strings, so when num1 and num2 are added, they will be concatenated as strings rather than summed as integers. To fix this, you need to convert the input values to integers (or floats) before adding them. Corrected Code:

num1 = int(input("Enter first number: "))

num2 = int(input("Enter second number: "))

result = num1 + num2

print("The sum is:", result)

4. The output of the program is:

484

The squares are: [1, 4, 9, 16, 25]


Unit 4: Data Sciences

Answer Key A. 1. c

2. b

3. c

4. d

5. a

B. 1. 8

2. histogram

3. four

4. KNN

5. median

C. 1. True. 2. True. 3. False. AI modelling refers to developing AI models to get intelligent outputs after training the model. 4. True. 5. True. D. 1. x = '10'

y=5

result = int(x) + y # Convert x to an integer before adding

print(result) 2. import pandas as pd df=pd.read_csv('data.csv') print(df.head(5)) 3. 20.0 17.5 15.0 12.5 10.0 7.5 5.0 2.5

2

Unit 4 • Data Sciences

4

6

8

10

12

485


E. 1.

NumPy Arrays

Lists

Numpy arrays store homogeneous (same type)

Lists can store heterogeneous (different types)

It takes less memory space.

It takes more memory space.

Numpy arrays support multi-dimensional arrays.

Lists support only one-dimensional arrays.

The size of the array is fixed once it has been

The list can be resized (by adding or deleting

It is suitable for numerical computations, data

It is suitable for general-purpose programming.

data.

created.

analysis, machine learning, and tasks involving

data.

elements).

large datasets.

Direct numerical operations can be done. For

Direct numerical operations are not possible. For

every element by 4.

every element by 4.

example, dividing the whole array by 4 divides

example, dividing the whole list by 4 cannot divide

Example: To create an array:

Example: To create a list:

import numpy

A = [1,2,3,4,5]

A=numpy.array([1,2,3,4,5])

2. a. import numpy as np np.full((3,3),5) b. import numpy as np np.zeros((2,3)) 3. Data Exploration

Problem Scoping

Data Acquisition

Evaluation

Modelling

1. Problem Scoping: Understanding and identifying a problem and having some ideas and vision to find a solution to the problem. 2. Data Acquisition: Acquisition denotes the process of gathering or obtaining the data from identified sources. 3. Data Exploration: It is the stage where we can analyse the data and visualise it in a user-friendly format so that we can understand it better.

486


4. Modelling: AI modelling refers to developing AI models for getting intelligent outputs after training the model. 5. Evaluation: In this phase of the AI project cycle, you test the model in many ways to check for accuracy. This stage of testing the models is known as evaluation. Once the model is performing accurately, it is then deployed to the production environment, where it can start solving real-world problems. F. 1. Values

Values

Time

Underfitted Fig. a

Time

Good Fit/Robust Fig. b

Figure a: The model’s predicted values do not match the actual values at all. Hence, the model is said to be underfitting as its accuracy is lower. Figure b: In the second one, the model’s predicted values match well with the actual values. This means that the model is performing accurately, and the model is called a perfect fit. 2. This code displays current date and time.

Unit 4 • Data Sciences

487


Unit 5: Computer Vision

Answer Key A. 1. c

2. b

B. 1. object detection

3. b

4. c

5. d

2. ReLU layer

3. convolution

4. white

5. OpenCV C. 1. True. 2. False. The convolution layer is responsible for extracting features. 3. True. 4. False. The imread() function is used to read an image from a file. 5. False. The input layer receives raw data, such as images. D. 1. Pixel values in a grayscale image range from 0 to 255 and represent varying shades of grey, where 0 is black, 255 is white, and values in between represent different shades of grey. 2. The pooling layer reduces the spatial dimensions of the input feature maps, decreasing computational complexity and controlling overfitting by retaining the most relevant features. 3. CNNs automatically learn and identify important features in images, such as edges and textures, without requiring manual feature extraction, making them effective and efficient for image classification tasks. E. 1. Convolution involves multiplying an image array element-by-element with a smaller grid called the kernel to produce a new array called the feature map. In CNNs, convolution is used to detect various features in images, such as edges and textures. The process helps in feature extraction by applying multiple kernels to generate feature maps that represent different aspects of the image. This allows CNNs to automatically learn and recognise complex patterns and structures within images, enhancing their ability to perform tasks like object detection and image classification. 2. The fully connected layer integrates the features learnt by the previous convolutional and pooling layers and performs classification based on these features. After flattening the output from the last convolutional or pooling layer into a 1D vector, the fully connected layer assigns probabilities to different classes based on the learnt features. Each neuron in the fully connected layer is connected to every neuron in the previous layer, forming a dense matrix of weights. This layer is crucial for making final predictions and classifying images based on the extracted features. 3. Coloured images are composed of three primary colours: red, green, and blue, collectively known as RGB. In an RGB image, each pixel is essentially a mix of red, green, and blue components. By adjusting the intensity of these components, a wide range of colours can be created. For instance, when all three colours are combined at their maximum intensity, the result is white. Conversely, when they are all at zero intensity, the result is black. By fine-tuning the individual levels of red, green, and blue, virtually any colour can be achieved, enabling the rich and varied visual experiences that digital images provide.

488


4. Three applications of computer vision are: i. Facial Recognition: Computer vision technology analyses the distinct details of your face, such as the arrangement of your eyes, nose, and mouth. This is how computer vision plays an important role in facial recognition, making our devices smarter and more user-friendly. ii. Retail Industry: The shopping cart’s sensors can easily perform object identification of the items in the cart and match the details in the database using computer vision. Computer vision also helps with quicker checkouts at the mall exit, locating misplaced items, checking shoplifting, minimising billing errors, etc. iii. Autonomous Vehicles: Computer vision plays a critical role in the development of autonomous vehicles. It allows these vehicles to ‘see’ and understand their surroundings, enabling them to navigate safely and efficiently. F. 1. Nina can use instance segmentation to segment each region of interest in medical scans and assign labels to each pixel. This detailed segmentation allows for precise identification and measurement of different diseases by clearly outlining their boundaries and distinguishing them from other structures in the image. 2. Raj’s computer vision system should identify features such as text, signatures, watermarks, and document layout to effectively detect and prevent fraud. 3. The blue patch is a flat area and difficult to find and track. Wherever you move the blue patch it looks the same. Therefore, the blue patch is a bad feature of the image. The black patch has an edge. Moved along the edge (parallel to edge), it looks the same. The red patch is a corner. Wherever you move the patch, it looks different, therefore it is unique. Hence, corners are considered to be good features in an image.

Unit 5 • Computer Vision

489


Unit 6: Natural Language Processing

Answer Key A. 1. b

2. c

3. b

4. d

5. d

B. 1. NLP

2. Sentiment

3. syntax

4. Natural Language Toolkit

5. problem scoping C. 1. False. NLP is a domain of AI that deals with both spoken and written language interactions between humans and machines. 2. True. 3. False. The data acquisition stage involves gathering and preparing data for training the AI model. 4. True. 5. True. D. 1. Part-of-speech tagging helps NLP algorithms by identifying the grammatical roles of words in a sentence (e.g., noun, verb, adjective). This information is essential for understanding the sentence structure and meaning, enabling more accurate processing of language. 2. The names of four applications of NLP are chatbots, virtual assistants, sentiment analysis, and automatic summarisation. 3. Lemmatisation is an NLP technique that involves reducing words to their base or root form, considering the meaning of the word. It ensures that the resulting word, known as the lemma, has a meaningful form. E. 1. The full form of TFIDF is Term Frequency and Inverse Document Frequency

i. Term frequency: It measures how often a word appears in a single document. You can easily find this using the document vector table, which lists how many times each word from the vocabulary appears in each document. Document 1: We are going to Mumbai

Document 2: Mumbai is a famous place.

Document 3: We are going to a famous place. Document 4: I am famous in Mumbai.

490

we

are

going

to

Mumbai

is

a

famous

place

I

am

in

1

1

1

1

1

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

1

0

0

0

1

1

1

1

0

0

1

1

1

0

0

0

0

0

0

0

1

0

0

1

0

1

1

1


ii. Inverse document frequency

The second part of TFIDF is known as Inverse Document Frequency. Document frequency refers to the number of different documents that contain a particular word, regardless of how often the word appears in each document. The vocabulary’s document frequency would be as follows: we

are

going

to

Mumbai

is

a

famous

place

I

am

In

2

2

2

2

3

1

2

3

2

1

1

1

For inverse document frequency, we need to put the document frequency in the denominator, and the total number of documents should be in the numerator. Since there are four documents in total in this case, the inverse document frequency is as follows:

we

are

going

to

Mumbai

is

a

famous

place

I

am

In

4/2

4/2

4/2

4/2

4/3

4/1

4/2

4/3

4/2

4/1

4/1

4/1

The TFIDF formula for any word W is as follows: TFIDF(W) = TF(W) * log(IDF(W))

Log is to the base of 10 in this case.

Multiplying each row in the document vector table by the IDF values, we get the following: we

are

going

to

Mumbai

is

a

famous

place

I

am

in

1*log(2) 1*log(2) 1*log(2) 1*log(2) 1*log(4/3) 0*log(4) 0*log(2) 0*log(4/3) 0*log(2) 0*log(4) 0*log(4) 0*log(4) 0*log(2) 0*log(2) 0*log(2) 0*log(2) 1*log(4/3) 1*log(4) 1*log(2) 1*log(4/3) 1*log(2) 0*log(4) 0*log(4) 0*log(4) 1*log(2) 1*log(2) 1*log(2) 1*log(2) 0*log(4/3) 0*log(4) 1*log(2) 1*log(4/3) 1*log(2) 0*log(4) 0*log(4) 0*log(4)

0*log(2) 0*log(2) 0*log(2) 0*log(2) 1*log(4/3) 0*log(4) 0*log(2) 1*log(4/3) 0*log(2) 1*log(4) 1*log(4) 1*log(4) we

are

going

to

Mumbai

is

a

famous

place

I

am

in

0.301

0.301

0.301

0.301

0.125

0

0

0

0

0

0

0

0

0

0

0

0.125

0.602

0.301

0.125

0.301

0

0

0

0.301

0.301

0.301

0.301

0

0

0.301

0.125

0.301

0

0

0

0

0

0

0

0.125

0

0

0.125

0

0.602

0.602

0.602

The words having the highest values are: is, I, am, in. (Since we have a small dataset, even common words like ‘is’ and ‘a’ have relatively high values.) 2. The following are the key steps involved in text normalisation:

Sentence Segmentation

Tokenisation

Removing Stopwords, Special Characters, and Numbers

Lemmatisation

Stemming

Converting Text to a Common case

i. Sentence Segmentation: In sentence segmentation, we break down a large text (corpus) into individual sentences. Each sentence is then treated as a separate piece of data.

Unit 6 • Natural Language Processing

491


ii. Tokenisation: After segmenting the text into sentences, the next step is to divide each sentence into tokens. Tokens refer to individual elements of the sentence, such as words, numbers, and special characters. iii. Removing Stopwords, Special Characters, and Numbers: During data preprocessing, we retain only the most relevant tokens by removing those that don’t contribute meaningfully, such as stopwords, special characters, and unnecessary numbers. Stopwords like “the,” “is,” “an”, “and”, “there”, etc. are crucial for human readability but add little value in computational text analysis. Removing them streamlines the data, allowing focus on words with the most semantic weight. iv. Converting text to common case: After stopword removal, we convert all characters to a standard case, typically lowercase. This ensures that the machine doesn’t treat the same words as different due to variations in letter case.

v. Stemming: In NLP, stemming is a method for refining words to their most basic or root form. Words are stripped of their prefixes and suffixes in order to create a fundamental form called the root word.

vi. Lemmatisation: Lemmatisation is an NLP technique that involves reducing words to their base or root form. Unlike stemming, lemmatisation ensures that the word we get after affix removal (also known as lemma) has a meaning, and hence it takes a longer time to execute than stemming. After normalising text into tokens, the next step is to convert these tokens into numerical values using the bag-of-words algorithm. 3. Here is how NLP plays a pivotal role in enhancing chatbot capabilities:

i. Customer Support: Chatbots are widely used by organisations to provide customer services on websites and social media platforms. These chatbots can address frequently asked questions, assist with troubleshooting, and transfer complex issues to the right team member when needed.

ii. E-commerce Product Recommendations: NLP is used by chatbots to engage in conversations with users in order to understand their preferences and provide personalised product recommendations. iii. Educational Assistance: Chatbots are used in the educational field to provide academic support, such as helping students with homework, providing conceptual explanations, quizzing students, offering study tips, etc. F. 1. Context is important because it helps the NLP model interpret the correct meaning of words with multiple meanings. For example, “bank” can mean a financial institution or the side of a river, depending on the context. 2. Google Translate 3. i. The dog barked loudly at the strangers.

In this sentence, "bark" refers to the sound made by a dog. ii. The tree's bark was rough to the touch.

Here, "bark" refers to the outer covering of a tree.

iii. The captain gave a command from the bark, a small sailing vessel. In this context, "bark" refers to a type of boat.

492


Unit 7: Evaluation

Answer Key A. 1. a

2. c

3. b

4. c

5. a

B. 1. complex

2. evaluation

3. Recall

4. True Negative

5. Accuracy

6. c

6. False C. 1. False. Precision considers True Positives and False Positives in its calculation. 2. False. Overfitting refers to a model that performs well on training data but poorly on unseen data. 3. False. A confusion matrix visualises True Positives, True Negatives, False Positives, and False Negatives. 4. True. 5. False. Accuracy might not be the best metric in cases where the dataset is imbalanced or when False Positives or False Negatives are costly. D. 1. Underfitting occurs when a model is too simple and fails to capture the underlying patterns in the data, leading to poor performance on both training and testing data. Overfitting happens when a model is too complex, memorising the training data and performing well on it but poorly on unseen data. 2. The F1 Score is important because it provides a balance between precision and recall, making it useful in situations when both false positives and false negatives are critical. 3. The four common methods used to evaluate the performance of machine learning models are accuracy, precision, recall, and F1 score. E. 1.

The Confusion Matrix

Actual: 1

Actual: 0

Predicted: 1

5

0

Predicted: 0

45

50

From this confusion matrix:

• FP (False Positive): 0

• TP (True Positive): 5

• TN (True Negative): 50

• FN (False Negative): 45

Unit 7 • Evaluation

493


i. Accuracy =

Correct prediction Total cases

* 100%

(TP + TN) Accuracy = * 100% (TP + TN + FP + FN) Here, TP + TN + FP + FN = Total Cases = 5 + 50 + 0 + 45 = 100 Accuracy = [(5+50)/100]*100 = 55 % True Positive

ii. Precision =

All Predicted Positives TP

Precision =

TP + FP

* 100%

* 100%

Precision = [5/(5+0)]*100% = 100% iii. Recall = Recall =

True Positive

True Positive + False Negative TP

TP + FN

Recall = [5/(5+45)]*100%

= 10%

iv. F1 Score = 2*

Precision* Recall

Precision + Recall

F1 Score = 2 * (100*10)/(100+10)

= 2 * 1000/110

= 18.18%

2. i. True Positive since the model correctly identified the presence of the disease. ii. False Negative since the model missed the disease, incorrectly predicting the patient was healthy (no disease). iii. True Negative since the model correctly identified that the patient does not have the disease. iv. False Positive since the model incorrectly identified the presence of the disease in a healthy patient. F. 1. True Positive 2. True Negative

494


The Artificial Intelligence (AI) series for grades 9 and 10 by Uolo aims to expose learners to essential elements in AI and introduce common domains and applications of AI to them. It also introduces the fundamentals of AI to the learners through engaging activities that can be done in a computer lab or on a computer at home. This series paves the way for students to become informed participants in the exciting future shaped by artificial intelligence.

Artificial Intelligence

About the Book

Key Features • Engaging In-chapter Activities: Engaging activities within each chapter that offer students practical experience of various AI concepts and domains, thereby facilitating a deeper understanding.

• Let’s Revise: To reinforce takeaways of each chapter, these chapter-end summaries include key points that recaps everything that has been covered in the chapter.

• Activity Section: To further enhance student proficiency, all the chapters end with an unsolved activity which provides additional practice of the AI concepts.

About Uolo Uolo partners with K-12 schools to provide technology-enabled learning programs. We believe that pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 15,000+ schools across India, Southeast Asia, and the Middle East.

hello@uolo.com �649

ISBN 978-81-979765-1-3

Singapore |

Gurugram

|

Bengaluru

|

© 2025 Uolo EdTech Pvt. Ltd. All rights reserved.

10

• Chapter Checkup: Comprehensive exercises at the end of each chapter that have various question types, like fill in the blanks, true or false, multiple-choice, short answer, long answer, and application-based questions to provide students a thorough revision of the text.


Turn static files into dynamic content formats.

Create a flipbook