Machine Learning
Machine learning (ML) enables systems to learn from data without being explicitly programmed. It is the driving force behind modern AI applications from recommendation systems to autonomous vehicles.
Types of Learning
Supervised learning: learns from labelled examples (input-output pairs). Unsupervised learning: discovers patterns in unlabelled data. Reinforcement learning: learns through trial and error with rewards/penalties. Semi-supervised and self-supervised learning use partially labelled data.
Supervised Learning Algorithms
Linear regression: predicts continuous values. Logistic regression: binary classification. Decision trees: tree-structured decisions. Random forests: ensemble of trees. SVM (Support Vector Machines): finds optimal separating hyperplane. k-NN: classifies based on nearest neighbours.
Unsupervised Learning
K-means clustering: partitions data into k groups. Hierarchical clustering: builds tree of clusters. PCA (Principal Component Analysis): dimensionality reduction. Association rules: finds item relationships (market basket analysis). Unsupervised learning discovers hidden structure.
Model Evaluation
Training/test split and cross-validation assess generalisation. Metrics: accuracy, precision, recall, F1-score (classification); MSE, R-squared (regression). Confusion matrix shows true/false positives and negatives. Overfitting (memorising data) vs underfitting (too simple).
Reinforcement Learning
An agent interacts with an environment, taking actions to maximise cumulative reward. Q-learning learns action values. Deep RL uses neural networks for complex environments. Applications: game playing (AlphaGo), robotics, resource management.
ML Pipeline
Steps: problem definition, data collection, data cleaning and preprocessing, feature engineering, model selection, training, evaluation, hyperparameter tuning, deployment, and monitoring. Tools: scikit-learn, TensorFlow, PyTorch, Jupyter notebooks.
Summary
Machine learning enables data-driven intelligence. Understanding learning types, algorithms, evaluation metrics, and the ML pipeline is essential for applying AI to real-world problems.