Lecture 3 + Lecture 3 (IDK) INFOMAIR

76 flashcardsby Amogh
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

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