Artificial Intelligence and Machine Learning are transforming every industry.
Key Concepts
- AI — machines mimicking intelligence
- ML — learning from data
- Deep Learning — neural networks
- NLP — natural language processing
Artificial Intelligence and Machine Learning are transforming every industry.
# Machine Learning Pipeline Data → Preprocessing → Model → Training → Evaluation → Deployment # Types Supervised: labeled data (classification, regression) Unsupervised: no labels (clustering, dimensionality reduction) Reinforcement: reward-based learning
import random # Simple K-Means concept def kmeans_step(points, centroids): clusters = [[] for _ in centroids] for point in points: distances = [abs(point - c) for c in centroids] closest = distances.index(min(distances)) clusters[closest].append(point) new_centroids = [ sum(c) / len(c) if c else 0 for c in clusters ] return clusters, new_centroids points = [1, 2, 3, 10, 11, 12, 20, 21] centroids = [2, 11] clusters, new_c = kmeans_step(points, centroids) print(f"Clusters: {clusters}") print(f"New centroids: {[f'{c:.1f}' for c in new_c]}")
What is the difference between AI and ML?
AI is the broader concept of intelligent machines. ML is a subset where systems learn from data without explicit programming.
What is supervised learning?
Supervised learning uses labeled data to train models.
When a model performs well on training data but poorly on new data. It memorizes noise instead of learning patterns.