0% found this document useful (0 votes)
74 views54 pages

g10 Part A - Employability Skills

The document outlines a curriculum focused on employability skills, self-management, ICT skills, entrepreneurial skills, and green skills, emphasizing communication, stress management, file management, and waste recycling. It includes role plays, stress management techniques, SMART goals, and practical exercises related to AI and its applications in predicting chronic diseases. Additionally, it discusses ethical considerations in AI, model evaluation metrics, and real-life examples of AI in healthcare.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views54 pages

g10 Part A - Employability Skills

The document outlines a curriculum focused on employability skills, self-management, ICT skills, entrepreneurial skills, and green skills, emphasizing communication, stress management, file management, and waste recycling. It includes role plays, stress management techniques, SMART goals, and practical exercises related to AI and its applications in predicting chronic diseases. Additionally, it discusses ethical considerations in AI, model evaluation metrics, and real-life examples of AI in healthcare.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

ARTIFICIAL INTELLIGENT - CODE 417

PART A : EMPLOYABILITY SKILLS

UNIT 1 : COMMUNICATION SKILLS - II​ ​ ​ DATE:​

1.​ Role Play Title: "The Lost Phone" - Verbal Communication

🎯 Objective:
To help students practice clear articulation, active listening, asking questions, giving
directions, and handling a real-life conversation confidently.

🧑‍🤝‍🧑 Characters:
●​ Riya – the student who lost her phone
●​ Rahul – a stranger who found the phone
●​ Security Guard – helps resolve the situation
●​ Friend – supports Riya and helps her communicate

📝 Scene 1: In the School Corridor


(Riya is panicking and searching her bag)

Riya: Oh no! Where’s my phone? I must have dropped it somewhere.

Friend: Calm down, Riya. When did you last see it?

Riya: I was using it near the library, then I went to the canteen. Maybe I left it there.

Friend: Let’s go back and check. Don’t worry, someone might have found it.

📝 Scene 2: At the School Office


(Rahul enters holding a phone, approaches the security guard)

Rahul: Excuse me, sir. I found this phone near the canteen.

Security Guard: Good of you to return it. Let’s keep it safe until someone reports it missing.

(Riya and Friend enter, looking around)

1
ARTIFICIAL INTELLIGENT - CODE 417

Riya: Hello sir, I think I lost my phone. It’s a red phone with a flower sticker on the back.

Security Guard: Describe it a bit more clearly. Any screen lock? Last photo or wallpaper?

Riya: It’s a Samsung. The wallpaper is a picture of me and my dog. The screen lock has a
star pattern.

Rahul: That matches the phone I found! I picked it up just 10 minutes ago.

Riya: Thank you so much! I was really worried.

Rahul: You’re welcome. It’s important to help each other out.

Friend: Thanks to both of you for being so kind and honest.

🧠 Learning Reflection (After the role play):


Teacher prompts discussion with questions like:

●​ How did each character communicate their message clearly?


●​ What kind of language was polite and respectful?
●​ What listening skills were used?
●​ How would the situation have changed with poor communication?

💡 Skills Focus:
●​ Verbal clarity
●​ Polite tone
●​ Asking and answering questions
●​ Explaining details clearly
●​ Expressing gratitude and handling a real-life scenario

2
ARTIFICIAL INTELLIGENT - CODE 417

2.​ Communication Cycle and its elements.​ ​ ​ ​ DATE:​

The different elements in communication are:-

●​ Sender: the person beginning the communication.

●​ Message: the information that the sender wants to convey.

●​ Channel: the means by which the information is sent.

●​ Receiver: the person to whom the message is sent.

●​ Feedback: the receiver’s acknowledgment and response to the message.

3
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 2 : SELF-MANAGEMENT SKILLS - II

1.​ Signs and symptoms of stress along with stress management


techniques to handle them effectively​ ​ ​ ​ ​ DATE:​

🧠 Signs and Symptoms of Stress


🔹 Physical Symptoms
●​ Headaches
●​ Muscle tension or pain
●​ Fatigue
●​ Upset stomach
●​ Rapid heartbeat
●​ Difficulty sleeping (insomnia)

🔹 Emotional Symptoms
●​ Irritability or anger
●​ Feeling overwhelmed
●​ Anxiety or constant worrying
●​ Mood swings
●​ Low self-esteem

🔹 Cognitive Symptoms
●​ Trouble concentrating
●​ Forgetfulness
●​ Negative thoughts
●​ Constant worrying

🔹 Behavioral Symptoms
●​ Changes in appetite (overeating or undereating)
●​ Avoiding responsibilities
●​ Increased use of alcohol, cigarettes, or drugs
●​ Social withdrawal
●​ Nail biting or pacing

🛠️ Stress Management Techniques


1. Deep Breathing and Relaxation

●​ Practice slow, deep breathing.

4
ARTIFICIAL INTELLIGENT - CODE 417

●​ Try progressive muscle relaxation or guided meditation.​

