LogTransformation

class geoanalytics.normalization.LogTransformation.LogTransformation(dataframe)[source]

Bases: object

About this algorithm

Description:

LogTransformation applies logarithmic normalization to numerical features (excluding ‘x’ and ‘y’ coordinates), which can be useful for reducing skewness in data and compressing wide value ranges. The transformation uses the natural logarithm function as log(1 + x) to handle zero and positive values.

Parameters:
  • dataframe (pd.DataFrame): Input DataFrame containing ‘x’, ‘y’, and feature columns.

Attributes:
  • df (pd.DataFrame) – Original DataFrame with updated column labels.

  • normalizedDF (pd.DataFrame) – DataFrame after applying log transformation.

  • startTime, endTime (float) – Timestamps used for runtime measurement.

  • memoryUSS, memoryRSS (float) – Memory usage statistics (USS and RSS) in kilobytes.

Execution methods

Calling from a Python program

import pandas as pd

from geoanalytics.normalization import LogTransformation

df = pd.read_csv("input.csv")

transformer = LogTransformation(df)

normalized_df = transformer.run()

transformer.getRuntime()

transformer.getMemoryUSS()

transformer.getMemoryRSS()

transformer.save("LogTransformation.csv")

Credits

This implementation was created by Raashika and revised by M. Charan Teja under the guidance of Professor Rage Uday Kiran.

getMemoryRSS()[source]

Prints the memory usage (RSS) of the process in kilobytes.

getMemoryUSS()[source]

Prints the memory usage (USS) of the process in kilobytes.

getRuntime()[source]

Prints the total runtime of the clustering algorithm.

run()[source]

Applies natural log transformation to the feature columns using log1p (log(1 + x)).

Returns:

Normalized DataFrame with ‘x’, ‘y’, and log-transformed features.

Return type:

pd.DataFrame

save(outputFile='LogTransformation.csv')[source]

Saves the Normalized DataFrame to a CSV file.