Matplotlib & Machine Learning Visual Review

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/45

flashcard set

Earn XP

Description and Tags

A comprehensive vocabulary review covering Matplotlib plotting functions and syntax, data types, foundational statistics, regression modeling, and classification methods including Naive Bayes and Support Vector Machines.

46 Terms

1
New cards

plt.plot(x, y)

A Matplotlib function used to show a line through points, requiring xx first, yy second, and both to have the same length.

2
New cards

plt.scatter(x, y)

A Matplotlib function that plots one dot per observation; only xx and yy are required, with optional parameters ss (size), cc (color), and alpha (0–10\text{–}1).

3
New cards

bar() / barh()

Matplotlib functions used to compare categories, with default width = 0.80.8 and bottom = 00; stacked bars use the bottom= parameter.

4
New cards

pie()

A Matplotlib function used to show parts of a whole for a single data series only, using the explode parameter to pull a slice out.

5
New cards

annotate()

A Matplotlib function used to point at a plot feature, taking text, xy (the coordinates of the point), xytext (where the label sits), and arrowprops.

6
New cards

subplot(rows, cols, index)

A Matplotlib function used to arrange and display multiple individual plots in a single figure grid.

7
New cards

suptitle()

A Matplotlib function that creates a centered main title for an entire figure containing subplots.

8
New cards

fmt String

A format shortcut string in Matplotlib structured as marker | line | color (such as 'o:b' for circle markers, dotted line, and blue).

9
New cards

Matplotlib Line Styles

Formatting values in Matplotlib line strings: '-' (solid), ':' (dotted), '--' (dashed), and '-.' (dash-dot).

10
New cards

Matplotlib Marker Options

Keyword styling parameters for plot points, including marker, ms (marker size), mec (markeredgecolor), and mfc (markerfacecolor).

11
New cards

Hatch Patterns

Patterns used to fill bars, fill_between, or contourf (/ \ | - + x o O . *); doubling a character (//, xx) increases pattern density, though not supported on WX or Cairo backends.

12
New cards

Correlation

A measure of how two variables move together that strictly denotes a straight-line (linear) relationship when positive or negative.

13
New cards

Association

A curvy or non-linear relationship between two variables, distinct from a linear correlation.

14
New cards

Interpolation

Predicting values inside the range of observed data points, which is generally more reliable.

15
New cards

Extrapolation

Predicting values outside the range of observed data points, which becomes less reliable the farther out it extends.

16
New cards

Discrete Numerical Data

Quantitative data consisting of whole numbers only, such as cars passing by.

17
New cards

Continuous Numerical Data

Quantitative data that can take infinite possible values along a scale, such as price or size.

18
New cards

Categorical Data

Qualitative data represented by distinct labels without any intrinsic ordering or ranking, such as color or yes/no.

19
New cards

Ordinal Data

Qualitative categorical data that possesses an inherent ranking or order, such as school grades (A beats B).

20
New cards

Mean

The numerical average of a dataset, computed in Python using numpy.mean.

21
New cards

Median

The middle value in a sorted dataset, computed in Python using numpy.median.

22
New cards

Mode

The most frequently occurring value in a dataset, computed in Python using scipy.stats.mode.

23
New cards

Variance

A metric of spread computed with numpy.var that equals std2\text{std}^2.

24
New cards

Standard Deviation

A measure of data spread computed with numpy.std equal to variance\sqrt{\text{variance}}; low standard deviation means values hug the mean, while high standard deviation means values spread wide.

25
New cards

Percentile

The value below which a given percentage of data falls, calculated using numpy.percentile().

26
New cards

Normal (Gaussian) Distribution

A symmetric bell-shaped continuous probability distribution named after Carl Friedrich Gauss, generated with numpy.random.normal(loc, scale, size).

27
New cards

Supervised Learning

A category of machine learning that trains on labeled data (input + answer) to predict outcomes or classify into known categories.

28
New cards

Unsupervised Learning

A category of machine learning that analyzes raw, unlabeled data to discover hidden patterns, cluster data, or explore relationships.

29
New cards

Linear Regression

A modeling technique used when points roughly follow a straight line (y=slope⋅x+intercepty = \text{slope} \cdot x + \text{intercept}), implemented via stats.linregress(x, y) to return slope, intercept, r, p, and std_err.

30
New cards

Polynomial Regression

A regression technique used when data points clearly exhibit a curve, implemented using numpy.poly1d(numpy.polyfit(x, y, degree)).

31
New cards

Multiple Regression

A modeling technique used to predict a target variable when there are two or more input features, implemented using LinearRegression().fit(X, y).

32
New cards

Correlation Coefficient (r)

A statistical metric measuring the strength and direction of a linear relationship between two variables, ranging from −1-1 to 11.

33
New cards

Coefficient of Determination (R²)

A metric indicating how well a regression model fits the data, ranging from 00 (no relationship) to 11 (perfect fit).

34
New cards

Bayes' Theorem

A fundamental probability formula stated as P(A∣B)=P(B∣A)⋅P(A)P(B)P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}, evaluating the conditional likelihood of A given that B is true.

35
New cards

Naive Bayes

A fast, straightforward classification algorithm ideal for high-dimensional data and baselines, executed using LabelEncoder() and GaussianNB().

36
New cards

Train / Test Split

A validation procedure that partitions data—typically 80%80\% to build the model and 20%20\% to evaluate it—using train_test_split().

37
New cards

Confusion Matrix

A performance evaluation grid where rows represent actual classes and columns represent predicted classes; diagonal entries are correct classifications, while off-diagonals are errors.

38
New cards

Support Vector Machine (SVM)

A classification algorithm that determines the decision boundary achieving the widest margin between distinct classes.

39
New cards

Hyperplane

The decision boundary in an SVM, expressed as the linear equation wx+b=0wx + b = 0 in a two-feature space.

40
New cards

Support Vectors

The specific data points located nearest to the decision boundary that uniquely define and orient the SVM hyperplane.

41
New cards

Margin (SVM)

The geometric distance between the decision boundary and the nearest support vectors, which SVM algorithms seek to maximize.

42
New cards

Hard Margin vs. Soft Margin

Hard margin permits no classification errors, whereas soft margin accommodates outliers and allows some margin violations using slack variables.

43
New cards

C Parameter (SVM)

A regularization parameter in SVM where a higher value enforces a stricter misclassification penalty, leading to a narrower margin and fewer training errors.

44
New cards

Hinge Loss

A loss function penalty that equals zero when no boundary violation occurs and increases linearly with the distance of any margin violation.

45
New cards

Kernel (SVM)

A mathematical function that transforms input data into higher-dimensional space to make it linearly separable (such as Linear, Polynomial, Gaussian RBF, or Sigmoid).

46
New cards

Dual Problem (SVM)

An alternative mathematical formulation that optimizes the Lagrange multipliers of support vectors, making the kernel trick computationally feasible.