Flashcards
Basic

Flashcards do conjunto (126)
- 1What is MSE and when to use itMean of the square of residuals. Squaring - add more weight to large errors. All values are positive. Sensitive to outliers. Used in regression problems. Average of L2 loss. When you think outliers are important for the model
- 2What is a loss function?A mathematical process that quantifies the error margin between a model's prediction and the actual target value.
- 3What is a cost function?d
- 4What is a regression problem?d
- 5What is a classification problem?d
- 6What is linear regressiond
- 7What is logistic regression?A
- 8What is MAE and when to use it?Mean absolute error, the absolute values of the residuals. Robust to outliers - extreme values to not disproportionately affect the results. Regression problems. Average of L1 losses. Interpretable as the average error magnitude.
- 9What is MBE and when to use it?Mean Bias Error is the mean of the residuals. Asses if the model is overfitting or underfitting. Regression problems.
- 10What is cross-entropy loss and when to use it?Classification tasks. How well the predicted probabilities match the actual labels.
- 11What is L1 loss?The sum of the absolute values of the difference between the predicted values and the actual values.
- 12What is L2 loss?The sum of the squared differences between predicted values and the actual values. Squaring large error makes the loss larger.
- 13What is RMSE?The square root of the mean squared error (MSE). Measures the spread of the errors and is skewed by larger errors.
- 14Simply - what is gradient descent?A mathematical technique that iteratively finds the weights and bias that produce the model with the lowest loss. Calculate loss, determine direction to move to recuse loss, move the weight and bias to reduce the loss, repeat until a minimum has been found.
- 15What is model convergence?A model converges when its loss actually moves towards a minima (local or global) with a decreasing trend
- 16What type of loss surface is always produced by linear model loss functions?A convex surface. A strictly convex function will have exactly one local minimum point (the global minimum)

- 17Simply - what are hyper parameters?Variables that control different aspects of training. Three common hyperparametes are: learning rate, batch size, epochs
- 18What is the difference between parameter and hyper parameters?Parameters are the variables, like the weights and the bias, that are part of the model. Hyperparameters can be configured to control training and the model, parameters are values the model calculates during training.
- 19What is the learning rate?A floating point number that influences how quickly the model converges. Determines the magnitude of change to changes to weights and biases at each step of the gradient descent process. High learning rate = can't find local minimum, low learning rate = convergence takes a long time.
- 20What is batch size?The number of examples the model processes before updating its weights and bias.
- 21What is stochastic gradient descent?Uses a single example (batch size of one) per iteration. Can be very noisy - variations that cause the loss to increase slightly. It is stochastic because the example chosen for each batch is random.
- 22What is mini-batch stochastic gradient descent?For N number of data points, the batch size can be any number greater than 1 and less than N. The model chooses the example at random, averages their gradients, and then updates the weights and bias once per iteration. Small batches behaves like SGD and large batches behave like full batch.
- 23Explain epoch in relation to batches

- 24What is an epoch?The model has processed every example in the training set once. A training set with 1000 examples and a mini batch size of 100 examples, will take 10 iterations to complete one epoch. More epochs can be better but takes more time to train.
- 25How can you apply the output of a logistic regression model?As is - so as a probability. Or converted to a binary category based on some threshold.
- 26What is a sigmoid function?As the input x increases the function approaches 1, as the input decreases the function approaches 0

- 27What is log lossThe logarithm of the magnitude of the change from data to prediction
- 28What is regularisationA mechanism for penalising model complexity during training. Important for logistic regression. Prevents driving loss toward 0 in cases where the model has a large number of features.
- 29What is L2 regularisationA penalty proportional to the sum of squared weights to the loss function. It forces the model to keep weights small and distributed, enhancing generalisation
- 30What is early stoppingEnding training before the model fully converges. Can increase training loss but decrease test loss.
- 31What's a confusion matrix for a binary classifier?There are four possible outcomes for a binary classifier. The confusion matrix is a NxN table that summarises the incorrect and correct predictions as TP, FP, FN, and TN
- 32What's a True PositiveActual positive predicted as positive
- 33What's a False NegativeActual positive predicted as negative
- 34What's a False PositiveActual negative predicted as positive
- 35What's a True NegativeActual negative predicted as negative
- 36What is TP + FPTotal predicted positive
- 37What is FN + TNTotal predicted negative
- 38What is an imbalanced datasetWhen the total of actual positives is not close to the total actual negatives
- 39What is the classification thresholdThreshold for defining the output of logistic regression model as either positive or negative
- 40In classification, what is accuracyProportion of all classifications that were correct. Coarse grained measure of model quality. For imbalanced datasets it is better to optimise for one or the other.