2. Physical Activity

●​ Engage in regular exercise (walking, jogging, yoga).


●​ Physical movement helps release stress-relieving hormones.

3. Time Management

●​ Make a daily schedule or to-do list.


●​ Break tasks into smaller steps.

4. Healthy Lifestyle

●​ Get 7–8 hours of sleep.


●​ Eat a balanced diet.
●​ Avoid too much caffeine or junk food.

5. Social Support

●​ Talk to a friend, parent, or counselor.


●​ Share your feelings instead of bottling them up.

6. Hobbies and Leisure

●​ Read, draw, listen to music, or do something creative.


●​ Engage in activities that bring you joy.

7. Positive Thinking

●​ Challenge negative thoughts.


●​ Practice gratitude or write a journal.

8. Seek Professional Help

●​ If stress becomes overwhelming, talk to a psychologist or counselor.

5
ARTIFICIAL INTELLIGENT - CODE 417

2.​ Explain ‘SMART’ goals in your own expression & Visual map of the
same.​​ ​ ​ ​ ​ ​ ​ ​ ​ ​ DATE:​

LETTER MEANING EXPLANATION

S Specific

M Measurable

A Attainable

R Relevant

T Time-Bound

6
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 3 : INFORMATION AND COMMUNICATION


TECHNOLOGY SKILLS - II​ ​ ​ ​ ​ ​ DATE:​

1.​ Draw a computer with its peripheral devices and write the function
of each peripheral separately.

7
ARTIFICIAL INTELLIGENT - CODE 417

2.​ Practical Work: Creating, Modifying & Deleting Files and Folders.

Step-by-Step Instructions :​ ​ ​ ​ ​ ​ ​ DATE:​

🔹 1. Create a Folder
●​ Right-click on the desktop or inside any drive (e.g., D:).
●​ Click on New → Folder.
●​ Name the folder as: My_Practical_Work.

🔹 2. Create a File Inside the Folder


●​ Double-click to open My_Practical_Work.
●​ Right-click inside the folder → New → Text Document.
●​ Name the file as: MyNotes.txt.

🔹 3. Modify (Edit) the File


●​ Double-click MyNotes.txt to open it.
●​ Modify the parts of the content that need revision.
●​ Save and close the file (File → Save or press Ctrl+S).

🔹 4. Rename the File


●​ Right-click on MyNotes.txt.
●​ Click Rename, and change it to: Computer_Practical.txt.

🔹 5. Delete the File


●​ Right-click on Computer_Practical.txt and select Delete.
●​ Confirm deletion if prompted.

🔹 6. Delete the Folder


●​ Go back to the location where My_Practical_Work was created.
●​ Right-click on the folder and select Delete.​

✅ Learning Outcome
●​ Understand how to manage files and folders.
●​ Gain confidence in basic file operations.
●​ Learn to organize digital content on their own.

8
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 4 : ENTREPRENEURIAL SKILLS - II

1.​ Write the character sketch of a famous entrepreneur, who according


to you brought a remarkable change in society.​ ​ ​ ​ DATE:​

9
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 5 : GREEN SKILLS - II​ ​ ​ ​ ​ ​ DATE:​

1.​ Make a list of waste material that is thrown away. Now think of
creative ideas in which you can use the waste material to make something
useful.

♻️ Types of Waste Products


Category Examples

●​ Organic Waste Food scraps, fruit and vegetable peels, garden waste, tea leaves,
eggshells

●​ Plastic Waste Bottles, bags, straws, packaging, containers

●​ Paper Waste Newspapers, magazines, used notebooks, paper wrappers, cartons

●​ Glass Waste Broken bottles, jars, windows, mirrors

●​ Metal Waste Tin cans, aluminum foil, metal scraps, old tools

●​ E-waste Old phones, chargers, computers, TVs, batteries

●​ Textile Waste Old clothes, torn fabrics, worn-out shoes

●​ Hazardous Waste Paints, pesticides, expired medicines, cleaning chemicals

●​ Biomedical Waste Bandages, syringes, gloves, expired drugs (from hospitals or


clinics)

●​ Construction Waste Bricks, cement, tiles, wood, wires, pipes

●​ Rubber Waste Old tires, rubber bands, footwear

10
ARTIFICIAL INTELLIGENT - CODE 417

🗑️ List of Waste Materials & Creative Uses


Waste Material Creative Use / DIY Idea

●​ Plastic bottles Make planters, bird feeders, or pencil holders.

●​ Old newspapers Create paper bags, wall art, or origami decorations.

●​ Cardboard boxes Build storage organizers, drawer dividers, or playhouses for kids.

●​ Used glass jars Turn them into spice containers, candle holders, or mini terrariums.

●​ Old clothes/ fabric Make tote bags, cushion covers, or patchwork quilts.

●​ Tin cans Create desk organizers, flower pots, or wind chimes.

●​ Broken crayons Melt and reshape into rainbow crayons or use for art textures.

