What Is a Dataset? Understanding Features and Target Variables

When beginners start learning machine learning, they often hear words such as dataset, features, variables, inputs and targets. These terms may sound technical, but they describe a simple idea: using information we already know to understand or predict an outcome.

Before selecting an algorithm or writing any code, you must first understand how a dataset is organized. You should be able to identify what each row represents, what information is stored in each column, which columns can be used as inputs and which column contains the result you want to predict.

In this beginner-friendly guide, we will first use a familiar student-result example to understand these concepts in simple language. We will then apply the same idea to a technical customer-churn dataset and learn how independent features help a machine-learning model predict a target variable.

Start with a Simple Everyday Example

Imagine that a teacher wants to understand what may affect a student’s final examination result.

The teacher collects the following information:

Student Study Hours Attendance Assignments Completed Final Result
Student A 8 95% 10 Pass
Student B 2 60% 4 Fail
Student C 6 88% 9 Pass
Student D 1 50% 3 Fail
Simple Meaning

This organized table of student information is called a dataset.

What Is a Dataset?

A dataset is an organized collection of related information. It usually contains rows, columns and values.

A dataset can be stored in different formats, such as:

  • CSV file
  • Excel spreadsheet
  • SQL database
  • JSON file
  • Text file
  • Online business application
What Does Each Row Represent?

A row represents one individual record or observation.

In the student dataset, each row represents one student.

Example: Student B
  • Studied for two hours
  • Had 60% attendance
  • Completed four assignments
  • Failed the final examination
Dataset Each Row Represents
Student dataset One student
Sales dataset One order
Employee dataset One employee
Healthcare dataset One patient
Housing dataset One property
Always ask: What does each row represent? If you cannot answer this question, you are not ready to analyze the dataset.
What Does Each Column Represent?

A column represents one type of information collected about every record.

Column Meaning
Student Identifies the student
Study Hours Number of hours studied
Attendance Percentage of classes attended
Assignments Completed Number of assignments completed
Final Result Whether the student passed or failed

A column may also be called a:

  • Variable
  • Attribute
  • Field
  • Feature
What Is a Value?

A value is the information stored where a row and column meet.

Values for Student B
Study Hours = 2
Attendance = 60%
Assignments Completed = 4
Final Result = Fail

Columns describe the type of information, while values contain the actual information for each record.

What Are Independent Variables?

Imagine that the teacher wants to predict whether a new student will pass or fail.

The teacher may use:

  • Study hours
  • Attendance
  • Assignments completed

These are called independent variables because they provide information that may help explain or predict the final result.

Independent variables are also called:

  • Input variables
  • Predictor variables
  • Features
  • X variables
You can think of independent variables as the information we already know and give to the model.
What Is a Dependent Variable?

The dependent variable is the result we want to understand or predict.

In the student example, the dependent variable is:

Final Result = Pass or Fail

It is called dependent because the final result may depend on information such as study hours, attendance and completed assignments.

The dependent variable is also called:

  • Target variable
  • Output variable
  • Response variable
  • Label
  • y variable
You can think of the dependent variable as the answer we want the model to predict.
Independent vs Dependent Variables
Independent Variables Dependent Variable
Information used to make a prediction Result we want to predict
Model inputs Model output
Features Target
Represented by X Represented by y
Study hours, attendance and assignments Final result
Independent Variables (X)
Prediction Process
Dependent Variable (y)
How Would This Work for a New Student?

Suppose a new student has:

  • Seven study hours
  • 92% attendance
  • Nine completed assignments

The historical dataset shows that students with similar information generally passed.

Predicted Final Result = Pass
This does not guarantee that the student will pass. It is only a prediction based on patterns found in previous records.
Connecting the Idea to a Technical Dataset

Now let us apply the same concept to a business machine-learning project.

Imagine that a subscription company wants to predict which customers may cancel their subscriptions. Cancelling a subscription is called customer churn.

Customer ID Tenure Monthly Charges Contract Type Support Calls Churn
C101 24 $59 One Year 1 No
C102 3 $95 Month-to-Month 5 Yes
C103 18 $70 One Year 2 No
C104 2 $105 Month-to-Month 6 Yes
Understanding This Dataset
  • Each row represents one customer.
  • Each column contains one type of customer information.
  • Churn shows whether the customer cancelled.
