MaxAbs

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

Bases: object

About this algorithm

Description:

MaxAbs is a normalization technique that scales each feature by its maximum absolute value. It is particularly useful when features contain both positive and negative values, ensuring all values lie within the range [-1, 1]. This class also tracks runtime and memory usage.

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

Attributes:
  • df (pd.DataFrame) – Original DataFrame with standardized column names.

  • normalizedDF (pd.DataFrame) – Output DataFrame after MaxAbs scaling.

  • startTime, endTime (float) – Time tracking variables.

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

Execution methods

Calling from a Python program

import pandas as pd

from geoanalytics.normalization import MaxAbs

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

scaler = MaxAbs(df)

normalized_df = scaler.run()

scaler.getRuntime()

scaler.getMemoryUSS()

scaler.getMemoryRSS()

scaler.save("MaxAbs.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]

Executes the MaxAbs scaling normalization on the dataset.

Returns:

DataFrame containing ‘x’, ‘y’, and MaxAbs-normalized feature values.

Return type:

pd.DataFrame

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

Saves the Normalized DataFrame to a CSV file.