Data Science Quiz 2

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

1/46

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:14 AM on 9/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

47 Terms

1
New cards

Broadcasting

used when we are dealing with 2 array objects that are different sizes

2
New cards

Broadcasting Rules

  1. If 2 objects differ in dimension size, the object with fewer dimensions is padded with 1s on its leading (left) side

  2. If the shapes do not match at all, the array with shape equal to is stretched to match the other shape

  3. If in any dimension the sizes disagree and neither is equal to 1, an error is raised


3
New cards

Masking / Boolean Logic

-index L to R using positive numbers

-index R to L using negative numbers

-index every nth using ::


4
New cards

Fancy Indexing

passing an array or list of indices to access, select, or modify multiple array elements at once

-so you can grab scattered elements in a random order

5
New cards

What Type(s) of Sorting does NumPy Support?

BOGO and Selection

6
New cards

Pearson’s R Correlation

-R = 0 means no correlation

-R > 0 means positive correlation

-R < 0 means negative correlation

7
New cards

p-Value

probability of the null hypothesis, must be low

8
New cards

Null Hypothesis

there is no significant linear relationship

9
New cards

Spearman Correlation

ranking correlation metric

-monotonic increase or decrease

-if high there is a strong positive correlation

10
New cards

What is Monotonic?

linear, exponential, log, factorial

11
New cards

What is NOT Monotonic?

cubic, quadratic, quintic

12
New cards

Models

a simplified representation of reality created to serve a purpose

13
New cards

Mapping

going from feature information to prediction

14
New cards

Induction

refers to the creation of models from data

-uses info in the data to generalize to cases by making general rules (even if the rules do not always hold)

15
New cards

Induction Example

training a loan-prediction model on past data

16
New cards

Deduction

process of applying the existing models to use-cases (more deployment focused)

17
New cards

Deduction Example

using a trained model for future applications

18
New cards

Segmentation

data that is used to train the model, known as “training data”

19
New cards

Splitting for Classification

divides dataset into separate subsets for training, tuning, and evaluating a model to ensure it performs well on new data

20
New cards

Entropy

measures the purity of categorical data features and labels (log base 2)

-good for a single probability distribution

21
New cards

Information Gain

the higher the information gain, the better

-good for 2 different probability distributions

-perfect feature eliminates all uncertainty and disorder in prediction

22
New cards

Classification x Decision Tree Construction

best purest data classification with smallest tree possible

Benefits are:

  1. grounded in information theory through IG and Entropy

  2. Interpretable


23
New cards

Steps to constructing a decision tree?

using a divide and conquer approach:

  1. calculate information gain for each possible feature,

  2. create a decision node for this feature,

  3. look at the new decision tree branches,

  4. and descend the one with the highest entropy


24
New cards

Decision Tree Weakness

  1. missing data

  2. overfitting sensitivity

  3. a lot of features

  4. trees are computationally expensive

  5. less capacity to take advantage of hardware

  6. regression


25
New cards

Pandas

framework for more advanced data manipulation

-built on top of NumPy and relies on its data structures and C-based typing

-good for detailed indexing

26
New cards

pd.DataFrame

2D tabular data structure in Python that organizes data into rows and columns, more advanced than pd.Series

-numpy: ndarray

-python: nested list

27
New cards

Index Object

immutable array

pd.Index = ordered set

28
New cards

Series

provides a mapping from a collection of keys to a collection of values

pd. Series

numpy: array

python: dictionary

29
New cards

Indices In Each Package

Python: non-existent or limited and mutable

NumPy: optional yet looked over

Pandas: everything and immutable

30
New cards

Indexers

.loc - allows indexing and slicing that always references the explicit index (1 = a)

.iloc - always references python-style index (0 = a, 1 = b)

.ix - deprecated

31
New cards

Implicit Slicing of data[0:2]

numbers, exlusive so stops before index 2, matches standard python lists/arrays

32
New cards

Explicit Slicing of data[“a”:”c”]

strings, inclusive so include index “c”, custom dictionary-like slicing behavior

33
New cards

Conditional Indexing ( > )

filter data by selecting only the elements that exceed a specific value

34
New cards

Universal Functions

efficient for vectorization

-used for linear algebra datatypes (np.aray/ndarray, pd.series. pd.dataframe)

35
New cards

Index Alignment

using series/dataframes with different indices can cause NaNs easily because Pandas performs union on the indices and fills in the gaps with NaN values

36
New cards

Components of Floating Point Format with NaN Values

sign bit, exponent, and mantissa/fraction

37
New cards

64-bit FP

IEEE 754 double, 11 exp bits, 52 frac bits

-NaN: exp = 7ff & Frac ≠ 0

38
New cards

32-bit FP

IEEE 754 Single, 8 exp bits, 23 frac bits

NaN: exp = ff & Frac ≠ 0

39
New cards

16-bit FP

IEEE 754 Half, 5 exp bits, 10 frac bits

NaN: Exp = 1f & Frac ≠ 0

40
New cards

8-bit FP

minifloat, exp is a variable [1,6], 7 frac bits of number of exp bits

NaN: exp is all 1s & Frac is ≠ 0

41
New cards

How does NaNs impact aggregate results?

fully takes over

42
New cards

Extra Functions

shape(), reshape(), %timeit

43
New cards

Broadcasting Objects

arrays, vectors, matrices, tensors

44
New cards

Sorting Facts

BOGO Sort is slowest

Selection sort: swap = : + np.argmin()

BOGO sort: np.randomshuffle()

45
New cards

How do we compute p-values?

using t-statistics (N is number of (x,y) pairs)

46
New cards

Subscript

individual entry

47
New cards

Hat

mean value