Identify the Independent Features

The company may use the following features to predict churn:

Independent Feature What It Tells Us
Tenure How long the customer has stayed
Monthly Charges How much the customer pays
Contract Type The customer’s subscription agreement
Support Calls How often the customer requested help
X = Tenure + Monthly Charges + Contract Type + Support Calls
Identify the Dependent Variable

The company wants to predict whether a customer will cancel.

Therefore, the dependent or target variable is:

y = Churn
Churn Value Meaning
No The customer stayed
Yes The customer cancelled
Customer Features (X)
Machine-Learning Model
Churn Prediction (y)
How Does the Model Use These Features?

During training, the model receives historical customer features and the known churn result.

3 months + $95 + Month-to-Month + 5 calls → Churned

24 months + $59 + One-Year + 1 call → Stayed

The model examines many records and learns patterns. It can then receive information about a new customer:

2 months + $100 + Month-to-Month + 6 calls

The model may predict:

High likelihood of churn

The company can use this prediction to decide whether to contact the customer or offer additional support.

Different Types of Features
Numerical Features

Numerical features contain measurable or countable numbers.

  • Study hours
  • Age
  • Salary
  • Product price
  • Monthly charges
  • Number of support calls
Categorical Features

Categorical features contain groups or labels.

  • Contract type
  • Payment method
  • Product category
  • Membership level
  • City
Date and Time Features
  • Order date
  • Registration date
  • Delivery time
  • Appointment date
Text Features
  • Customer reviews
  • Support messages
  • Product descriptions
  • Email content
Is Every Column a Useful Feature?

No. Every column should not automatically be given to the model.

A customer ID identifies a customer, but it may not explain why that customer churned. A customer’s name may also be unnecessary and could create privacy concerns.

Before selecting a feature, ask:

  • Does this column help answer the problem?
  • Will this information be available when making a future prediction?
  • Is the column only an identifier?
  • Does it contain private or sensitive information?
  • Could it create unfair predictions?
  • Does it reveal the answer directly?
A column should be selected because it is meaningful—not simply because it exists in the dataset.
How Are Features and Targets Used?
During Model Training
Features
+
Known Target
Model Learns Patterns
After Model Training
New Features
Trained Model
Predicted Target
Different Problems Have Different Targets
Classification

Classification predicts a category.

Project Target
Customer-churn prediction Yes or No
Student-result prediction Pass or Fail
Loan decision Approved or Rejected
Email detection Spam or Not Spam
Regression

Regression predicts a numerical value.

Project Target
House-price prediction Property price
Sales forecasting Sales amount
Delivery-time prediction Number of minutes
Salary estimation Salary amount
What If the Dataset Has No Target?

Not every machine-learning dataset contains a target.

For example, a company may want to group customers based on similar purchasing habits. The dataset may contain:

  • Number of purchases
  • Average order value
  • Shopping frequency
  • Product preferences

The company does not already know the groups. The model discovers them by finding similarities in the data. This is called clustering.

Supervised learning: The dataset contains a target.
Unsupervised learning: The dataset does not contain a target.
Questions to Ask When Reviewing a Dataset
  1. What does each row represent?
  2. What does each column represent?
  3. What problem are we trying to solve?
  4. What is the target variable?
  5. Which columns may help predict the target?
  6. Which columns are only identifiers?
  7. Are important values missing?
  8. Will these features be available when making a prediction?
  9. Does any column reveal the answer?
  10. Do we have permission to use this data?
Final Takeaway
  • A dataset is an organized collection of information.
  • A row represents one record or observation.
  • A column represents one type of information.
  • A feature is information used to make a prediction.
  • An independent variable (X) is a model input.
  • A dependent variable (y) is the result we want to predict.
  • The dependent variable is also called the target variable.
  • Not every dataset column should be used as a feature.
Independent Features (X)
Machine-Learning Model
Target Prediction (y)

Once you understand this relationship, learning how a machine-learning model is trained and evaluated becomes much easier.