ZScore

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

Bases: object

About this algorithm

Description:

ZScore normalization (also called standard score normalization) scales each feature so that it has a mean of 0 and a standard deviation of 1. This is useful when features are normally distributed and ensures that each contributes equally to distance-based models.

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

Attributes:
  • df (pd.DataFrame): Input DataFrame with standardized columns (‘x’, ‘y’, …features).

  • normalizedDF (pd.DataFrame): Output DataFrame after z-score normalization.

  • startTime, endTime (float): Time tracking for execution.

  • memoryUSS, memoryRSS (float): Memory usage metrics in kilobytes.

Execution methods

Calling from a Python program

import pandas as pd

from geoanalytics.normalization import ZScore

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

normalizer = ZScore(df)

normalized_df = normalizer.run()

normalizer.getRuntime()

normalizer.getMemoryUSS()

normalizer.getMemoryRSS()

normalizer.save("ZScore.csv")

Credits

Developed by Raashika and 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 Z-Score normalization to the dataset.

Returns:

DataFrame with ‘x’, ‘y’, and normalized feature columns.

Return type:

pd.DataFrame

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

Saves the Normalized DataFrame to a CSV file.