Notes

Observation

An observation is one “row of data”: a single recorded case, example, or event. It’s the basic unit you learn from—one house sale, one patient visit, one student’s exam attempt.

What an observation is (and isn’t)

In statistics and machine learning, an observation is one instance in your dataset. It usually contains values for several variables (also called features in ML). If you’re doing supervised learning, an observation often also includes a label (the outcome you want to predict).

  • Observation = one case (one row)
  • Feature/variable = one measured attribute (one column)
  • Label/target = the outcome column (e.g., price, diagnosis)

Concrete examples

  • House prices: one observation might include square footage, neighborhood, number of bedrooms, and the sale price (label).
  • Medical data: one observation could be a patient encounter with age, blood pressure, lab results, and whether they were admitted.
  • Retail: one observation might be a transaction with items bought, total spend, time of day, and whether a coupon was used.

Why observations matter in AI/ML

Most ML algorithms treat observations as the independent pieces of evidence used to fit a model. If observations aren’t defined consistently, models can break in subtle ways:

  • Data leakage can happen when multiple observations accidentally share information (e.g., splitting train/test by row when rows come from the same person).
  • Non-independence (repeated measures, time series) can make performance look better than it really is if you ignore grouping or ordering.
  • Outliers are often unusual observations that can heavily influence regression and many distance-based methods.

Where you’ll see the term

In libraries like pandas and scikit-learn, observations correspond to rows in a DataFrame or the first dimension of an array X with shape (n_observations, n_features).

Observation is a single recorded instance in a dataset: one unit (e.g., a person, transaction, or image) with measured values for one or more variables/features, and possibly a label. Observations are the basic building blocks for statistical estimation and ML training, since models learn patterns across many observations. Example: one row in a table of house sales containing size, location, and sale price.

Imagine you’re keeping a notebook of daily weather: each day you write down the temperature, whether it rained, and how windy it was. Each day’s entry is one observation.

In statistics and machine learning, an observation is one single “row” of data about one thing at one moment—like one person in a survey, one house for sale, or one photo in a dataset. An observation usually contains several measurements (often called features), and sometimes also the answer you want to predict (a label), like “rain” or “no rain.”