DecimalScaling

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

Bases: object

About this algorithm

Description:

DecimalScaling is a normalization technique that transforms features by dividing them by powers of 10 based on the maximum absolute value. This class normalizes all feature columns (excluding coordinates) to scale them within a decimal range, while also tracking memory usage and execution time.

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

Attributes:
  • df (pd.DataFrame) – Original DataFrame with renamed columns.

  • normalizedDF (pd.DataFrame) – DataFrame after normalization.

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

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

Execution methods

Calling from a Python program

import pandas as pd

from geoanalytics.normalization import DecimalScaling

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

scaler = DecimalScaling(df)

normalized_df = scaler.run()

scaler.getRuntime()

scaler.getMemoryUSS()

scaler.getMemoryRSS()

scaler.save("DecimalScaling.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 Decimal Scaling normalization to the input features.

Returns:

Normalized DataFrame with ‘x’, ‘y’, and scaled features.

Return type:

pd.DataFrame

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

Saves the Normalized DataFrame to a CSV file.