●​ Used paper sheets Make notepads, scrapbooks, or handmade greeting cards.

●​ Bottle caps Use in art projects, game pieces, or DIY coasters.

●​ Toilet paper rolls Create napkin holders, cable organizers, or small plant pots.

●​ Egg cartons Make seed starters, jewelry organizers, or toy crafts.

●​ CDs/DVDs Make reflective wall art, clocks, or coasters.

●​ Broken jewelry Design new accessories or decorative frames.

●​ Worn-out jeans Make wallets, mobile pouches, or denim baskets.

●​ Old magazines Cut out images for collages, vision boards, or handmade
envelopes.

11
ARTIFICIAL INTELLIGENT - CODE 417

PART B : SUBJECT SPECIFIC SKILLS

UNIT 1 : REVISITING AI PROJECT CYCLE & ETHICAL


FRAMEWORKS FOR AI

Case Study: Using AI to Predict Chronic Disease Risk Based on Lifestyle

Objective:

To develop an AI system that can predict the risk of chronic diseases such as diabetes, heart
disease, or hypertension by analyzing an individual’s lifestyle habits and medical history.

Why This Matters:

Chronic diseases are a leading cause of death globally, but many can be prevented or
managed with early detection. AI can play a key role in early risk prediction, enabling
people to take proactive health measures.

1. Types of Data Collected

Category Examples

Demographic Data Age, gender, ethnicity

Lifestyle Data Diet habits, physical activity, sleep patterns, smoking, alcohol use

Medical History Family history of diseases, past diagnoses, blood pressure, blood sugar

Vital Signs BMI, cholesterol levels, heart rate

Wearable Data Data from fitness trackers (e.g., steps, calories burned, heart activity)

Psychological Data Stress levels, anxiety, work-life balance

2. Data Sources

Source Type of Data

Health Apps (e.g., Fitbit, Apple Health) Lifestyle and wearable data

Electronic Health Records (EHRs) Medical and diagnosis history

Government Health Databases Population health trends, chronic disease statistics

Surveys and Questionnaires Self-reported lifestyle and diet information

Research Institutes (e.g., WHO, CDC) Validated chronic disease datasets

12
ARTIFICIAL INTELLIGENT - CODE 417

3. AI Techniques Used

Technique Purpose

Logistic Regression To assess the likelihood of disease occurrence

Decision Trees To understand which lifestyle factors affect disease risk

Neural Networks For complex pattern detection in health and behavior data

Random Forest To improve prediction accuracy by combining multiple trees

Clustering To group similar patient profiles for targeted recommendations

4. Ethical Framework

Ethical Concern Explanation

Privacy and Health and lifestyle data must be collected with full consent and stored
Consent securely

Bias and Fairness Model must be trained on diverse data to avoid race, gender, or age bias

Transparency Users should understand how the prediction is made

Accessibility The tool should be available to people across all income and education
levels

Data Accuracy Inaccurate input (e.g., self-reported data) must be managed with care

5. Outcomes & Benefits

●​ Early Detection: AI can detect risk before symptoms appear.


●​ Preventive Care: Encourages users to adopt healthier habits.
●​ Customized Recommendations: Personalized health advice based on lifestyle data.
●​ Healthcare Cost Reduction: By avoiding late-stage treatment through early action.​

Real-life Example:

The HealthifyMe Smart Plan uses AI to analyze diet and activity data to warn users of
potential lifestyle diseases and suggests personalized changes.

Conclusion:

Using AI to predict chronic disease risk based on lifestyle offers powerful tools for early
prevention, but must be used with ethical responsibility and data care. When combined
with health education, this technology has the potential to transform global healthcare.

13
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 2 : ADVANCED CONCEPTS OF MODELING OF AI

1.​ Explain Artificial Intelligence, Machine Learning, and Deep Learning


through a Venn Diagram.

14
ARTIFICIAL INTELLIGENT - CODE 417

2.​ Show AI Modeling and its categories through a Concept map and give
examples of each sub category.

Classification: ____________________________________________________________

Regression: ____________________________________________________________

Clustering: ____________________________________________________________

Association : ____________________________________________________________

15
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 3 : EVALUATING MODELS

1.​ Calculate Recall, Accuracy, Precision and F1 Score from the following
Confusion Matrix.

Reference →

Prediction
Confusion Matrix
Yes No

Yes True Positive (TP) False Negative (FN)


Actual
No False Positive (FP) True Negative (TN)

Data Given →

Confusion Matrix True Positive True Negative

Predictive Positive TP = 100 FN = 45

Predictive Negative FP = 65 TN = 320

ACCURACY : ​ TP + TN / TP+TN+FP+FN

​ ​ ​ _____________________

​ ​ ​ _____________________

RECALL :​ ​ TP / TP + FN

​ ​ ​ _____________________

​ ​ ​ _____________________

PRECISION:​ ​ TP / TP + FP

