Different features often arrive wearing wildly different units: CPU speed in GHz, memory in GB, and storage in GB. Min-max normalization puts them on a common scale so comparisons and visualizations do not let the biggest numbers steal the show. section 6.11
For one feature, find its minimum and maximum, then calculate: (original value − minimum) / (maximum − minimum). The result normally falls between 0 and 1: the minimum becomes 0 and the maximum becomes 1. Relationships and proportions remain available, while the original units disappear. section 6.11
Use min-max normalization when:
- Comparing features measured in different units or placing them on one graph. section 6.11
- Preparing inputs for methods sensitive to feature scale, including neural networks, k-means clustering, and support vector machines. section 6.11
- Remember that normalized lines share endpoints at 0 and 1, so the plot can hide which series grew faster in absolute terms. section 6.13
A normalized hardware trend
A time-series dataset tracks server component specifications by year. Keeping Year unchanged, normalize the other columns and plot them together. The resulting chart can reveal broad trends, such as limited storage growth between roughly 2009 and 2013, but it cannot show absolute growth rates reliably. If the numbers came from an AI-generated dataset, verify them before trusting the conclusion. section 6.13
Listing 6.2 Visualizing a time series with normalization
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.preprocessing import MinMaxScaler
df_servers = pd.read_csv("AllServers.csv")
years = df_servers['Year'].values #1
scaler = MinMaxScaler()
normalized_data = scaler.fit_transform\
(df_servers.drop(columns=['Year']))
plt.figure(figsize=(10, 6)) #2
for i, column_name in enumerate(df_servers.columns[1:]):
plt.plot(years, normalized_data[:, i], label=column_name) #3
plt.xlabel('Year') #4
plt.ylabel('Normalized Values') #4
plt.title('"All Servers" (Normalized) Specs Over Time') #4
plt.legend() #5
plt.grid(True)
plt.show() #6
A runnable Python listing loads CSV data, applies scikit-learn's MinMaxScaler to non-year columns, and plots the normalized series with Matplotlib. section 6.13



