CS229 Machine Learning Lecture Notes
CS229 Machine Learning Lecture Notes
Laplace smoothing is important in Naive Bayes text classification because it addresses the issue of zero probability for word occurrences not seen in the training data. By adding a small constant to each word's count (including unseen words), Laplace smoothing ensures that every possible word in the vocabulary has a non-zero probability. This helps in handling the variability and sparsity of text data and improves the model's robustness and predictive performance .
Logistic regression utilizes the concept of the exponential family by modeling the conditional probability of the outcome using a logistic function, which is a member of the exponential family. This relationship is significant because it allows logistic regression to be formulated within the framework of generalized linear models (GLMs). This formulation provides a unified approach to handle different types of outcome variables, where the link function relates the linear predictor to the mean of the outcome distribution .
Independent Components Analysis (ICA) differs from Principal Components Analysis (PCA) in its objectives and assumptions. PCA seeks to maximize variance and reduce dimensionality by identifying orthogonal principal components. It assumes data is Gaussian and focuses on second-order statistics. ICA, on the other hand, aims to separate a multivariate signal into additive independent non-Gaussian components, focusing on higher-order statistics. This makes ICA suited for blind source separation tasks, unlike PCA, which does not ensure statistical independence among components .
The normal equations in linear regression are used to find the best-fitting line by minimizing the squared differences between the observed and predicted values. They provide a closed-form solution for the coefficients by setting the derivative of the cost function with respect to the coefficients to zero. Matrix derivatives are involved in deriving these equations, particularly when expressing the cost function as a quadratic form, which simplifies the calculation of gradients and solutions .
Regularization techniques influence model selection by penalizing complex models, thereby reducing overfitting and improving the model's ability to generalize to unseen data. Techniques such as L1 (Lasso) and L2 (Ridge) regularization add penalties to the loss function based on the magnitude of the coefficients, promoting sparsity or smoothness. This influences model selection as it allows the selection of a model that balances complexity and accuracy, ultimately enhancing generalization performance when making predictions on new data .
Kernels in the context of the LMS (Least Mean Squares) algorithm and feature space refer to a function that implicitly maps input data into a higher-dimensional feature space, allowing linear algorithms to perform non-linear classification in the original input space. The kernel trick enables computations in this high-dimensional space without explicitly calculating the mapped features, thus reducing computational cost. This approach is useful in LMS with kernel methods to learn non-linear patterns while maintaining the simplicity of linear algorithms .
Value function approximation in continuous state Markov Decision Processes (MDPs) faces challenges such as balancing bias-variance tradeoffs and computational complexity. High-dimensional state spaces require approximations to remain feasible, leading to potential estimation errors. However, the advantage lies in its ability to handle large and continuous state spaces, making it possible to derive approximate solutions without explicit enumeration of all states. This helps in generalizing policies across states and improving scalability in reinforcement learning applications .
Pretraining impacts large language models significantly in zero-shot and in-context learning. Pretraining involves exposing the model to vast amounts of text, allowing it to learn language structures and semantics. In zero-shot learning, pretrained models use this inherent knowledge to perform new tasks without task-specific training, leveraging their general understanding of language. In-context learning enables models to adapt to new inputs directly in the same inference pass, using learned patterns from pretraining. This pretraining advantage results in models that can generalize well to diverse tasks without explicit retraining .
Differential Dynamic Programming (DDP) translates non-linear dynamics into a form suitable for Linear Quadratic Regulation (LQR) by employing a linearization technique around nominal trajectories. DDP iteratively approximates the dynamics and cost functions using Taylor series expansions to create a quadratic approximation. This allows the use of LQR to optimize control laws within each iteration, facilitating the development of optimal policies for systems with non-linear dynamics. By updating both trajectories and control inputs iteratively, DDP efficiently handles non-linear systems while leveraging LQR principles .
Gaussian discriminant analysis (GDA) and logistic regression are both used for classification tasks, but they differ in their foundational approach. GDA is a generative learning algorithm that models the distribution of each class and then uses Bayes' theorem to compute posterior probabilities. In contrast, logistic regression is a discriminative model that directly models the posterior probability using a logistic function. A key similarity is that both methods can produce similar decision boundaries under certain conditions. However, logistic regression does not assume a specific distribution for the features, unlike GDA, which often assumes a Gaussian distribution .