​ ​ ​ _____________________

​ ​ ​ _____________________

F1 SCORE:​ ​ 2 X [(Precision x Recall) / (Precision + Recall)]

​ ​ ​ _____________________

​ ​ ​ _____________________

16
ARTIFICIAL INTELLIGENT - CODE 417

2.​ Explore the internet to find some scenarios related to natural disasters.
Take any one out of them and make a prediction-reality comparison.
draw a confusion matrix for it to show prediction results.

Scenario Overview: Flood Prediction

A recent study (published in April 2025) evaluated an LSTM‑based flood prediction system
called Crisis‑Connect. It used historical hydrometeorological data to predict whether a flood
would occur. When tested, it achieved:

●​ Accuracy: 82.86%

●​ Precision (i.e. Positive Predictive Value): 84.85%

●​ Recall (Sensitivity): 80%

●​ F1‑Score: 82.35%
They also published its confusion matrix, showing counts of true positives, false positives,
false negatives, and true negatives.

Real‑Prediction Comparison and Confusion Matrix

Let’s assume from that confusion matrix:

●​ True Positives (TP) = 80 (correctly predicted flood days)

●​ False Positives (FP) = 14 (predicted flood when no flood occurred)

●​ False Negatives (FN) = 20 (missed actual floods)

●​ True Negatives (TN) = 86 (correct no‑flood predictions)


This hypothetical breakdown aligns with 80% recall (80 / (80+20)), 84.85% precision (80 /
(80+14)), overall accuracy (≈ (80+86)/200 ≈ 82.86%)
Confusion Matrix

Actual: Flood Actual: No Flood

Predicted: Flood TP = 80 FP = 14

Predicted: No Flood FN = 20 TN = 86

17
ARTIFICIAL INTELLIGENT - CODE 417

Discussion:

Prediction vs. Reality in Practical UseIn practice, this model shows strong performance: it
catches most floods while keeping false alarms moderate. However:

●​ Missing 20% of actual floods can lead to inadequate early warning, which may have
severe consequences.

●​ 14 false positives per 200-day sample corresponds to about a 7% false-alarm rate—a


manageable level but still a concern for public trust and resource allocation.

Conclusion

This example demonstrates how machine learning (specifically LSTM) can predict floods in
Indian contexts with reasonably high accuracy. The confusion matrix helps clarify strengths
and limitations: the model reliably identifies most floods (good recall), but still misses some,
and generates some false alarms.
Such evaluation is essential in natural disaster systems, where false negatives (missed events)
often pose the greatest risk. Improved feature selection, increased data, ensemble methods or
hybrid architectures could help raise performance further, as seen in other studies using
Random Forest, Gradient Boosting, etc.

18
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 4 : STATISTICAL DATA (PRACTICAL)

1.​ Write about the various Widgets that are used in “Orange Data
Mining” tool

Orange is a free and easy-to-use tool for data analysis and machine learning. It uses
widgets, which are like building blocks, to help you do tasks like loading data, cleaning it,
making graphs, and training AI models.

Each widget does a specific job, and you can connect them together to make a full AI
workflow — just like connecting blocks in Scratch or diagrams in flowcharts.

What are Widgets?

In Orange Data Mining, widgets are the building blocks of your data analysis project.

Each widget does one specific task like:

●​ Reading data
●​ Cleaning data
●​ Making graphs
●​ Building machine learning models
●​ Testing results
○​ By connecting these widgets, you can create a data science workflow — just
like creating a flowchart!

1. Data Widgets

These widgets are used to load, view, and organize data.

Widget Name What It Does

File Loads data from files like CSV or Excel.

Datasets Gives access to sample datasets in Orange.

Select Columns Allows you to pick only the important columns.

Data Table Displays your data in a table format.

Use these widgets at the start of your workflow.

19
ARTIFICIAL INTELLIGENT - CODE 417

2. Data Preprocessing Widgets

These are used to clean and prepare your data before analysis.

Widget Name What It Does

Impute Fills in missing data values.

Normalize Scales values to a similar range.

Discretize Converts numbers into categories (e.g., age → young).

Continuize Converts text data into numbers.

Think of these as “data cleaning tools.”

3. Visualization Widgets

These widgets help you see patterns and trends in your data through charts and graphs.

Widget Name What It Does

Scatter Plot Plots relationships between two variables.

Box Plot Shows the range and average of values.

Histogram Displays frequency of values.

Heat Map Uses color to compare data values.

Word Cloud Shows the most common words in a dataset.

Helps you understand the data visually.

4. Model (Learner) Widgets

These are used to train machine learning models using your data.

Widget Name What It Does

Logistic Regression Makes predictions for yes/no problems.

Decision Tree Creates a tree-like model for decisions.

Random Forest Combines many trees for better results.

kNN (k-Nearest Neighbors) Finds similar examples for prediction.

Naive Bayes Works well with text and categories.

20
ARTIFICIAL INTELLIGENT - CODE 417

