0% found this document useful (0 votes)
2 views2 pages

Definition of Machine Learning

Machine Learning (ML) is a branch of Artificial Intelligence that enables systems to learn from data and make predictions without explicit programming. It includes three main types: Supervised Learning, which uses labeled data to predict outcomes; Unsupervised Learning, which identifies patterns in unlabeled data; and Reinforcement Learning, where models learn through interaction with an environment. The document also provides practical programming examples for each type to illustrate their application.

Uploaded by

Sajid Hussain
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)
2 views2 pages

Definition of Machine Learning

Machine Learning (ML) is a branch of Artificial Intelligence that enables systems to learn from data and make predictions without explicit programming. It includes three main types: Supervised Learning, which uses labeled data to predict outcomes; Unsupervised Learning, which identifies patterns in unlabeled data; and Reinforcement Learning, where models learn through interaction with an environment. The document also provides practical programming examples for each type to illustrate their application.

Uploaded by

Sajid Hussain
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/ 2

Definition of Machine Learning (ML)

Machine Learning (ML) is a subset of Artificial Intelligence (AI) that focuses on developing systems that
can learn and make decisions or predictions from data without being explicitly programmed. It involves
designing algorithms that can automatically improve with experience.

Types of Machine Learning

1. Supervised Learning

o Definition: The model learns from labeled data, where the input-output relationship is
known.

o Theoretical Example: Predicting house prices based on features like size, location, and
number of rooms.

o Programming Example: Training a regression model in Python using sklearn:

python

Copy code

from sklearn.linear_model import LinearRegression

X = [[1400], [1600], [1700]] # Feature: House size (sq ft)

y = [300000, 350000, 400000] # Label: House prices

model = LinearRegression()

model.fit(X, y)

prediction = model.predict([[1500]])

print(prediction) # Predicted price

2. Unsupervised Learning

o Definition: The model identifies patterns or structures in unlabeled data.

o Theoretical Example: Grouping customers based on purchasing behavior for targeted


marketing.

o Programming Example: Using K-means clustering in Python:

python

Copy code

from sklearn.cluster import KMeans

import numpy as np

data = np.array([[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]])
kmeans = KMeans(n_clusters=2, random_state=0)

kmeans.fit(data)

print(kmeans.labels_) # Cluster assignments

3. Reinforcement Learning

o Definition: The model learns by interacting with an environment and receiving rewards
or penalties.

o Theoretical Example: A robot learning to walk by trial and error.

o Programming Example: Using gym to simulate a reinforcement learning environment:

python

Copy code

import gym

env = gym.make('CartPole-v1')

state = env.reset()

for _ in range(1000):

env.render()

action = env.action_space.sample() # Random action

next_state, reward, done, _ = env.step(action)

if done:

break

env.close()

Summary Table

Type Key Focus Data Requirement Example Task

Supervised Learning Predict outcomes Labeled data Email spam classification

Unsupervised Learning Find patterns or structure Unlabeled data Customer segmentation

Reinforcement Learning Learn from environment Rewards and penalties Autonomous car driving

This combination of theory and programming ensures that students grasp both the conceptual and
practical aspects of ML.

You might also like