1How can instances be represented numerically?
Using feature vectors (e.g., [2,110,2,1])
2What is one-hot encoding?
Representing categorical values with 0/1 (true or false) vectors
3Give examples of numerical features
Sentence length, number of likes
4Give examples of binary features
Whether text is capitalized (yes/no)
5Give examples of categorical features
Country, genre of text
6What is the nearest neighbor method?
Classify new examples based on the most similar training examples
7What is memory-based learning?
Stores all training instances and predicts using nearby points
8What are the four components of memory-based learning?
Distance metric, number of neighbors, weighting function (optional), fitting method
9What distance metric is commonly used in KNN?
Euclidean distance
10Why is 1-nearest neighbor problematic?
It is highly sensitive to outliers and can overfit
11What happens when K = N in KNN?
Model always predicts the majority label (underfitting)
12What is the inductive bias of KNN?
Labels of points should be similar to nearby points, all features equally important, sensitive to feature scaling
13How can KNN be used for regression?
By predicting the mean of the neighbors’ values
14How are ties handled in KNN?
Random choice, fallback to 1-NN, or use majority class from training data
15What are the computational pros and cons of KNN?
Training is fast and flexible, but predictions are slow and require storing all data
16How do decision trees differ from KNN?
Decision trees learn axis-aligned models; KNN stores data and compares new points, allowing complex boundaries but sensitivity to irrelevant features
17What is NLP?
Automatic processing and analysis of natural language
18Give examples of NLP applications
Machine translation, IBM Watson Q&A
19What makes language understanding hard?
Polysemy, syntactic ambiguity, and continuous language change
20What is tokenization?
Segmenting text into tokens (often words)
21What are challenges in tokenization?
No spaces (Japanese), multiword expressions, contractions
22What are common text pre-processing steps?
Stopword removal, lemmatization, stemming, lowercasing, removing infrequent words
23What is the goal of text pre-processing?
Reduce vocabulary size while retaining useful signals
24What is Jaccard similarity?
Intersection over union of token sets; ignores frequency and order
25What are vector representations of text?
Numerical vectors representing words, documents, or sentences
26What are two common similarity measures between vectors?
Euclidean distance (L2) and cosine similarity
27What does cosine similarity measure?
The angle between vectors, ranging from -1 (opposite) to 1 (same direction)
28What is one-hot encoding for words?
Each word is mapped to a unique ID with a vector of all zeros except one position
29What is the distributional hypothesis in NLP?
Words with similar contexts tend to have similar meanings
30What is a property of one-hot word vectors?
They are sparse (many zeros) and frequency-based
31What are word embeddings?
Dense, learned vector representations of words where dimensions are less interpretable
32What is an advantage of word embeddings over one-hot?
They capture semantic similarity between words in a compact form
33What are contextualized word representations?
Word vectors that depend on surrounding context (e.g., “bank” in money vs. river)
34How does KNN make predictions?
It looks at the K nearest neighbors and assigns the majority label (classification) or average value (regression).
35What is the role of the distance metric in KNN?
It defines what counts as “near” (e.g., Euclidean, Manhattan, cosine distance).
36Why is feature scaling important in KNN?
Without scaling, features with larger numeric ranges dominate the distance metric.
37What is the effect of small K in KNN?
Model becomes very flexible, but prone to overfitting.
38What is the effect of large K in KNN?
Model smooths boundaries, reducing overfitting, but may underfit by ignoring local patterns.
39What is majority voting in KNN?
The prediction is the most common label among the K neighbors.
40What is weighted KNN?
Neighbors closer to the query point are given higher weight in the prediction.
41What is lazy learning?
A method (like KNN) that defers generalization until prediction time.
42What is eager learning?
Learning a model (like decision trees, SVMs) during training time, so predictions are fast.
43Why can KNN struggle with high-dimensional data?
Distances become less meaningful due to the curse of dimensionality.
44What is the curse of dimensionality in KNN?
As features increase, all points appear similarly distant, reducing effectiveness.
45What fitting methods are used in KNN regression?
Mean, weighted mean, or sometimes median of neighbor values.
46What is syntactic ambiguity?
When a sentence can be parsed in multiple ways (e.g., "I saw the man with a telescope").
47What is semantic ambiguity?
When a word or phrase has multiple meanings (e.g., “bank”).
48Why do we lowercase text in preprocessing?
To reduce duplicate forms of the same word (e.g., “Dog” vs. “dog”).
49Why do we remove infrequent words?
They add noise and rarely improve performance in models.
50What is lemmatization?
Reducing words to their base form using vocabularyrammar rules (e.g., “running” → “run”).
51What is stemming?
A crude way of chopping words to root form by removing suffixes (e.g., “running” → “runn”).
52What are stopwords?
Common words (e.g., “the”, “is”) often removed because they carry little meaning.
53Why might stopword removal sometimes harm performance?
Stopwords can carry syntactic or semantic meaning in certain tasks (e.g., “not happy”).
54What does the bag-of-words model represent?
Documents as vectors of word counts, ignoring order.
55What are limitations of bag-of-words?
It ignores word order, context, and semantics.
56What is TF-IDF weighting?
Term frequency–inverse document frequency; emphasizes important but not too common words.
57What is the difference between sparse and dense vectors?
Sparse vectors have many zeros (e.g., one-hot), dense vectors have few or no zeros (e.g., embeddings).
58Why is cosine similarity often preferred over Euclidean distance in NLP?
It ignores vector length and focuses on orientation, making it robust to differences in text length.
59What are word embeddings trained on?
Large corpora of text, optimizing word vectors to capture distributional similarity.
60Give an example of semantic relation captured in embeddings
“king – man + woman ≈ queen”
61What is the difference between static and contextual word embeddings?
Static embeddings (Word2Vec, GloVe) assign one vector per word, while contextual embeddings (BERT, GPT) adjust vectors based on surrounding words.
62Is using more features always better?
No, it increases the risk of overfitting.
63What are two other reasons, besides overfitting, not to use as many features as possible?
We may not want to use certain features (e.g., demographics), and fewer features improve interpretability.
64What is the main difference between Euclidian and Manhattan distances?
Manhattan uses absolute value, while Euclidian uses squared differences.
65What is the Minkowski distance?
A metric that combines or generalizes Manhattan and Euclidian distances.
66What is the main inductive bias of k-nearest neighbors (k-NN)?
The label of a data point should be similar to the labels of nearby points.
67What assumption does the standard k-nearest neighbors algorithm make about feature importance?
All features are equally important.
68What is stop word removal in text pre-processing?
Removing common words (e.g., a, an, the, it) using a list or by filtering very frequent words.
69What is lemmatization?
Reducing different forms of a word (like sang, sung, sings) to its base or dictionary form (sing).
70What is stemming?
Stripping the endings off a word (e.g., 'running' becomes 'run').
71What is lowercasing as a pre-processing step?
Converting all text to lowercase (e.g., 'Running' to 'running').
72Why are infrequent words sometimes removed during pre-processing?
They are filtered out because they occur too rarely (e.g., in less than 10 documents) to be useful.
73What is Edit Distance?
The minimum number of editing operations (insertion, deletion, substitution) needed to transform one string into another.
74How is Jaccard similarity calculated?
Intersection / Union.
75What are the main drawbacks of Jaccard similarity?
It ignores the frequency and order of words.
76What is the distributional hypothesis?
Words that occur in similar contexts tend to have similar meanings.