- 41In classification, what is recall (or TP rate)The proportion of all positives that were classified correctly as positives. Recall is meaningful when the number of actual positives is low.

- 42In classification what is false positive rate (FPR)The proportion of all actual negatives that were classified incorrectly as positives. More informative for imbalanced datasets.

- 43What is precision?Proportion of all the models positive classifications that are actually positive/ TP/TP+FP - less useful when actual positives are low in a dataset.
- 44What is ROCCalculate the TPR and FPR at every threshold. Perfect model will be a line at 1.0

- 45What is AUCThe probability that the model if given a randomly chosen positive and negative example, will rank the positive higher than the negative. Perfect model has an AUC of 1.0. Image is ROC for random guesses.

- 46How to choose a good threshold for logistic regression?

- 47Name some normalisation methodsLinear scaling, z-score scaling, log scaling
- 48What is linear scalingConverting floating point values from their natural range into a standard range - usually 0 to 1 or -1 to +1
- 49What is z-score scaling?Z-score is the number of standard deviations a value is from the mean. Z-score scaling means storing the score in the feature vector. Good for data that follows a normal distribution
- 50What is log scaling?Computes the logarithm of the raw value. Usually with the natural logarithm ln. Good when data conforms to a power law distribution.
- 51What is a sparse feature?A feature who's values are predominantly zero
- 52What is sparse representationStoring the position of the 1.0 in a sparse vector - [0, 0, 1, 0, 0, 0, 0, 0] becomes 2
- 53What is generalisationa
- 54What is overfittinga
- 55What is undercuttinga
- 56What is a nonlinear problem?Once where you can't accurately predict a label with a model of the form b + w1x1 + w2x2 - the decision surface is not a line!
- 57What are some unsupervised learning methods?a
- 58What are feature crosses?Created by taking the cartesian product of two or mode categorical or bucketed features of the dataset, like polynomial transformations they allow linear models to handle non-linearities. They can also encode interactions between features
- 59List examples of activation functionsLinear, ReLU, TanH, Sigmoid
- 60Simply - what are hidden layers?Additional laters between the input and output later
- 61Simply - what is an activation function?A mathematical function applied to the output of a neutron to introduce non-linearity. Activation functions decide whether a neuron should be activated based on the weighted sum of inputs and a bias term. They also make backpropagation possible by providing gradients for weight updates.
- 62What is the sigmoid function?produces an output between 1 and 0

- 63What is the tanh (hyperbolic tangent)F(x) = tanh(x) transforms x to produce an output between -1 and 1
- 64What is the ReLu function? Rectified linear unitF(x) = max(0,x) --> if the input value x is less than 0, return 0. If the input value x is greater than or equal to 0, return the input value.

- 65What is the vanishing gradient problem?The tendency for the gradients of early hidden layers to become flat (low). Increasingly lower gradients result in increasingly smaller changes to the weights on nodes in a deep neural network leading to little to no learning. ReLU activation function can help.
- 66Simple mathematical representation of the weights in the first hidden layer and the output (before activation)


- 67What is backpropogation?Backpropagation, short for Backward Propagation of Errors, is a key algorithm used to train neural networks by minimizing the difference between predicted and actual outputs. It works by propagating errors backward through the network, using the chain rule of calculus to compute gradients and then iteratively updating the weights and biases. Combined with optimization techniques like gradient descent, backpropagation enables the model to reduce loss across epochs and effectively learn complex patterns from data.
- 68What are the two main steps of the backpropogation algorithm?The forward pass and the backward pass
- 69What is the chain rulef
- 70What is exploding gradients?If the weights in a network are larger, the gradients for lower layers involve products of many larger terms. So gradients can get too large to converge. Batch normalisation can help prevent exploding gradients, as can lowering the learning rate.
- 71What is dropout regularisation?Randomly "dropping out" unit activations in a network for a single gradient step. The more you drop out the stronger the regularisation. 0.0 = no dropout. 1.0 = drop out all nodes (model learns nothing)
- 72What is one vs one multi-class classification?Predicting the probabilities of each category relative to eachother so instead of not apple/apple, not orange/orange it becomes orange/apple
- 73What is softmax/ what is it used forFor one vs one classification we can instead apply a function called softmax which assigns decimal probabilities to each class such that the probabilities add up to one.
- 74What is the softmax question?