These widgets help the computer learn from data.

5. Evaluation Widgets

These are used to test how good your model is.

Widget Name What It Does

Test & Score Checks model accuracy and performance.

Confusion Matrix Shows correct and incorrect predictions.

ROC Analysis Helps compare different models using graphs.

These tell you if your AI is working well or not.

6. Unsupervised Learning Widgets

These widgets are used when there are no labels in the data — the AI finds patterns on its
own.

Widget Name What It Does

k-Means Groups similar data points (clustering).

PCA Reduces data size while keeping patterns.

t-SNE Helps you visualize high-dimensional data.

Useful for exploring unknown patterns in data.

7. Text Mining Widgets (Add-on)

These are used to work with text data (like reviews or messages).

Widget Name What It Does

Corpus Loads and stores text documents.

Preprocess Text Cleans the text (removes stop words, punctuation).

Bag of Words Converts text into numbers for analysis.

Word Cloud Shows the most frequent words.

Sentiment Analysis Detects if text is positive, negative, or neutral.

You need to install the Text Mining add-on to use these.

21
ARTIFICIAL INTELLIGENT - CODE 417

Summary Table
Widget Type Example Widgets Use

Data File, Select Columns Load and manage data

Preprocessing Impute, Normalize Clean and prepare data

Visualization Scatter Plot, Box Plot Show patterns and trends

Model Decision Tree, kNN Train the machine learning model

Evaluation Test & Score, ROC Check model performance

Unsupervised k-Means, PCA Find hidden patterns

Text Mining Corpus, Word Cloud Work with text data


(Add-on)

22
ARTIFICIAL INTELLIGENT - CODE 417

2.​ CASE STUDY : Food Price Index


Building a Classification Model

STAGE 1 → Problem Scoping


​ To build an AI model to predict price using “Orange Data Mining” AI tool.

STAGE 2 → Data Acquisition


​ Download the dataset from the following link:
​ https://orangewebsupport.co.in.AI/FPI.xlsx

Step 1: Open Orange Data Mining Tool.
Step 2: Drag and drop the File widget onto your canvas.
Step 3: Double-click the File widget to open its configuration window.
Step 4:Click on the Browse button.
​ The File-Orange dialog box appears.
Step 5: Navigate the location containing your dataset.

Step 6: Click the Close button in the File dialog box.

STAGE 3 → Data Exploration

23
ARTIFICIAL INTELLIGENT - CODE 417

The Steps for data exploration are as follows:


Step 7: Drag and drop the Data Table widget onto the canvas.
Step 8: Connect the File widget to the Data Table widget.
Step 9: Double-Click the Data Table widget to view the dataset.

Step 10: Click the Close button in the Data Table dialog box.

STAGE 4 → Modelling
The Steps for models are as follows:
Step 11: Drag and drop the Select Column widget onto the canvas.
Step 12: Connect these File widget to the Select Column widget.
Step 13: Double-Click the Select Column widget.
Step 14: Move the Food Price Index to Target value as we are trying to predict the
price value.

24
ARTIFICIAL INTELLIGENT - CODE 417

Step 15: Click the Close button in the Select Column dialog box.
Step 16: Drag and drop the Linear Regression widget onto the canvas.
Step 17: Connect these Select Column widget to the Linear Regression widget.

STAGE 5 → Evaluate Model


The Steps for model evaluation are as follows:
Step 18: Drag and drop the Test and Score widget onto the canvas.
Step 19: Connect these Linear Regression widget to the Test and Score widget.
Step 20: Drag and drop the Select Column widget onto the canvas.
Step 21: Connect these File widgets to the Select Columns widgets.
Step 22: Connect these Select Columns widgets to the Test and Score widget to
check the performance parameters.

25
ARTIFICIAL INTELLIGENT - CODE 417

Step 23: Double-click on the Test and Score widget.

Step 24: Drag and drop the Prediction widget onto the canvas.
Step 25: Connect these Test and Score widget to the Prediction widget.
Step 26: Double-Click the Prediction widget to view the prediction.

26
ARTIFICIAL INTELLIGENT - CODE 417

Step 27: Click on the Close button to close the prediction dialog box.

STAGE 6 → Deployment
Once the best-performing model is identified, the next step involves deploying the
model to make predictions on new data or integrating it into a larger system.

27
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 5 : COMPUTER VISION

1.​ Fill in the blanks by adjusting the RGB values:

R G B COLOR YOUR OBSERVATION


VALUE VALUE VALUE NAME

255 0 0 #FF0000 ●​ This is a pure red color.


​ ●​ It has the max red component (255), and no
green or blue.

0 255 0 #00FF00 ●​ This is a pure green color.


●​ It has the max green component (255), and no
red or blue.

0 0 255 #0000FF ●​ This is a pure blue color.


●​ It has the max blue component (255), and no red
or green.

