AI Data Augmentor 🚀 https://aidataaug.streamlit.app/
A Streamlit app that enhances small datasets by generating synthetic rows using AI models like OpenAI's GPT-4 and DeepSeek r-1, and by imputing missing values in numeric columns using KNN imputation. The app intelligently detects ID columns, ensures consistent data formatting, and handles missing data, making it perfect for comprehensive dataset augmentation.
✅ Upload a CSV file for data augmentation
✅ Choose between:
- Adding Synthetic Rows using AI models 🤖
✅ Automatically detect and increment ID columns
✅ Maintain data types and formats dynamically
✅ Download the augmented dataset as a CSV file
- Replacing Null Values in numeric columns using KNN Imputation 🔄
Ensure you have Python 3.7+ installed.
-
Clone the repository:
git clone https://github.com/your-username/ai_data_augmentor.git cd ai_data_augmentor -
Activate venv & install the required dependencies:
venv\Scripts\activate pip install -r requirements.txt
-
Set up your API keys:
- OpenAI GPT-4:
- Create a
.streamlit/secrets.tomlfile and add your OpenAI API key:[openai] api_key = "your-openai-api-key"
- Create a
- DeepSeek r-1:
- Add your DeepSeek API key:
[deepseek] api_key = "your-deepseek-api-key"
- Add your DeepSeek API key:
- OpenAI GPT-4:
-
Run the Streamlit app:
streamlit run ai_data_augmentor.py
-
Open your browser and navigate to the local URL provided in the terminal.
- Upload a CSV file 📂
- Choose a task:
- Add Synthetic Rows: Generate new rows using AI models 🤖
- Replace Nulls with KNN Imputation: Automatically impute missing values 🔄
- Specify parameters (e.g., number of rows to add or neighbors for KNN)
- The app detects any ID columns and manages data types dynamically
- Preview the augmented dataset and download the results
After processing, the app displays:
- Original Dataset: Preview of the uploaded CSV file
- Augmented Dataset: Original data with synthetic rows or imputed values
- Download Option: Button to download the modified CSV file
- File Upload:
st.file_uploader()for CSV input - Task Selection: Choose between synthetic row generation or KNN imputation
- ID Detection:
- Detects ID columns if:
- The column name contains "id" (case-insensitive)
- The column is of integer type
- Detects ID columns if:
- Synthetic Data Generation:
- The
generate_synthetic_data()function uses AI models to create new rows
- The
- KNN Imputation:
- The
knn_impute()function replaces missing values in numeric columns using K-Nearest Neighbors - Includes a pre-check to ensure null values exist before imputation
- The
- Download Button: Provides a CSV download link for the augmented dataset
- The app automatically detects ID columns and increments them when generating new rows.
- Ensure your API keys for OpenAI and DeepSeek are correctly configured in
.streamlit/secrets.toml. - The app will skip KNN imputation if no null values are detected in numeric columns.
- If no ID column is detected, the app will append rows without modifying any columns.
This project is licensed under the MIT License.
Enjoy augmenting and cleaning your datasets with AI & ML! 🚀