🌍 Machine Learning · flashcards
Machine Learning Machine Learning Tools and Libraries Flashcards
50 question-and-answer cards covering Machine Learning Tools and Libraries as it is examined in Machine Learning. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Machine Learning Tools and Libraries deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
What is Caffe and what application domain is it best known for?
Caffe (Convolutional Architecture for Fast Feature Embedding) is a deep learning framework developed at UC Berkeley (BVLC), best known for computer vision and convolutional neural networks. Models are defined declaratively in plain-text .prototxt configuration files rather than code, and it is valued for speed and its pretrained Model Zoo.
What is Theano and what is its current status?
Theano is one of the earliest Python deep learning libraries (from MILA, University of Montreal) that compiles symbolic mathematical expressions involving multidimensional arrays into optimized CPU/GPU code, with automatic differentiation. Major development officially ceased in 2017, but it pioneered ideas later adopted by TensorFlow and others.
What is NLTK and what is its primary intended use?
NLTK (Natural Language Toolkit) is a comprehensive Python library for natural language processing, designed largely for teaching, research, and prototyping. It bundles tokenizers, stemmers, taggers, parsers, WordNet access, and over 50 corpora/lexical resources, favoring breadth and pedagogy over production-grade speed.
Define tokenization, stemming, and lemmatization as performed by NLP libraries like NLTK.
Tokenization splits text into units (words, subwords, or sentences). Stemming crudely chops word endings to a root using heuristics (e.g. Porter stemmer: 'running' -> 'run', 'studies' -> 'studi'). Lemmatization maps a word to its dictionary base form (lemma) using vocabulary and morphology, producing valid words (e.g. 'better' -> 'good', 'studies' -> 'study').
What is SpaCy and how does its design philosophy differ from NLTK?
SpaCy is an industrial-strength NLP library optimized for production: fast, opinionated, and providing a single best-practice pipeline rather than many alternatives. Unlike NLTK's research/teaching breadth, SpaCy emphasizes speed (Cython implementation), pretrained statistical/neural models, and an integrated pipeline (tokenizer, tagger, parser, NER, vectors).
In SpaCy, what is the processing pipeline and what is a Doc object?
Loading a model (e.g. nlp = spacy.load('en_core_web_sm')) and calling nlp(text) runs the pipeline: tokenizer followed by components like tagger, parser, lemmatizer, and named-entity recognizer. The result is a Doc object, a container of Token (and Span) objects carrying linguistic annotations such as .pos_, .lemma_, .dep_, and .ents.
What is Gensim and what task is it specialized for?
Gensim is a Python library specialized in unsupervised topic modeling and document similarity for large text corpora. It implements memory-efficient, streaming algorithms including Word2Vec, Doc2Vec, FastText, LSI/LSA, LDA (Latent Dirichlet Allocation), and TF-IDF, designed to handle corpora larger than RAM.
In Gensim, what are a Dictionary and a corpus (bag-of-words) representation?
A gensim Dictionary maps each unique token to an integer id. The bag-of-words corpus represents each document as a list of (token_id, count) tuples (doc2bow output), discarding word order. This sparse representation is the input to models like TF-IDF and LDA.
Briefly, what does the Word2Vec model produce and what are its two training architectures?
Word2Vec learns dense, low-dimensional vector embeddings of words such that semantically similar words lie close together, capturing analogies via vector arithmetic (e.g. $\vec{king} - \vec{man} + \vec{woman} \approx \vec{queen}$). Its two architectures are CBOW (predict a target word from its context) and Skip-gram (predict surrounding context words from a target word).
What is the Hugging Face Transformers library and what does it provide?
Transformers is an open-source library by Hugging Face providing thousands of pretrained transformer models (BERT, GPT, T5, RoBERTa, etc.) for NLP, vision, audio, and multimodal tasks. It offers a unified API for loading models/tokenizers, fine-tuning, and inference, interoperating with PyTorch, TensorFlow, and JAX, backed by the Model Hub.
In Hugging Face Transformers, what does the pipeline() function do?
pipeline() is the highest-level API that bundles a pretrained model with its preprocessing (tokenizer) and postprocessing for a specific task, e.g. pipeline('sentiment-analysis'). You pass raw text and get task-ready output, handling tokenization, model inference, and decoding in one call.
In Hugging Face Transformers, what is the role of AutoTokenizer and AutoModel classes?
The Auto* classes automatically select the correct architecture-specific class from a model checkpoint name. AutoTokenizer.from_pretrained(name) loads the matching tokenizer, and AutoModel.from_pretrained(name) (or task heads like AutoModelForSequenceClassification) loads the matching model weights/config, so code stays architecture-agnostic.
What is the self-attention mechanism at the heart of the Transformer architecture, including its scoring formula?
Self-attention lets each token weigh the relevance of all other tokens, computing contextual representations. Using Query, Key, and Value matrices, scaled dot-product attention is $\text{Attention}(Q,K,V) = \text{softmax}\!\left(\frac{QK^{T}}{\sqrt{d_k}}\right)V$, where $d_k$ is the key dimension and the $\sqrt{d_k}$ scaling stabilizes gradients.
What is TextBlob and what high-level NLP tasks does it simplify?
TextBlob is a beginner-friendly Python library built on NLTK and pattern, exposing a simple API over a TextBlob object. It simplifies common tasks: part-of-speech tagging, noun-phrase extraction, sentiment analysis, classification, spelling correction, tokenization, and translation, making it popular for quick prototypes and teaching.
In TextBlob, what does the sentiment property return and what do its two values mean?
blob.sentiment returns a named tuple with polarity and subjectivity. Polarity is a float in $[-1.0, 1.0]$ where $-1$ is very negative and $+1$ very positive. Subjectivity is a float in $[0.0, 1.0]$ where $0$ is very objective (factual) and $1$ is very subjective (opinionated).
What is Flair and what NLP capability is it especially known for?
Flair is an NLP library from Zalando Research built on PyTorch, especially known for state-of-the-art sequence labeling such as named-entity recognition (NER) and part-of-speech tagging. Its signature contribution is contextual string ('Flair') embeddings, and it lets users easily stack and combine different word embeddings.
In Flair, what are the core data abstractions Sentence and Token, and how is a tagger applied?
Text is wrapped in a Sentence object, which holds a list of Token objects. A pretrained model is loaded (e.g. SequenceTagger.load('ner')) and applied with tagger.predict(sentence), after which each token/span carries predicted labels accessible via sentence.get_spans('ner').
Compare TensorFlow and PyTorch on computation-graph style and typical adoption.
TensorFlow originally used static (define-then-run) graphs, adding eager execution in 2.x; it is strong in production deployment and mobile/edge (TF Lite, TF Serving). PyTorch uses dynamic (define-by-run) graphs, giving a more Pythonic, debuggable feel, and has become dominant in research. Both support autodiff and GPU acceleration.
Compare static (define-then-run) versus dynamic (define-by-run) computation graphs.
A static graph is fully defined before execution, enabling whole-graph optimization and easy deployment but harder debugging and rigid control flow (classic TF1, Theano, Caffe). A dynamic graph is built on the fly during each forward pass, allowing native Python control flow and easy debugging at some performance cost (PyTorch, MXNet imperative, TF2 eager).
Among visualization libraries, which produce static images versus interactive browser-based output? Classify Matplotlib, Seaborn, Plotly, Bokeh, Altair, and Dash.
Static (image) output: Matplotlib and Seaborn (Seaborn builds on Matplotlib). Interactive, browser/JavaScript-based output: Plotly, Bokeh, and Altair (Vega-Lite). Dash is not a plotting library but a web-app framework that hosts interactive Plotly charts with reactive callbacks.
Classify NLTK, SpaCy, Gensim, Hugging Face Transformers, TextBlob, and Flair by their primary NLP strength.
NLTK: broad teaching/research toolkit. SpaCy: fast production pipelines (tokenize, tag, parse, NER). Gensim: topic modeling and word embeddings (LDA, Word2Vec). Transformers: pretrained transformer models for many tasks. TextBlob: simple beginner API for common tasks/sentiment. Flair: PyTorch-based sequence labeling with contextual embeddings.
What does TF-IDF measure and what is its formula?
TF-IDF (Term Frequency-Inverse Document Frequency) weights how important a term is to a document within a corpus, boosting frequent local terms while down-weighting terms common across all documents. A standard form is $\text{tfidf}(t,d) = \text{tf}(t,d)\cdot \log\!\frac{N}{df(t)}$, where $N$ is the number of documents and $df(t)$ is the number containing term $t$.
Why is the softmax function used in the output layer of many deep-learning classifiers, and what is its formula?
Softmax converts a vector of raw scores (logits) into a probability distribution over classes that sums to 1, so the largest logit gets the highest probability. For logits $z_i$, $\text{softmax}(z)_i = \frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}}$. It is paired with cross-entropy loss for multi-class classification.
What is the cross-entropy loss used to train classifiers in these frameworks, and what is its formula for a single example?
Cross-entropy measures the difference between the predicted probability distribution and the true (one-hot) labels, penalizing confident wrong predictions heavily. For true distribution $y$ and predicted $\hat{y}$ over $K$ classes, the loss is $L = -\sum_{i=1}^{K} y_i \log(\hat{y}_i)$, which reduces to $-\log(\hat{y}_c)$ for the correct class $c$.
What this deck covers
The Machine Learning Tools and Libraries deck follows the Machine Learning Machine Learning Tools and Libraries syllabus — 7 chapters and 43 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 7.1 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 329 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Machine Learning Tools and Libraries flashcards FAQ
How many Machine Learning Tools and Libraries flashcards are in this Machine Learning deck?
50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these Machine Learning flashcards free?
Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.
What do the Machine Learning Tools and Libraries cards cover?
They follow the Machine Learning Machine Learning Tools and Libraries syllabus — 7 chapters and 43 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.