You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
miner/frontend/pages/normalization.py

33 lines
1.0 KiB

import streamlit as st
from normstrategy import MVStrategy, ScalingStrategy
if "data" in st.session_state:
data = st.session_state.original_data
st.session_state.original_data = data.copy()
for column, series in data.items():
col1, col2 = st.columns(2)
missing_count = series.isna().sum()
choices = MVStrategy.list_available(data, series)
option = col1.selectbox(
f"Missing values of {column} ({missing_count})",
choices,
index=1,
key=f"mv-{column}",
)
# Always re-get the series to avoid reusing an invalidated series pointer
data = option.apply(data, column, data[column])
choices = ScalingStrategy.list_available(data, series)
option = col2.selectbox(
"Scaling",
choices,
key=f"scaling-{column}",
)
data = option.apply(data, column, data[column])
st.write(data)
st.session_state.data = data
else:
st.error("file not loaded")