RootTransformation

class geoanalytics.normalization.RootTransformation.RootTransformation(dataframe, root=2)[source]

Bases: object

About this algorithm

Description:

RootTransformation applies a root-based transformation to all feature values in the input dataset. This is useful for reducing the effect of large outliers and compressing the range of high magnitude values. For example, a square root (root=2) transformation is commonly used to stabilize variance in skewed datasets.

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

  • root (int, optional): Degree of the root transformation. Defaults to 2 (square root).

Attributes:
  • df (pd.DataFrame): Original input DataFrame with renamed first two columns as ‘x’ and ‘y’.

  • normalizedDF (pd.DataFrame): DataFrame containing root-transformed features.

  • startTime, endTime (float): Execution timestamps.

  • memoryUSS, memoryRSS (float): Memory usage statistics in KB.

Execution methods

Calling from a Python program

import pandas as pd

from geoanalytics.normalization import RootTransformation

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

transformer = RootTransformation(df, root=3)

normalized_df = transformer.run()

transformer.getRuntime()

transformer.getMemoryUSS()

transformer.getMemoryRSS()

transformer.save("RootTransformation.csv")

Credits

Developed by Raashika and M. Charan Teja, supervised by 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]

Executes the root transformation on the dataset.

Returns:

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

Return type:

pd.DataFrame

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

Saves the Normalized DataFrame to a CSV file.