255 255 255 #FFFFFF ●​ This is pure white, the brightest color in the
RGB.
●​ All three RGB components are at their max value
(255).

0 0 0 #000000 ●​ This is pure black, the darkest color in the RGB


model.
●​ All RGB components are at their min value (0).

255 255 0 #FFFF00 ●​ This is pure yellow, formed by combining full


red and green with no blue.
●​ Yellow is a secondary color in the RGB model
(Red + Green = Yellow).

0 255 255 #00FFFF ●​ This is pure cyan, formed by max green and
blue, with no red.
●​ It’s a secondary color in the RGB color model
(Green + Blue = Cyan).

255 0 255 #FF00FF ●​ This is pure magenta, formed by combining full


red and blue, with no green.
●​ It’s a secondary color in the RGB color model
(Red + Blue = Magenta).

●​ Creating shades of Grey:


​ ​ Shades of grey are created by setting equal values for the red, green,
and blue channels in the RGB model (e.g., RGB(128, 128, 128)). As the value
increases from 0 to 255, the shade becomes lighter, transitioning from black to
white.

28
ARTIFICIAL INTELLIGENT - CODE 417

2.​ CASE STUDY : Classification Model: Coral Bleaching.


STAGE 1 → Problem Scoping
Coral bleaching occurs when coral lose their vibrant colours and turn white
however there is much more to the phenomenon. The primary cause of coral
bleaching is climate change. Early deduction of coral bleaching can help me
decade global disasters and protect marine ecosystems

STAGE 2 → Data Acquisition


Relevant data sets or identified collected, and prepared for analysis. For the coral
bleaching project the data set used is from the manuscript titled “Bag of
Features(BoF) Based deep learning framework for bleach coral detection”.
This data set is intended for research and experimentation to develop AI models
for detecting bleach chorus.
Step 1: Open Orange data mining tool and locate the import image widget.
Step 2: Drag and drop this widget onto your work Canvas.
Step 3: Right click on the import image widget on the Canvas.
Step 4 : Select the rename option.
Step 5 : Enter the new name training data to make it easier to identify the
widget's purpose.

29
ARTIFICIAL INTELLIGENT - CODE 417

Step 6: double click the renamed training data icon to open its configuration
window

Step 7: Click on the browse button the select top level directory dialogue box
appears
Step 8: Navigate the location containing your training data set
Step 9: Click on the select folder button
Step 10: Click the close button to close the training data dialogue box

STAGE 3 → Data Exploration


Data explorer station involves analysing and visualising the data set to understand
its structure content and features the goal is to ensure the data is ready for
modelling the step for data explorer stations or as follows

Step 11: Drag and drop the image viewer widget on the Canvas.
Step 12: Connect the training data to the image viewer.
Step 13: Double click the image viewer to view the images in the training data
set.
Step 14 : Click the close button to close the image VU at the dialogue box.
Step 15: Drag and draw the image embedding widget on the Canvas.

30
ARTIFICIAL INTELLIGENT - CODE 417

Step 16 : Connect the training data to image embedding to extract image


features and represent them as embedding (numerical feature vectors.)

Step 17 : Drag and drop the data table widget on the Canvas.
Step 18 : Connect the image embedding we check to the data table.

31
ARTIFICIAL INTELLIGENT - CODE 417

Step 19 : Double click the data table widget to view the detailed features
representation of the images.
Step 20 : Click the close button to close the data table dialogue box.

STAGE 4 → Modelling
In this stage are a machine learning model is created using the process to data set
the feature extracted during data exploitation or used for training the model the
steps to build models or as follows:
Step 21: Drag and draw the test and score with jet on to the Canvas.
Step 22 : Connect the image embedding to the test and score with jet
Step 23 : Drag and drop which is for the following classification algorithm
●​ Logistic regression
●​ Random forest
●​ Support vector machine SVM
Step 24 : Connect these algorithm widget to the test and score widget

Step 25 : Double click on the test and score widget to VU the evaluation Matrix
for all three algorithms.

32
ARTIFICIAL INTELLIGENT - CODE 417

Key Matrix to observe includes:


●​ Accuracy the proportion of correctly classified instances.
●​ F1 score the harmonic means of precision and recall.
●​ Precision the ratio of true positive predictions to the total predicted
positive.
●​ Recall the ratio of true positive predictions to the total actual positives.

STAGE 5 → Evaluation
In this step the performance of different algorithm is evaluated to determine the best
model for the toss the steps for model evaluation or as follows

Step 26: Drag and drop the confusion matrix widget on to the Canvas
Step 27: Connect the test and score with jet to the confusion matrix widget
Step 28: Double click on the confusion Matrix widget to open it

33
ARTIFICIAL INTELLIGENT - CODE 417

You will see a table showing the distribution of correct and incorrect predictions for each
class typically as follows:
●​ True positive TP correctly predicted instances of the positive class
●​ False positive FB incorrectly predictor instant of the positive class
●​ False negative FN incorrectly predictor instances of the negative class
●​ True negative TN correctly predicted instances of the negative class
The confusion matrix will first show the result for the logistic regression algorithm
similarly SPM algorithm and lastly random forest algorithm

