0% found this document useful (0 votes)
69 views10 pages

Unit I1

Uploaded by

22wh1a05d5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views10 pages

Unit I1

Uploaded by

22wh1a05d5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIT I: Foundations of Artificial Intelligence

1. Defining Artificial Intelligence (AI)


Artificial Intelligence (AI) is the simulation of human intelligence in machines
that are programmed to think and act like humans. The goal of AI is to develop
systems capable of performing tasks that typically require human intelligence,
such as decision-making, problem-solving, and language understanding.
Core Aspects of AI:
1. Reasoning: Machines use logical methods to draw conclusions.
2. Learning: Adapting to new data or environments without explicit
reprogramming.
3. Perception: Interpreting and making sense of the environment using
sensory data (e.g., vision, sound).
4. Language Understanding: Natural language processing (NLP) for
communication.
Real-Life Examples of AI:
1. Voice Assistants: Alexa, Siri.
2. Recommendation Systems: Netflix suggesting shows based on
preferences.
3. Self-Driving Cars: Tesla's autopilot technology.
4. Healthcare Diagnostics: AI systems predicting diseases like cancer.

2. Defining AI Techniques
AI techniques are methods that machines use to emulate human-like
intelligence. These techniques can be categorized based on their function or
approach:
Key AI Techniques:
1. Search Algorithms:
o Example: Depth-First Search (DFS), Breadth-First Search (BFS), A*.
o Usage: Pathfinding in robotics or games.
2. Knowledge Representation:
o Structures used to store knowledge for reasoning:
 Semantic networks.
 Frames.
 Logical expressions (propositional or predicate logic).
o Example: Representing relationships like "John is a brother of
Mary."
3. Learning Methods:
o Supervised Learning: Learning from labeled data (e.g., spam email
detection).
o Unsupervised Learning: Identifying patterns in unlabeled data
(e.g., clustering).
o Reinforcement Learning: Learning by trial and error to maximize
rewards (e.g., game-playing AI).

3. Using Predicate Logic


Predicate logic is an extension of propositional logic that uses predicates to
express relationships or properties of objects.
Syntax of Predicate Logic:
 Predicates: Functions that describe a property or relationship. Example:
Likes(Alice,Pizza)Likes(Alice, Pizza)Likes(Alice,Pizza).
 Quantifiers:
o ∀\forall∀: Universal quantifier ("for all").
 Example: ∀x(Human(x) ⟹ Mortal(x))\forall x (Human(x) \
implies Mortal(x))∀x(Human(x)⟹Mortal(x)).
o ∃\exists∃: Existential quantifier ("there exists").
 Example: ∃x(Student(x)∧Studies(x,Math))\exists x
(Student(x) \wedge Studies(x,
Math))∃x(Student(x)∧Studies(x,Math)).
Advantages:
1. Clear representation of facts.
2. Allows logical reasoning using rules and facts.

4. Representing Knowledge as Rules


Knowledge in AI can be stored as rules to infer new information or make
decisions.
Structure of Rules:
 IF-THEN format:
o Example: IF temperature > 40 THEN alert_heatwave.
Applications:
1. Medical Diagnosis:
o Rule: IF fever AND cough THEN diagnose_flu.
2. Traffic Systems:
o Rule: IF signal == red THEN stop_car.
Rules allow AI systems to automate reasoning processes.

5. Representing Simple Facts in Logic


Logical representation of facts is fundamental in AI to formalize knowledge.
Types of Logic:
1. Propositional Logic: Deals with true or false statements.
o Example: "The sky is blue" Blue(Sky)=TrueBlue(Sky) =
TrueBlue(Sky)=True.
2. Predicate Logic: Represents facts with relationships.
o Example: "John is taller than Mary" Taller(John,Mary)Taller(John,
Mary)Taller(John,Mary).
Logical representation enables reasoning, inference, and problem-solving.
6. Computable Functions and Predicates
Functions and predicates are computable when their outputs can be derived
using algorithms.
Examples:
1. Function: f(x)=x2+3x+2f(x) = x^2 + 3x + 2f(x)=x2+3x+2.
2. Predicate: P(x):x>10P(x): x > 10P(x):x>10.
Applications:
Used in search algorithms, decision-making systems, and optimization tasks.

7. Procedural vs Declarative Knowledge


1. Procedural Knowledge:
o Represents "how to do something."
o Example: Sorting numbers using a bubble sort algorithm.
2. Declarative Knowledge:
o Represents "what is known."
o Example: "All humans are mortal."
Declarative knowledge is often stored in databases or knowledge bases.

8. Logic Programming
Logic programming uses logic as the primary framework for computation.
Prolog is a widely used language for logic programming.
Example in Prolog:
prolog
Copy code
parent(X, Y) :- father(X, Y).
parent(X, Y) :- mother(X, Y).
UNIT II: Preparing a Model
Machine Learning (ML) models require a structured process that includes data
understanding, preparation, and transformation. Each step is critical to
ensuring the model performs accurately and efficiently. Below is a detailed
explanation of the subtopics in this chapter:

