Machine Learning for Beginners
Machine Learning is a subset of AI that allows computers to learn from data and improve from experience without being explicitly programmed.
2. Types of Machine Learning
ML is categorized based on how the system learns: Supervised, Unsupervised, and Reinforcement Learning.
Supervised learning uses labeled data, while Unsupervised learning finds patterns in unlabeled data.
8. Simple ML Example (Python)
This example trains a simple linear model using scikit-learn.
from sklearn.linear_model import LinearRegression import numpy as np # Training data (y = 2x) X = np.array([[1],[2],[3],[4]]) y = np.array([2,4,6,8]) model = LinearRegression() model.fit(X, y) print(model.predict([[5]])) # Expected: 10