Definition of Machine Learning
Definition of Machine Learning
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.
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.
python
Copy code
model = LinearRegression()
model.fit(X, y)
prediction = model.predict([[1500]])
2. Unsupervised Learning
python
Copy code
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)
3. Reinforcement Learning
o Definition: The model learns by interacting with an environment and receiving rewards
or penalties.
python
Copy code
import gym
env = gym.make('CartPole-v1')
state = env.reset()
for _ in range(1000):
env.render()
if done:
break
env.close()
Summary Table
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.