- 75Briefly - what is an embedding>An embedding is a vector representation of data in embedding space. Generally speaking, a model finds potential embeddings by projecting the high-dimensional space of initial data vectors into a lower-dimensional space.
- 76What are the benefits of using softmax in the final layer?Transforms the model raw output into interpretable probabilities. Ensures outputs are mutually exclusive suitable for problems where each sample belongs to exactly one class. Works seamlessly with the cross entropy loss function.
- 77Whats a RNN(recurrent neural network)?Run multiple times where parts of each run feed into the next run. Hidden layers from the previous run provide part of the input to the same hidden layer in the next run. Useful for evaluating sequences
- 78What is an embedding vector?An array of floating point numbers taken from any hidden later that describe the inputs to that hidden layer.
- 79What is the embedding space/ latent spaceThe d-dimensional vector space that features from a higher-dimensional vector space are mapped to. The dot product/cosine similarity/euclidian distance of two embeddings, measure their similarity
- 80What is the Euclidian distanceScalar magnitude of the distance between two vectors. The smaller the distance, the more similar the vectors, with 0 being the exact same.
- 81What is the vector dot productf
- 82What is the cosine distance/similarityA measurement of the cosine of the angle between two vectors
- 83Simply - what is principle component analysis (PCA)A linear dimensionality reduction technique
- 84Summarise - what is PCAAn orthogonal linear transformation on a real inner product space that transforms the data to a new coordinate system such that the greatest variance by some scalar projection of the data comes to lie on the first co-ordinate (the principle component). The second greatest variance on the second coordinate etc.
- 85What are some applications of PCAj
- 86Simply - what is an encoderAny ML system that converts from a raw, sparse, or external representation into a more processed, denser, or more internal representation
- 87What is a transformerA neural network architecture that relies on self-attention mechanisms to transform a sequence of input embeddings into a sequence of output embeddings without relying on convolutions or RNNs.
- 88What is self attentionA neural network later that transforms a sequence of embeddings into another sequence of embeddings. Each embedding in the output sequence is constructed by integrating information from the elements of the input sequence through an attention mechanism.
- 89What is an attention mechanismd
- 90For a sequence of n tokens, how many times does self-attention transform a sequence of embeedings?n separate times, once at each position in the sequence
- 91What is a decoder?Any ML system that converts from a processed, dense or internal representation to a more raw, sparse, or external representation
- 92What is an optimiser?Improves the model by adjusting its parameters (weights and biases) to minimise the loss function value. Examples include RMSProp, ADAM, and SGD
- 93What is the ADAM optimiser?Adaptive moment estimation (ADAM) combines ideas from RMSProp and Momentum. 1. Compute the exponentially weighted average of past gradients. 2. Compute the exponentially weighted average of the squares of past gradients. 3. Apply a bias correction 4. Update the params W = W -a(correction term)
- 94What is a convolutional layer (as in CNN)A layer where a convolutional filter (kernel) passes along an input matrix. Useful in CNN for image classification, object detection, and other computer vision tasks.

