Data Selection in Data Mining

Yo Yogesh.M Updated 24 Oct 2026
9 min read ·Lesson 48 of 50
In this post

Before any algorithm runs, a more basic decision has already shaped what that algorithm can possibly discover: which data got collected in the first place. Data selection is the process of choosing th

Before any algorithm runs, a more basic decision has already shaped what that algorithm can possibly discover: which data got collected in the first place. Data selection is the process of choosing the right type of data, the right source for it, and the right tools to collect it, before a data mining project begins. It happens earlier in the pipeline than the data cleaning and preprocessing steps covered elsewhere in this series — those techniques can only work with the data that selection decided to bring in. If the wrong data was selected, no amount of later cleaning or clever modeling can recover information that was simply never captured.

Why the Selection Decision Matters So Much

The quality of every downstream result — a classification model's accuracy, a discovered association rule, a comparison between two groups — is bounded by the quality of the data selection decision behind it. A pattern the data mining algorithm reports as "true" is only true of the data it was given; if that data is not representative of the situation it is meant to describe, the pattern can be confidently wrong. This is worth seeing directly rather than taking on faith. Consider a telecom company trying to estimate its overall customer churn rate, where the true (unknown to the company) churn rate across its full 10,000-customer base is:

import numpy as np
np.random.seed(3)
# ... population simulated with churn correlated to region
print("True population churn rate:", round(true_rate, 4))

Output:

True population churn rate: 0.2316

Now compare two ways of estimating that rate from a sample of 500 customers. A convenience sample — surveying only customers who are easy to reach, such as those already active on an urban customer portal — gives:

Convenience sample (urban only) estimated churn rate: 0.126

A representative random sample, drawn without regard to region, gives:

Representative random sample estimated churn rate: 0.244

The representative sample lands close to the true rate of 0.2316. The convenience sample is off by nearly half, because it silently excluded rural customers, who happen to churn at a much higher rate in this data. Nothing about the convenience sample was dishonest or obviously broken — it is a real sample of real customers — but it answers a different, narrower question than the one being asked, and nothing in the data itself flags that mismatch. This is exactly the risk the source material for this lesson is warning against: choosing data because it is cheap or convenient to collect, rather than because it can actually answer the question at hand, quietly degrades the reliability of every result built on top of it.

What Data Selection Depends On

Choosing the right data is not a single checklist item but a judgment shaped by several factors together:

  • The purpose of the study — the specific question being asked determines what data could possibly answer it; a churn-prediction project needs behavioral and usage data, not just demographic data.
  • Prior research — existing literature or previous internal analysis often reveals which variables have mattered in similar problems before, narrowing the search.
  • Availability of data — some data that would be ideal to have simply does not exist yet or cannot be ethically or practically collected, which forces a choice between the ideal dataset and the best realistically obtainable one.

Types of Data to Select From

Quantitative data is numerical — temperature, height, voltage, transaction amount — and supports direct calculation and statistical analysis. Qualitative data is non-numerical — text, images, video, or observational notes — and is used to understand behavior, context, or patterns that numbers alone do not capture. Many real projects deliberately select both: a retail churn study might combine quantitative purchase histories with qualitative customer support transcripts, because each type answers questions the other cannot.

Data can be gathered from human observation, controlled experiments, field notes or journals, laboratory results, or direct observation of people, animals, or physical processes — the right source depends entirely on which of these actually captures the phenomenon the study needs to measure.

Questions Worth Asking Before Selecting Data

  • What is the research question, precisely?
  • What is the scope of the study — which population, time period, or conditions does it need to cover?
  • What type of data is actually needed: quantitative, qualitative, or both?
  • What do prior studies suggest about which variables matter?
  • Is the data that would ideally answer the question actually available, and if not, what is the best available substitute?

Feature Selection: Choosing Which Columns Matter

Once a dataset has been selected, a second and more granular decision remains: which of its columns (features) are actually worth including in a model. Feature selection is the process of identifying the most useful variables in a dataset and discarding the rest, and it operates inside a dataset that has already been chosen — it is a narrower, more mechanical decision than data selection, but it follows the same underlying logic: not all available information is equally useful for answering the question at hand.

A doctor deciding whether a patient needs surgery does not weigh every test result in the patient's chart equally — years-old, unrelated lab values are set aside in favor of the specific tests that bear directly on the current decision. Feature selection formalizes that same instinct for an algorithm: score every available feature, keep the ones that carry real signal, and drop the ones that do not.

Why This Matters in Practice

Without feature selection, three problems compound: too many features slow down processing without necessarily improving results; noisy or duplicate features can actively reduce accuracy by giving a model conflicting or redundant signals to fit; and high-dimensional data (many features relative to the number of records) requires disproportionately more training data to learn reliably, a problem sometimes called the curse of dimensionality. Feature selection addresses all three at once — fewer features means faster processing, fewer chances for noise to mislead the model, and less training data needed to fit the remaining features reliably.

Scoring a Feature: A Worked Example With Entropy

The most common way to score how useful a feature is relies on entropy — a measure of how much uncertainty exists in a variable, defined as:

H(X) = -Σ P(x) log₂ P(x)

A variable with two roughly equally likely outcomes has high entropy (close to 1 bit) because its outcome is hard to predict in advance; a variable that is almost always one value has low entropy because there is little uncertainty left to resolve. Feature selection uses this idea by measuring information gain: how much a feature reduces the uncertainty about the target variable once its value is known. A feature that sorts records cleanly into "mostly yes" and "mostly no" groups has high information gain; a feature that leaves the mix roughly unchanged in every group has low information gain.