1. Machine Learning Activities


ML activities encompass a series of steps that transform raw data into
actionable insights using algorithms. The key steps are:
a. Data Collection:
 Gathering data from sources such as:
o Databases (e.g., MySQL, MongoDB).
o Sensors (e.g., IoT devices).
o APIs (e.g., weather data, financial data).
 Data formats include CSV, JSON, XML, etc.
b. Data Cleaning:
 Handling issues like:
o Missing Values: Replace using mean, median, or mode.
o Duplicates: Remove redundant rows.
o Outliers: Use statistical techniques like z-scores to identify and
remove.
c. Data Preprocessing:
 Transform raw data into a usable format:
o Encoding: Convert categorical variables into numerical formats
(e.g., One-Hot Encoding).
o Scaling: Normalize numerical data to ensure features have
comparable scales.
d. Feature Engineering:
 Creating new features from existing data to improve model performance.
o Example: Extracting the "year" from a date column.
e. Model Training and Evaluation:
 Use training data to fit the model and validate performance using test
data.

2. Basic Types of Data in Machine Learning


a. Numerical Data:
 Continuous values such as temperature, height, or weight.
 Examples:
o Age: 23, 25, 30.
o Income: $50,000, $60,000.
b. Categorical Data:
 Discrete categories or labels.
 Examples:
o Gender: Male, Female.
o Country: India, USA, UK.
c. Ordinal Data:
 Categories with a specific order but no fixed difference between levels.
 Examples:
o Education Level: High School, Bachelor’s, Master’s, PhD.
o Rating: Poor, Fair, Good, Excellent.
d. Time-Series Data:
 Data points collected over time intervals.
 Examples:
o Stock prices over time.
o Daily temperatures.

3. Exploring the Structure of Data


a. Exploring and Plotting Numerical Data:
 Descriptive Statistics:
o Mean, median, mode, standard deviation, and variance.
 Visualizations:
o Histograms: Show the frequency distribution of numerical data.
o Boxplots: Highlight outliers and spread.
b. Exploring and Plotting Categorical Data:
 Bar plots and pie charts are commonly used to represent the distribution
of categories.
c. Exploring Relationships Between Variables:
 Scatter Plots: Show relationships between two numerical variables.
o Example: Age vs Income.
 Correlation Matrix: Measures the strength of linear relationships
between variables.
o Positive Correlation: r>0r > 0r>0.
o Negative Correlation: r<0r < 0r<0.

4. Data Quality and Remediation


Poor-quality data leads to inaccurate models. Data quality issues and solutions
include:
a. Missing Values:
 Techniques to Handle:
o Mean or median imputation.
o Dropping rows or columns with excessive missing data.
b. Outliers:
 Detected using statistical methods (e.g., z-scores).
 Solutions:
o Remove or transform using logarithmic scaling.
c. Inconsistent Formats:
 Example: Dates stored as "01-01-2023" and "Jan 1, 2023".
 Solution: Standardize formats.

5. Data Preprocessing
a. Dimensionality Reduction:
 Reduces the number of features while retaining significant information.
 Techniques:
o Principal Component Analysis (PCA).
o Singular Value Decomposition (SVD).
b. Feature Subset Selection:
 Identifies the most relevant features.
 Methods:
o Filter Methods: Based on statistical measures like correlation.
o Wrapper Methods: Evaluate subsets by training a model.
o Embedded Methods: Feature selection integrated within
algorithms (e.g., decision trees).

UNIT III: Modelling


This chapter focuses on selecting, training, and evaluating machine learning
models.

1. Selecting a Model
a. Predictive Models:
 Used for regression or classification tasks.
 Examples:
o Regression: Predicting house prices.
o Classification: Determining if an email is spam or not.
b. Descriptive Models:
 Discover hidden patterns in data.
 Examples:
o Clustering customers into segments.
o Association rules to find product purchase patterns (e.g., market
basket analysis).

2. Training a Model
a. Holdout Method:
 Split data into:
o Training Set: For learning (e.g., 80%).
o Testing Set: For evaluation (e.g., 20%).
b. K-Fold Cross Validation:
 Split data into kkk subsets (folds).
 Train on k−1k-1k−1 folds and test on the remaining fold.
 Repeat kkk times to get the average performance.

3. Model Representation and Interpretability


a. Underfitting:
 Occurs when a model is too simple to capture the complexity of data.
 Example: Linear regression applied to non-linear data.
 Solution: Use a more complex model.
b. Overfitting:
 Happens when a model learns noise in training data, reducing
performance on unseen data.
 Example: A decision tree that grows too deep.
 Solution:
o Regularization (e.g., L1, L2 penalties).
o Pruning (for decision trees).
c. Bias-Variance Tradeoff:
 Bias: Error due to overly simplistic assumptions.
o High bias → underfitting.
 Variance: Error due to sensitivity to small data fluctuations.
o High variance → overfitting.
 Goal: Balance bias and variance to minimize total error.

You might also like