- 95Examples of different types of kernels in CNN1. Edge detection 2. Sharpening kernels 3. Smoothing kernels 4. Embossing kernels
- 96What is zero-shot learningA problem setup in deep learning where a learner observes samples from classes which were not observed during training.
- 97What methods can we use when it might be hard to obtain high quality labels for trainingWeak supervision, semi-supervision, transfer learning, active learning
- 98What is weak supervisionUsing a labelling function to encode heuristics, but these heuristic labels can be noisy. It is important to combine, denoise and reweight all labelling functions. This process of programatic labelling can be scaled easily compared to hand labelling
- 99What is semi-supervisionLeverages structural assumptions to generate new labels based on a small set of initial labels. For example with self-training we can assume high probability scores are correct. You can use clustering or KNN to discover similar samples.
- 100What is the perturbation-based method in semi-supervised learning?Based on the assumption that small perturbations to your sample shouldn't change its label. Examples include adding white noise to images, or random values to word embeddings,
- 101What is transfer learning?A family of methods where a model developed for a task is reused as the starting point for a model on the second task. E.g train a LLM and use it downstream for sentiment analysis
- 102What is active learning?ML models can achieve greater accuracy with fewer training labels if they choose which data samples to learn from.
- 103What is the F1 score?2 x precision x recall/ (precision + recall)
- 104What are some methods to handle class imbalance?Use better evaluation metrics (precision/recall etc), Resampling (over/under sampling), SMOTE, threshold moving, use tree based models
- 105Explain resamplingA method to modify the distribution of the training data to reduce the level of imbalance to make it easier for the model to learn. Resampling includes oversampling, adding more instances from the minority classes, and under sampling, removing instances of the majority classes
- 106Explain the oversampling technique SMOTE (synthetic minority oversampling technique)Synthesis of novel samples of the minority class through sampling convex combinations of existing data points within the minority class. This is difficult for high dimensional data used in NN
- 107When should you NOT resample your training data - and whyWhen you resample your training data, never evaluate your model on resampled data, since it will cause your model to overfit to that resampled distribution
- 108Problems with undersamplingRisk of losing important data from removing data
- 109Problems with oversamplingRisk of of overfitting, especially if the added copies are replicas
- 110What is two-phase learningFirst train your model on the resampled data, then fine tune your model on the original data
- 111What is dynamic samplingOversample low performing classes and under sample the high performing classes
- 112What is data augmentation and what are three main typesTechniques that are used to increase the amount of training data. Augmented data is also good for making models robust to noise and adversarial attacks. 1. Label preserving transformations 2. perturbation (adding noise) 3. data synthesis
- 113What is data leakageWhen a form of the label "leaks" into the set of features for making predictions, and this same information is not available during inference.
- 114Highlight common causes of data leakage1. Splitting time correlated data randomly instead of by time 2. Scaling before splitting 3. Filling in missing data with statistics from the test split 4. Poor handling of data duplication before splitting (same samples in train and validation) 5. Group leakage
- 115What is SHAP?Shapley additive explanations. A features importance to a model is measured by how much that model's performance deteriorates if that feature or set of features is removed from the model.
- 116What is ensemble learningApplying multiple algorithms and models to the same task, select a prediction by aggregation (or voting)
- 117What is underfittingWhen a model can't capture and generalise the underlying trend of the data (high BIAS in train + test)

- 118What is overfittingWhen a model fits too well and starts to model the noise (low bias in training, high variance in testing)

- 119What is biasAccuracy of the model - difference between the average prediction of the model and true value we are trying to predict

- 120What is variancePrecision of the model - Measure of the variability of predicted values for a given input with a trained model

- 121What is regularisation and what are some techniquesImplement the trade off between bias and variance to reduce the prediction error. 1. Modify the cost function 2. K-fold cross validation
- 122What is the bias variance trade off?To achieve optimal performance, the model must be positioned at an equilibrium point, where the test error rate is minimised and the variance and bias are balanced

- 123What is bagging?Bootstrap aggregating, reduce variance and avoid overfitting. We sample with replacement to create different datasets, called bootstraps, and train a model on these bootstraps. The final result can be a vote or an average
- 124What is a random forest?An example of bagging, a collection of feature trees where each tree can pick only from a subset of random features to use
- 125What is boosting?Sequential learning, samples are weighted differently in each iteration. Future weak learners focus more on examples that previous weak learners misclassified

- 126What might you want to track for running ML experiments?Loss curve, model performance metrics (accuracy, F1 etc.), logs of sample, prediction and ground truth labels, training speed, system performance metrics (CPU usage/ GPU usage), values over time of parameters and hyperparametes
Informações
- Descrição
- Software Engineer ML Theory FlashCards sobre Basic, criado por Sophie Cooper em 19-02-2026.
- Criado por
- Sophie Cooper
- Visualizações
- 5
- Avaliação