Machine Learning Basics
Learn machine learning with multiple-choice questions, including calculations: supervised, unsupervised and reinforcement learning, classification and regression, k-means and principal component analysis, cross-validation, overfitting and regularization, confusion matrices with precision, recall and F1 score, models such as decision trees, SVMs and naive Bayes, the forward pass and activation functions of neural networks, gradient descent and backpropagation, CNNs, RNNs and the Transformer, transfer learning and generative models.
Machine Learning Basics: key points
Machine learning is the technology of learning rules automatically from data in order to make predictions and classifications. There is supervised learning, which uses correct-answer labels; unsupervised learning, which finds structure in unlabeled data; and reinforcement learning, which learns actions from rewards. Whatever the method, what matters is how accurately the model predicts on data not used for training (generalization performance).
This topic covers, mainly through calculation questions, splitting data into training, validation and test sets and cross-validation, overfitting and the bias–variance trade-off, regularization and dropout, precision, recall and the F1 score computed from a confusion matrix, the ROC curve and the mean squared error. After representative models such as linear regression, logistic regression, decision trees, random forests, k-nearest neighbors, SVMs and naive Bayes, it goes on to the forward pass of neural networks, activation functions, loss functions, gradient descent and backpropagation, mini-batches and epochs, output sizes in CNNs, RNNs and the Transformer, transfer learning, generative models and the tokens of LLMs. It also helps with the AI sections of IT certification exams such as Japan's Fundamental and Applied Information Technology Engineer Examinations, and with the JDLA Deep Learning for GENERAL (G-kentei) certificate.
All Machine Learning Basics questions (40)
- Which of the following supervised learning tasks is a regression task?
- Which of the following is an example of unsupervised learning?
- Which of the following describes reinforcement learning?
- Which of the following describes the procedure of clustering with k-means (k-means clustering)?
- Which of the following describes principal component analysis (PCA)?
- When data is split into training, validation and test sets, which of the following is the main use of the validation set?
- When 5-fold cross-validation (k-fold cross-validation with k = 5) is performed on 1000 data points, how many data points are used for each round of training?
- Which of the following is seen when overfitting is occurring?
- Which of the following is correct when a model's error is considered in terms of bias and variance?
- Which of the following correctly describes regularization and related methods for reducing overfitting?
- Which of the following steps in building a machine learning model causes data leakage (information from the evaluation data slipping into training)?
- A two-class classification model was evaluated on 200 test samples, and its confusion matrix shows 45 true positives (TP), 5 false positives (FP), 45 false negatives (FN) and 105 true negatives (TN). Which pair of precision and recall is correct?
- A two-class classification model was evaluated on 200 test samples, giving TP = 20, FP = 5, FN = 30 and TN = 145. Which is closest to the F1 score?
- Which of the following correctly describes the ROC curve and AUC used to evaluate two-class classification models?
- For data of 1000 items of which only 10 are positive, what is the accuracy of a model that predicts every item as negative?
- Four data points have actual values 3, 5, 2 and 6, and the model predicts 2, 5, 4 and 4 for them. What is the mean squared error (MSE)?
- A straight line y = ax + b is fitted by least squares to the three data points (x, y) = (1, 3), (2, 4) and (3, 8). What is the predicted value at x = 4?
- In logistic regression, z = 2x − 4 is passed through the sigmoid function σ(z) = 1 ÷ (1 + e^(−z)) and the result is output as the probability of being positive. What is the output when x = 2?
- A node of a decision tree holds 6 data points of class A and 4 of class B. What is the Gini impurity of this node?
- Which of the following correctly describes the difference between bagging (random forests and the like) and boosting in ensemble learning?
- The class of the 2D point (0, 0) is predicted with k-nearest neighbors. The training data consists of red points (1, 0), (3, 0) and (0, −3) and blue points (0, 2) and (−2, 1). Using Euclidean distance, which pair of predictions for k = 3 and k = 5 is correct?
- Which of the following describes a support vector machine (SVM)?
- 20% of all emails are spam. A certain word appears in 50% of spam emails and in 5% of non-spam emails. Which is closest to the probability that an email containing this word is spam?
- Which logic function cannot be represented by a simple perceptron consisting only of input and output layers (a single neuron that outputs 0 or 1 with a threshold)?
- In a three-class classification, the values input to the softmax function (logits) are 3, 1 and 0. About how many times the second class's output (probability) is the first class's output? Which is closest?
- A small neural network with inputs x₁ = 1 and x₂ = 2 has two hidden neurons h₁ = ReLU(x₁ + x₂ − 1) and h₂ = ReLU(x₁ − 2x₂ + 1), and output y = 2h₁ + 3h₂ + 1. What is the value of y?
- Let p be the probability that a model outputs for the correct class. Which of the following describes the cross-entropy loss −log p used to train classifiers?
- In gradient descent, the gradient of the loss ∂L/∂w at weight w = 2.0 is 0.5 and the learning rate is 0.1. What is the weight after one update?
- When the derivative dy/dx of y = (2x + 1)² at x = 1 is found by the chain rule with u = 2x + 1 and y = u², which value is correct?
- In a neural network with many stacked layers, which of the following is the reason that using the sigmoid function as the activation function makes the layers near the input hard to train?
- A model is trained on 10,000 training samples with a mini-batch size (batch size) of 50. How many weight updates are there in one epoch?
- How many trainable parameters does a fully connected layer with 64 inputs and 32 outputs (one bias per output) have?
- A 28×28 single-channel image is convolved with a 5×5 filter (stride 1, no padding), followed by 2×2 max pooling (stride 2). What are the height and width of the output?
- Which of the following correctly describes recurrent neural networks (RNNs) and LSTMs?
- Which of the following describes the self-attention used in the Transformer?
- Which of the following describes transfer learning, in which a model trained on a large amount of data is used for a different task with little data?
- Which of the following correctly describes models that generate images and similar data?
- Which of the following describes how a large language model (LLM) processes text?
- When building a model that predicts hiring decisions from application documents, using past hiring outcomes as the correct answers, which of the following should be kept in mind?
- Which of the following describes explainable AI (XAI)?
Books on Machine Learning Basics Ad
As an Amazon Associate I earn from qualifying purchases.
Other topics in Computer systems
- Computer Arithmetic IEEE 754, fixed point, rounding error
- Probability, Statistics and Queueing Counting, distributions, estimation and testing, M/M/1
- Information Theory and Coding Basics Entropy, Huffman codes, Hamming codes, CRC
- ISA & Assembly RISC-V, addressing modes, calling conventions
- Compilers Parsing, SSA, optimizations, register allocation
- Linkers, Loaders & Executables ELF, symbols, relocation, dynamic linking
- OS & Hardware Interrupts, system calls, page faults
- Linux and Command-Line Basics Shell, permissions, pipes, scripts
- Memory Hierarchy Caches, replacement policies, 3 types of misses
- Multicore & Synchronization MESI, atomic instructions, memory barriers
- GPU Programming Warps, shared memory, coalescing, occupancy
- AI Hardware & Software Stack Inference vs training, quantization, roofline
- Embedded Systems & Firmware GPIO, UART/SPI/I2C, RTOS
- HDL & Verification Verilog, latches, state machines, testbenches
- I/O Interfaces & Buses PCIe, USB, SerDes, CXL
- Computer Networking Basics TCP/IP, subnetting, DNS, TLS
- Web Technology Basics HTTP, cookies, REST, CORS, caching
- Wireless Communication Basics Modulation, OFDM, MIMO and RF circuits
- Information Security Basics Crypto, authentication, web attacks
- Database Basics SQL, normalization, transactions
- Data Structures and Algorithms Complexity, search, sorting and graphs
- Programming Basics (Pseudocode Tracing) Pseudocode, tracing, arrays and recursion
- C Programming Basics Pointers, memory, undefined behavior
- Software Development and Project Management Processes, testing, schedule and cost control
- Business Strategy and Accounting Basics Accounting, break-even, strategy, marketing
- IT Service Management and Systems Audit SLAs, incidents and problems, audits and internal control
- System Architecture and Reliability Redundancy, RAID, backups and cloud
- Cloud and Container Basics Docker, Kubernetes, shared responsibility, IaC
- Performance Analysis Amdahl's law, CPI, bottlenecks
- Hardware Security Side channels, secure boot, TEE, PUF
- Power Management DVFS, power gating, sleep states