Step 29: Click the closed button to close the confusion matrix dialogue box

Once you have built and evaluated your model then you need to apply the model to new
unseen test data in order to make predictions.

The steps for predicting model or as follows


Step 30: Drag the import image with jet on to the Canvas to bring in the test data images
you want to classify based on the trend model
Step 31: Right click on the import image widget and rename it to testing data this help
you easily identify the test data set in your workflow
Step 32: Double click on the testing data widget and select the directly that contains the
test data set images of bleached and and bleached coral
Step 33: Click the close button to close the training data dialogue box
Step 34: Drag and draw the image viewer widget on to the Canvas
Step 35: Connect the training data to the image viewer
Step 36: Double click the image viewer widget to view the images in the training data.

34
ARTIFICIAL INTELLIGENT - CODE 417

The image viewer widget will show the test data set that you selected allowing you to
visually inspect the images that will be used for predictions.

35
ARTIFICIAL INTELLIGENT - CODE 417

Step 37: Drag and drop the image embedding we check to the Canvas which will
convert the images into numerical features for prediction.
Step 38: Connect the test data widget test data set to the image embedding with jet
which processes the images into numerical representations that can be used by the model.
Step 39: Drag and drop the prediction with on to the Canvas this will allow you to make
predictions based on the trend model.
Step 40: Connect the image embedding widget to the prediction widget the sister input
data for making prediction.
Step 41: Drag and drop the logistic regression visit to the Canvas.
Step 42: Connect the logistic regression widget to the prediction widget. This will
apply the logistic regression model to the process to test data for classification.

Step 43: Connect the image embedding in the widget to the logistic regression widget
this allows the logistic regression model to learn from the features extracted during
training.
Step 44: Double click on the predictions widgets to view the output the table will
display the predictions for the test data including the predicted classes based on the
logistic regression model.
Step 45: Click on the close button to close the prediction dialogue box.

36
ARTIFICIAL INTELLIGENT - CODE 417

STAGE 6 → Deployment
Once the best-performing model is identified, the next step involves deploying the
model to make predictions on new data or integrating it into a larger system.

37
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 6 : NATURAL LANGUAGE PROCESSING

CASE STUDY : Sentiment Analysis On IMDB Movie Review

What is Sentiment Analysis?


The act of computationally recognising and categorising opinions contained in a piece
of text, especially in order to discern whether the writer has a good, negative, or
neutral attitude toward a given topic, product, etc.

Sentiment analysis is a technique for analysing a piece of text to determine the


sentiment contained within it. It accomplishes this by combining machine learning and
natural language processing (NLP).

Example

You can use sentiment analysis to analyse consumer comments, for example you can
run sentiment analysis algorithms on such text snippets after collecting input through
various mediums such as Twitter and Facebook to assess your customers’ attitudes
toward your product.

38
ARTIFICIAL INTELLIGENT - CODE 417

So Movie Review Analysis is a type of customer feedback analysis here, we’ll walk
through the steps of creating a model that can perform sentiment analysis on a big
movie database. The
information was
gathered from the
Internet Movie
Database (IMDb).

Problem Statement
The main goal is to
estimate the sentiment
of many movie
reviews from the
Internet Movie
Database (IMDb).

Dataset
Based on the content of the reviews, this dataset contains 50,000 movie reviews that
have been pre-labeled with “good” and “negative” sentiment class labels.

39
ARTIFICIAL INTELLIGENT - CODE 417

UNIT 7 : ADVANCE PYTHON [PRACTICAL]

PROGRAM1 :

S1=[32, 45, 40]

S2=[35, 30, 42, 38]

print("List S1 ***")

print (S1, len (S1))

print("*** List S2 ***")

print (S2, len (S2))

All=S1+S2

print("*** List All ***")

print(All,len(All))

OUTPUT:

List S1 ***

[32, 45, 40] 3

*** List S2 ***

[35, 30, 42, 38] 4

*** List All ***

[32, 45, 40, 35, 30, 42, 38] 7

40
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 2:

import statistics

d=[95,90,49,71,90,100,55]

m1=statistics.mean(d)

m2=statistics.median(d)

m3=statistics.mode(d)

print("The mean is: ",m1)

print("The median is: ",m2)

print("The mode is: ",m3)

OUTPUT:

The mean is: 78.57142857142857

The median is: 90

The mode is: 90

41
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 3:

n = int(input("Enter a number: "))

factorial = 1

if n < 0:

print("Factorial does not exist for negative numbers")

elif n == 0:

print("The factorial of 0 is 1")

else:

for i in range(1, n + 1):

factorial = factorial * i

print("The factorial of", n, "is", factorial)

OUTPUT:

Enter a number: 9

The factorial of 9 is 362880

42
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 4:

