AI glossary: terms starting with R

46 terms starting with R, each defined the way the lesson that teaches it uses it, with a link to every lesson where it appears.

R²

One minus the model's squared error over the mean's squared error: the fraction of the mean's squared error the model removes.

raise

Create an exception and stop the function with it: raise ValueError(...).

Trying randomly sampled settings.

random train/test split

A random partition of the rows already observed.

random variable

A numeric value assigned to each possible outcome; here, a randomly chosen client's assigned cost.

range

A sequence of whole numbers from a start, up to but not including a stop, with an optional step: range(0, 20, 5) gives 0, 5, 10, 15. It works each number out when the loop asks for it.

rank

the number of dimensions a matrix's output fills

Example: 1 for the singular example

RANSAC

Fitting on random minimal samples and keeping the one most rows agree with.

Rate

numerator divided by eligible denominator.

rate of change

Δy/Δx, the change in the output per unit change in the input

Example: x² from 1 to 2: 3

rate of change (slope)

change in output divided by change in input

Example: 2 everywhere for 2x + 1

rate per week

An amount divided by the number of complete weeks it represents.

ℝᵈ

lists of d real numbers

Example: X ∈ ℝ³ˣ²

rebinding

Binding a name to a different object. The old object is unchanged, and any other name still refers to it.

recursion

A function calling itself.

RecursionError

The error Python raises when the call stack goes past its limit, sys.getrecursionlimit(), typically 1000 in our Python session, but configurable.

recursive case

The part of a recursive function that calls the function on a smaller input: return n * factorial(n - 1).

Reduction

Combining values along an axis, such as sum or mean

redundant feature

A feature whose information another feature already carries: perimeter_mean beside radius_mean.

reference category

The category with no column of its own, which the other categories' coefficients are compared against.

regression

Supervised learning where the answer is a quantity, so being close counts.

regression test

A test written from a bug, so that the bug can not come back unnoticed.

regularization

Adding a penalty on the weights to the objective.

reinforcement learning

Learning which actions to take from rewards; outside this track.

relative change

Difference divided by the starting value: 22.57% between the weeks starting 2011-10-31 and 2011-11-07.

relative error

the error divided by the size of the number

Example: at most 1.11 × 10⁻¹⁶ after rounding

reported rate

A numerator and denominator plus the rule defining who is included.

reproduce

Make a bug happen on purpose, on an input you can give again.

resampling with replacement

Each draw uses the same source values, so repeats are possible.

Reshape

Interpret the same number of elements with a new shape; a copy is possible for non-contiguous inputs

residual

actual value minus predicted value

Example: the middle third's mean, −1.34

residual plot

Residuals plotted against fitted values.

residual SD

Empirical spread of observed minus fitted durations: about 7.71 minutes here.

return value

The value a call gives back. Reaching the end of the body normally without an explicit return gives back None.

review rule

A declared test that assigns each row to review or no review, such as PAY_0 > 0.

ridge regression

Linear regression with a penalty on the squared size of the weights.

right skew

A distribution with a longer tail toward larger values.

RMSE

Square root of mean squared prediction error, in the original unit.

robust regression

Fitting with a loss that a few bad rows can not dominate.

ROC curve

the true positive rate against the false positive rate as the threshold moves

Example: the tiny ward's seven points

ROC-AUC

Rank-based score comparing positive and negative labels: the share of positive–negative pairs where the positive scores higher, ties counting one half.

root

b^(1/n), the number whose nth power is b

Example: 2^½ = 1.4142

rounding error

the difference between a number and the float stored for it

Example: 0.1 is stored 5.55 × 10⁻¹⁸ too high

row vector

one row, 1 × d

Example: u.reshape(1, -1)

rug plot

Marks at observed values, one per recorded duration.

rule-based program

A program that follows a rule a person wrote, such as "spam if it contains free".