Catalog PyPI
PACKAGE EXPLORERView in registry

aa-prepflow

PyPI
Versions collected1
Direct dependencies10From release 0.1.1
Last observed20 Oct, 17:01 UTC

README

Version 0.1.1 documentation

AA Library Preparation Flow

Integrated preprocessing tool combining an interactive UI/UX interface and a modular Python library to simplify data cleaning and exploration — allowing both visual experimentation and direct implementation to ensure efficient, consistent, and scalable preprocessing workflows.

1. Installation & Import

pip install aa_prepflow
import pandas as pd
import numpy as np
from aa_prepflow import AAPrepflowCrossSection, AAPrepflowTimeSeries, AAPrepflowPanel, AAPrepflowBase

2. API Function

A. Direct Method (Quick)

Use this method for quick exploration. This method combines fit and transform in a single call.

# 1. Initialize Flow based on data type
flow_cs = AAPrepflowCrossSection(data_cs)
flow_ts = AAPrepflowTimeSeries(data_ts, col_time='date')
flow_panel = AAPrepflowPanel(data_panel, col_time='date', group_by='city')

# 2. Handling Missing Value (replace <method_name> from the table below)
data_cleaned = flow_cs.mv.clean_<method_name>()

# 3. Handling Outlier (replace <method_name> from the table below)
data_cleaned = flow_ts.outlier.apply_<method_name>()

B. Fit/Transform Method (Production Ready)

Use this pattern for production pipelines so you can fit on training data and transform on both training and testing data separately.

# 1. Initialize Flow with TRAINING data
flow = AAPrepflowTimeSeries(data_train_ts, col_time='date')

# 2. FIT on TRAINING data
# Learn parameters from train data (e.g.: median, IQR bounds, etc.)
flow.mv.fit_<method_name>()
flow.outlier.fit_<method_tame>()

# 3. TRANSFORM on Train and Test data
# Apply the learned parameters

# --- Transform Train Data ---
# (Using internal fitted data)
cleaned_train = flow.mv.transform()
cleaned_train = flow.outlier.transform_<handler_name>(cleaned_train)

# --- Transform Test Data ---
# (Using external test data)
cleaned_test = flow.mv.transform(test_data)
cleaned_test = flow.outlier.transform_<handler_name>(cleaned_test)

3. API Interactive Lab (Gradio)

You can launch an interactive lab to visually test strategies.

A. Lab with DataFrame

This method will directly load your data into the Gradio application.

# Initialize with data, group_by, and col_time
lab = AAPrepflowBase(data=df_panel, group_by='City', col_time='Date')

# Launch Interactive Lab
lab.flow_lab()

B. Lab without DataFrame

This method will launch an empty Gradio application, and you can upload a CSV file from the browser.

# Initialize AAPrepflowBase
lab = AAPrepflowBase()

# Launch Interactive Lab
lab.flow_lab()

4. API Reference <method_name>

Use the method names from the following table to replace <...> in the code examples above.

A. Missing Value (.mv)

Data TypeMethod (Quick)Method (Fit)Strategy Description
Cross-Sectionclean_listwise_deletionfit_listwise_deletionRemove rows with NA.
clean_mean_median_mode_imputerfit_mean_median_mode_imputerFill with mean, median, or mode.
clean_hot_deck_imputerfit_hot_deck_imputerFill with a random sample.
clean_regression_imputerfit_regression_imputerFill with regression prediction.
clean_knn_imputerfit_knn_imputerFill with K-Nearest Neighbors.
Time-Series / Panelclean_locffit_locfLast Observation Carried Forward.
clean_nocbfit_nocbNext Observation Carried Backward.
clean_interpolationfit_interpolationInterpolation (e.g.: linear).
clean_seasonal_imputerfit_seasonal_imputerFill with seasonal average.
clean_arima_imputerfit_arima_imputerFill with ARIMA prediction.
clean_kalman_imputerfit_kalman_imputerFill with Kalman Filter.
clean_moving_average_imputerfit_moving_average_imputerFill with MA average.
clean_cagr_imputerfit_cagr_imputerFill with geometric interpolation.

B. Outlier (.outlier)

Step 1: Detection (Quick apply_... or Fit fit_...)

Data TypeMethod (Quick)Method (Fit)Detection Description
Cross-Sectionapply_iqr_...fit_iqrInterquartile Range (IQR).
apply_zscore_...fit_zscoreZ-Score (Standard Deviation).
Time-Series / Panelapply_iqr_...fit_iqrInterquartile Range (IQR).
apply_zscore_...fit_zscoreZ-Score (Standard Deviation).
apply_rolling_iqr_...fit_rolling_iqrRolling IQR (adaptive).

Step 2: Handling (Quick ..._capping or Transform transform_...)

Method (Quick)Method (Transform)Handling Description
apply_..._cappingtransform_cappingReplace outlier with the boundary value.
apply_..._imputationtransform_imputationReplace outlier with 'mean'/'median'.
apply_..._locftransform_locfReplace outlier with the last valid value.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.117 Nov 202510

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:600cc42581064e87c3a347c2ddc1bc0c4de88db4ded92d59c5759cfae33fe7c2