import matplotlib.pyplot as plt

import numpy as np

#Define X and Y variable data

x= np.array([2,3,9,101])

y=x+2

plt.plot(x, y)

plt.xlabel("X-axis")​ #add X-axis label

plt.ylabel("Y-axis")​ #add Y-axis label

plt.title("Line Chart")​ #add title

plt.show()

OUTPUT:

43
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 5:

import matplotlib.pyplot as plt

import numpy as np

(2,5), (9,10), (8,3), (5,7),(6,18)

x = np.array([2,9,8,5,6])

y = np.array([5,10,3,7,18])

plt.xlabel("X-axis") # add X-axis label

plt.ylabel("Y-axis") # add Y-axis label

plt.title("Scatter Chart") # add title

plt.scatter(x, y)

plt.show()

OUTPUT:

44
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 6:

def reverse_string(str):

str1 = ""

for i in str:

str1 = i + str1

return str1

str = "ARTIFICIAL INTELLIGENCE"

print("The original string is:", str)

print("The reverse string is:", reverse_string(str))

OUTPUT:

The original string is: ARTIFICIAL INTELLIGENCE

The reverse string is: ECNEGILLETNI LAICIFITRA

45
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 7:

import cv2

from matplotlib import pyplot as plt

import numpy as np

img = cv2.imread(r'D:\LONDON.jpg', 0)

plt.imshow(img, cmap='gray')

plt.title('MY FAVOURITE CITY')

plt.axis('off')

plt.show()

OUTPUT:

46
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 8:

def calculate_lcm(x, y):

if x > y:​ greater = x

else:​ greater = y

while True:

if (greater % x == 0) and (greater % y == 0):

lcm = greater

break

greater += 1

return lcm # Returns LCM modulo 23

num1 = int(input("Enter first number: "))

num2 = int(input("Enter second number: "))

print("The L.C.M. of", num1, "and", num2, "is", calculate_lcm(num1,

num2))

OUTPUT:

Enter first number: 18

Enter second number: 20

The L.C.M. of 18 and 20 is 180

47
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 9:

import matplotlib.pyplot as plt # Corrected variable name (no spaces)

no_of_people_voted = [23, 45, 31, 40, 35] # Create the bar chart

plt.bar(['a1', 'a2', 'a3', 'a4', 'a5'], no_of_people_voted)

plt.title('Bar Chart')

plt.xlabel('Area Covered')

plt.ylabel('No of People Voted')

plt.show()

OUTPUT:

48
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 10:

from matplotlib import pyplot as plt

import numpy as np

fig= plt.figure()

ax=fig.add_axes([0,0,1,1])

ax.axis('equal')

data=[45,23,41,78,65]

ax.pie(data,autopct='%1.2f%%')

plt.show()

OUTPUT:

49
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 11:

import matplotlib.pyplot as plt

Weight = [34,41,45,56,39]

Height = [4.5,5.2,4.1,3.5,5]

plt.scatter (Height, Weight, c='blue')

plt.title('Scatter plot')

plt.xlabel('Height')

plt.ylabel('Weight')

plt.show()

OUTPUT:

50
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 12:

import numpy as np

import statistics

a = np.array([95,90,49,71,80])

m = statistics.mean(a)

print("The average is: ", m)

OUTPUT:

The average is: 77

51
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 13:

import cv2

from matplotlib import pyplot as plt # Load your image

img = cv2.imread(r'D:\APJ.jpg') # Check if image loaded

if img is None: print("Error: Image not found. Check the file path.")

else:

face_x1, face_y1 = 250, 100 # Top-left corner of the face

face_x2, face_y2 = 450, 300 # Bottom-right corner of the face

cv2.rectangle(img, (face_x1, face_y1), (face_x2, face_y2), (0, 0, 0),-1)

img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

plt.imshow(img_rgb)

plt.title('Face Masked with Black Box')

plt.axis('off')

plt.show()

OUTPUT:

52
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 14:

import cv2

from matplotlib import pyplot as plt

import numpy as np

img = cv2.imread(r'D:\BANANA TREE.jpg', 0)

plt.imshow(img, cmap='gray') # ✅ Fixed missing '='


plt.title('Banana Tree')

plt.axis('off')

plt.show() # ✅ Added parentheses to actually show the plot


cv2.imwrite(r'D:\Banana tree after color change.jpg', img)

OUTPUT:

53
ARTIFICIAL INTELLIGENT - CODE 417

PROGRAM 15:

import pandas as pd

#Read the CSV file

df= pd.read_csv('D:/Data.csv')

print(df)

OUTPUT:

NAME CITY

0 AARAV DELHI

1 PRIYA MUMBAI

2 RAHUL BENGALURU

3 NEHA CHENNAI

4 ARJUN KOLKATA

5 SNEHA HYDERABAD

6 VIJAY PUNE

7 ROHIT AHMEDABAD

8 DEEPIKA SURAT

54

You might also like