What is a Feature

In Data Science and machine learning, a feature is an individual measurable property or characteristic of the data being analysed - in a simple sense, it's a column in your dataset that's used as an input to describe or predict something.

Features vs Raw Columns

Every feature starts life as a column, but not every column makes a good feature. A raw column like "Date of Birth" isn't very useful to a model directly, but a derived feature like "Age" calculated from it usually is.

A Simple Example

import pandas as pd

df = pd.DataFrame({
    "Name": ["Abhay", "Priya", "Rohit"],
    "HoursStudied": [2, 5, 1],
    "AttendancePercent": [75, 95, 60],
    "Passed": [0, 1, 0]
})

# HoursStudied and AttendancePercent are features
# Passed is the target we're trying to predict

Features and the Target Variable

In a supervised learning problem, features are the inputs (also called independent variables), while the outcome you're trying to predict is called the target or dependent variable.

Good Features vs Poor Features

A good feature has a genuine relationship with the outcome you care about, is measured reliably, and doesn't leak information from the future. A poor feature might be irrelevant, noisy, or redundant with another feature that already captures the same information.

There's a well-known saying in Data Science: "features matter more than algorithms" - a simple model with well-chosen features often outperforms a complex model built on poorly chosen ones.

Coming Up Next

Next, you'll learn about Feature Engineering - the process of creating and refining features to get the most out of your data.

Ready to Master Data Science?

Join Uncodemy's Data Science Course and build real, job-ready skills with expert mentors.

Explore Course