UnitVector
- class geoanalytics.normalization.UnitVector.UnitVector(dataframe)[source]
Bases:
objectAbout this algorithm
- Description:
UnitVector performs feature normalization by scaling each row (feature vector) of the dataset to have unit L2 norm (i.e., the sum of squares of each row equals 1). This normalization is useful when you want to normalize across rows (samples) rather than columns (features), such as in cosine similarity or direction-based analyses.
- Parameters:
dataframe (pd.DataFrame): Input DataFrame containing ‘x’, ‘y’ coordinates and feature values.
- Attributes:
df (pd.DataFrame): The original DataFrame with standardized column headers (‘x’, ‘y’, …features).
normalizedDF (pd.DataFrame): The L2-normalized output DataFrame.
startTime, endTime (float): Runtime tracking timestamps.
memoryUSS, memoryRSS (float): Memory consumption statistics in kilobytes.
Execution methods
Calling from a Python program
import pandas as pd from geoanalytics.normalization import UnitVector df = pd.read_csv("input.csv") transformer = UnitVector(df) normalized_df = transformer.run() transformer.getRuntime() transformer.getMemoryUSS() transformer.getMemoryRSS() transformer.save("UnitVector.csv")
Credits
Developed by Raashika and M. Charan Teja, under the guidance of Professor Rage Uday Kiran.