Take a small loan-approval dataset with a binary target (default: yes/no) and two candidate features:

import pandas as pd
import numpy as np

data = pd.DataFrame({
    "income_level": ["low","low","high","high","low","high","low","high","high","low"],
    "owns_car":     ["no","no","yes","no","no","yes","yes","yes","no","no"],
    "default":      ["yes","yes","no","yes","yes","no","no","no","no","yes"]
})

def entropy(labels):
    vals, counts = np.unique(labels, return_counts=True)
    p = counts / counts.sum()
    return -np.sum(p * np.log2(p))

def info_gain(df, feature, target):
    H_total = entropy(df[target])
    weighted = sum((len(sub)/len(df)) * entropy(sub[target]) for _, sub in df.groupby(feature))
    return H_total - weighted

print("H(default):", round(entropy(data["default"]), 4))
print("info gain from income_level:", round(info_gain(data, "income_level", "default"), 4))
print("info gain from owns_car:", round(info_gain(data, "owns_car", "default"), 4))

Output:

H(default): 1.0
info gain from income_level: 0.2781
info gain from owns_car: 0.61

The target starts with maximum uncertainty (entropy of 1.0, since defaults and non-defaults are evenly split in this data). Splitting on owns_car reduces that uncertainty far more (an information gain of 0.61) than splitting on income_level does (0.2781) — in this data, owning a car happens to separate defaulters from non-defaulters more cleanly than income level does. A feature-selection process built on this idea would rank owns_car as the more useful feature and could discard income_level first if only one feature were being kept. This is the concrete mechanism behind what the lesson's source material calls an "interestingness score": a feature scores as interesting precisely to the extent that knowing its value reduces uncertainty about the outcome being predicted.

Feature Selection in Practice: Supervised vs. Unsupervised

Supervised feature selection uses labeled data — records where the true outcome (like default above) is already known — and scores features by how well they predict that known label, exactly as the entropy example did. Unsupervised feature selection has no labels to work from at all; its goal instead is to find the features that produce the most meaningful grouping (clustering) of the data, since there is no "correct answer" column to measure information gain against.

Other Scoring Methods Used in Real Systems

Entropy-based information gain is one scoring method among several used by real feature-selection implementations. Bayesian methods using the K2 algorithm score features by how well they fit into a learned network of probabilistic relationships between variables, and tend to work well on structured, tabular data. Bayesian Dirichlet scoring (BDE) takes a related probabilistic approach, treating prior assumptions about the data as equally weighted unless evidence suggests otherwise. These, alongside entropy-based scoring, are the methods implemented in feature-selection systems such as Microsoft SQL Server's data mining feature-selection algorithm, where feature selection runs automatically before a model is trained, scoring every candidate feature and keeping only those above the threshold set by the modeler.

Systems like this expose direct parameters for controlling how aggressively selection is applied: a maximum count on the number of input features retained, a maximum count on output features, and a maximum number of distinct values (states) a feature is allowed to have before it is excluded outright — a categorical feature with thousands of near-unique values is rarely a useful predictor and is filtered out on that basis alone. Setting the states limit to zero effectively disables feature selection, letting every available feature through unfiltered.

How Data Selection and Feature Selection Relate

Data selection decides what gets collected in the first place — which population, which variables, which sources — and it is the layer where a flawed decision (like the convenience-sample example above) does the most damage, because no later step can add back information that selection never captured. Feature selection operates one layer down, deciding which of the already-collected columns are worth keeping for a specific model. Getting data selection right is what makes the dataset trustworthy; getting feature selection right is what makes a model built on that dataset accurate and efficient. Neither step can compensate for a failure in the other.

0 Comments

Reviewed before they appear

No comments yet.

Data Mining
Introduction to Data Mining Data Mining Implementation Process Data Mining Architecture Data Mining Techniques KDD: Knowledge Discovery in Databases History of Data Mining Data Mining Tools Data Mining vs Machine Learning Facebook Data Mining Social Media Data Mining Methods Clustering in Data Mining Text Data Mining Bagging vs Boosting Data Mining vs Data Warehousing Social Media Data Mining Data Mining: Bayesian Classifiers Data Mining: World Wide Web Different Types of Clustering Bitcoin Mining and Blockchain Data Mining Orange Data Mining Data Mining vs Big Data Decision Tree Induction Educational Data Mining Data Mining in Healthcare Apriori Algorithm Data Integration in Data Mining Difference Between Data Mining and Text Mining Discretization in Data Mining Redundancy and Correlation in Data Mining Classification of Data Mining Systems Classification Algorithms in Data Mining Data Generalization in Data Mining Classification and Prediction in Data Mining Regression in Data Mining What Is an Outlier in Data Mining Data Cleaning in Data Mining Data Processing in Data Mining Data Mining Task Primitives Web Content Mining, Web Structure Mining, and Web Usage Mining Binning in Data Mining KDD vs. Data Mining Noise in Data Mining BIRCH in Data Mining Stemming in Data Mining Feature Transformation in Data Mining Visual and Audio Data Mining Class Comparison Methods in Data Mining Data Selection in Data Mining Tasks and Functionalities of Data Mining Ubiquitous and Invisible Data Mining
Ask about this post
AI Ask about this post

Ask questions about Data Selection in Data Mining and get answers drawn from it.

Signed-in readers only.