Sitemap
Rina Mondal

Rina Mondal

I truly enjoy writing articles. If you appreciate my hard work, please follow me. Your encouragement helps me continue pursuing my passion.

Member-only story

Log Transformation, Min Max Scaling and Standard Scaling in Machine Learning

3 min readDec 21, 2023
Press enter or click to view image in full size
Feature Transformation

Feature transformation is a part of Feature Engineering, a crucial step in the machine learning pipeline. It involves modifying the representation of features to make them more suitable for modeling.

  1. Log normalization: Some models do not handle continuous variables with skewed distributions very well. Log normalization is a transformation technique dealing with data that exhibits right-skewed or positively skewed distributions. This method involves taking the logarithm of each data point, resulting in a more symmetrical distribution making the data better for modelling. The below described graph will show how log normalization helps in removing the skewed.
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

# Sample data with right-skewed distribution
data = np.array([1, 10, 100, 1000, 10000])

# Set up the figure
plt.figure(figsize=(8, 5))

# KDE plot for log-normalized data
sns.kdeplot(data, color='green', fill=True, label='Unnormalized Data')


# Log normalize the data
log_normalized_data = np.log(data)

# Set up the figure
plt.figure(figsize=(8, 5))

# KDE plot for log-normalized data
sns.kdeplot(log_normalized_data, color='green', fill=True, label='Log-normalized Data')

# Add labels and title
plt.xlabel('Log-normalized Values')
plt.ylabel('Probability Density')…

--

--

Rina Mondal
Rina Mondal

Written by Rina Mondal

I truly enjoy writing articles. If you appreciate my hard work, please follow me. Your encouragement helps me continue pursuing my passion.