Skip to content
Unknown27sPublic

About

- Automated pre-import validation classifies columns, identifies quality issues (null values, constant columns, low-variance data), and provides actionable recommendations on data suitability for various analysis types. The system assigns quality scores to each column and determines analysis readiness before processing.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

DataAADHAR - Local AI Data Analysis Platform

Secure, Offline, CPU-Optimized Data Intelligence

A comprehensive data analysis and visualization platform powered by local AI, with advanced ML models for forecasting, anomaly detection, and clustering.

Python Version License Status


📋 Table of Contents


✨ Features

Data Processing & Validation

  • Multi-file Support: Upload and analyze multiple CSV/Excel files simultaneously
  • Auto Schema Detection: Automatic detection of data types, date columns, and numeric fields
  • Data Validation: Comprehensive validation before analysis with detailed error reporting
  • Data Sampling: Intelligent sampling for large datasets (supports 200K+ rows)

Advanced Analytics

  • Time Series Forecasting: ARIMA-based predictions with configurable forecast periods
  • Anomaly Detection: Isolation Forest algorithm to identify outliers and unusual patterns
  • Clustering Analysis: K-Means clustering with automatic cluster determination via elbow method
  • Trend Analysis: Change point detection and growth metrics calculation
  • Statistical Analytics: Comprehensive statistical summaries and trend metrics

Visualization

  • Interactive Charts: Plotly-powered interactive visualizations
  • Trend Analysis Plots: Time series trends with forecast overlays
  • Category Comparisons: Bar charts and comparative analytics
  • Cluster Visualization: 2D cluster plots, distribution charts, and pie charts
  • Elbow Curves: Visual optimization for cluster selection

AI-Powered Insights

  • Local LLM Integration: Ollama-based text generation for AI insights
  • Automated Analysis: AI-generated insights based on data characteristics
  • Natural Language Reports: Readable, contextual analysis summaries
  • Offline Processing: All AI operations run locally for privacy and security

User Interface

  • Streamlit Framework: Responsive, modern web interface
  • Sidebar Navigation: Intuitive workflow with sequential analysis steps
  • Real-time Feedback: Progress indicators and status updates
  • Download Reports: Export analysis results and visualizations

🎯 Project Overview

DataAADHAR is a lightweight, privacy-first data analysis platform designed for:

  • Organizations requiring offline data processing
  • Users prioritizing data privacy and security
  • Teams needing rapid data insights without cloud dependencies
  • Researchers and analysts working with time series data

The platform combines traditional statistical methods with modern machine learning to provide comprehensive data intelligence.


🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Ollama (for AI insights) - Install Ollama
  • pip (Python package manager)

5-Minute Setup

# 1. Clone or navigate to project directory
cd "f:\Git floder(Project)\Antigravity projects\DataAADHAR"

# 2. Create virtual environment
python -m venv .venv

# 3. Activate virtual environment
.venv\Scripts\Activate.ps1

# 4. Install dependencies
pip install -r requirements.txt

# 5. Start Ollama service (in another terminal)
ollama serve

# 6. Run the application
streamlit run app.py

The application will open in your browser at http://localhost:8501


📦 Installation

Full Installation Guide

Step 1: Prepare Python Environment

# Navigate to project directory
cd "f:\Git floder(Project)\Antigravity projects\DataAADHAR"

# Create virtual environment
python -m venv .venv

# Activate virtual environment (Windows)
.venv\Scripts\Activate.ps1

# On macOS/Linux:
# source .venv/bin/activate

Step 2: Install Dependencies

# Upgrade pip first
python -m pip install --upgrade pip

# Install all requirements
pip install -r requirements.txt

Key Dependencies:

  • pandas - Data manipulation and analysis
  • numpy - Numerical computing
  • scikit-learn - Machine learning algorithms
  • statsmodels - Statistical modeling
  • pmdarima - Auto ARIMA forecasting
  • streamlit - Web application framework
  • plotly - Interactive visualizations
  • requests - HTTP client for Ollama

Step 3: Configure Ollama

  1. Install Ollama: Download from ollama.ai
  2. Pull a Model:
    ollama pull qwen2.5:1.5b-instruct-q4_0
  3. Start Ollama Server:
    ollama serve
    The service runs on http://localhost:11434 by default

Step 4: Configure Environment (Optional)

Create a .env file in the project root:

OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=qwen2.5:1.5b-instruct-q4_0
OLLAMA_TEMPERATURE=0.3
OLLAMA_TIMEOUT=60

Step 5: Verify Installation

# Test Python environment
python -c "import streamlit; print(f'Streamlit {streamlit.__version__}')"

# Test Ollama connectivity
python tests/verify_backend.py

📁 Project Structure

DataAADHAR/
│
├── 📄 app.py                    # Main Streamlit application
├── 🔧 config.py                 # Centralized configuration
├── 📋 requirements.txt           # Python dependencies
├── .env.example                  # Environment template
│
├── 📚 docs/                      # Documentation
│   ├── guides/                   # User guides and setup
│   │   ├── INSTALLATION.md
│   │   ├── QUICKSTART.md
│   │   ├── AI_FEATURES_GUIDE.md
│   │   ├── DATA_VALIDATION_GUIDE.md
│   │   └── CLUSTER_VISUALIZATION_GUIDE.md
│   ├── reports/                  # Analysis reports
│   │   ├── IMPLEMENTATION_REPORT.md
│   │   ├── CODE_IMPROVEMENTS.md
│   │   └── ANALYSIS_SUMMARY_FOR_REPORT.md
│   ├── architecture/
│   │   └── SYSTEM_ARCHITECTURE_DIAGRAM.txt
│   └── FILE_MANIFEST.md          # File inventory
│
├── 📊 ingestion/                 # Data loading
│   └── loader.py                 # File format handlers
│
├── 🔍 schema/                    # Schema analysis
│   └── analyzer.py               # Data type detection
│
├── ⚙️  decision_engine/          # Analysis routing
│   └── rules.py                  # Auto-selection logic
│
├── 🤖 ml_models/                 # Machine learning algorithms
│   ├── forecasting.py            # ARIMA forecasting
│   ├── anomaly.py                # Anomaly detection
│   ├── clustering.py             # K-Means clustering
│   ├── analytics.py              # Statistical analysis
│   └── __pycache__/
│
├── 📈 visualization/             # Data visualization
│   └── plots.py                  # Plotly visualizations
│
├── 🧠 llm/                       # LLM integration
│   ├── ollama_client.py          # Ollama API client
│   └── exceptions.py             # LLM exceptions
│
├── ✅ utils/                     # Utility functions
│   ├── data_validator.py         # Data validation
│   ├── validators.py             # Validation schemas
│   ├── logger.py                 # Logging utilities
│   └── __pycache__/
│
├── 🧪 tests/                     # Test suite
│   ├── test_data_validation.py
│   ├── test_clustering_speed.py
│   ├── test_pie_chart.py
│   └── verify_backend.py
│
├── 📂 data/                      # Data storage
│   └── uploads/                  # User-uploaded files
│
└── 📝 logs/                      # Application logs

🔧 Core Modules

Ingestion (ingestion/loader.py)

Handles multiple file formats:

  • CSV files with custom delimiters
  • Excel workbooks (.xlsx, .xls)
  • Chunked loading for large files
from ingestion.loader import load_file
df = load_file(uploaded_file)

Schema Analysis (schema/analyzer.py)

Auto-detects data characteristics:

  • Column data types (numeric, categorical, datetime)
  • Date column identification
  • Numeric column detection
  • Statistical summaries
from schema.analyzer import analyze_schema
schema = analyze_schema(df)

Decision Engine (decision_engine/rules.py)

Intelligent analysis routing:

  • Suggests applicable analyses based on data structure
  • Evaluates numeric vs categorical data
  • Determines forecasting suitability
from decision_engine.rules import decide_analysis
recommendations = decide_analysis(schema)

ML Models

Forecasting (ml_models/forecasting.py)

ARIMA-based time series prediction:

from ml_models.forecasting import perform_forecast
forecast_df = perform_forecast(df, date_col, value_col, periods=12)

Anomaly Detection (ml_models/anomaly.py)

Isolation Forest for outlier detection:

from ml_models.anomaly import detect_anomalies
anomalies_df = detect_anomalies(df, contamination=0.1)

Clustering (ml_models/clustering.py)

K-Means clustering with automatic optimization:

from ml_models.clustering import perform_clustering
result = perform_clustering(df, numeric_cols, max_clusters=10)

Analytics (ml_models/analytics.py)

Statistical analysis and trend detection:

from ml_models.analytics import calculate_trend_metrics, detect_change_points
metrics = calculate_trend_metrics(df, date_col, value_col)

Visualization (visualization/plots.py)

Interactive Plotly-based charts:

  • Trend plots with forecast overlays
  • Categorical comparisons
  • Cluster 2D plots and distributions
  • Elbow curves for cluster optimization

LLM Integration (llm/ollama_client.py)

Ollama-based AI insights:

from llm.ollama_client import generate_insights
insights = generate_insights(analysis_data)

⚙️ Configuration

All settings are centralized in config.py:

LLM Configuration

OLLAMA_HOST = "http://localhost:11434"
OLLAMA_MODEL_DEFAULT = "qwen2.5:1.5b-instruct-q4_0"
OLLAMA_TEMPERATURE = 0.3
OLLAMA_TIMEOUT = 60

Data Processing

MAX_ROWS_FOR_ANALYSIS = 200000
DATA_SAMPLE_SIZE = 10000
ALLOWED_FILE_TYPES = ['csv', 'xlsx', 'xls']

ML Models

# Forecasting
ARIMA_FORECAST_PERIODS = 12
ARIMA_MAX_P, ARIMA_MAX_D, ARIMA_MAX_Q = 2, 2, 2

# Anomaly Detection
ANOMALY_CONTAMINATION = 0.1

# Clustering
CLUSTERING_MAX_CLUSTERS = 10
CLUSTERING_SAMPLE_SIZE = 50000

Modify these values to customize behavior for your use case.


📖 Usage Guide

Basic Workflow

  1. Upload Data

    • Go to "1. Upload Data" in the sidebar
    • Select one or more CSV/Excel files
    • Files are loaded and validated automatically
  2. Explore Schema

    • View detected data types
    • Identify numeric and categorical columns
    • Check for issues in data validation
  3. Select Analysis

    • Choose from available analyses based on data structure
    • Available options: Forecasting, Anomaly Detection, Clustering
  4. View Results

    • Interactive visualizations
    • Statistical summaries
    • AI-powered insights
  5. Export

    • Download analysis results
    • Save visualizations

Example Analysis: Time Series Forecasting

# 1. Prepare a CSV with datetime and numeric columns
# Columns: Date, Sales, Revenue, etc.

# 2. Upload in the app
# 3. Select "Time Series Forecasting"
# 4. Choose date and value columns
# 5. View forecast with confidence intervals

Example Analysis: Anomaly Detection

# 1. Upload dataset with numeric features
# 2. Select "Anomaly Detection"
# 3. Review flagged outliers
# 4. Understand patterns in anomalous data

🧪 Testing

Run the test suite to verify functionality:

# Test data validation
python -m pytest tests/test_data_validation.py -v

# Test clustering performance
python -m pytest tests/test_clustering_speed.py -v

# Verify backend connectivity
python tests/verify_backend.py

# Test visualization
python -m pytest tests/test_pie_chart.py -v

📚 Documentation

Comprehensive documentation is available in the docs/ directory:

Document Purpose
guides/INSTALLATION.md Step-by-step setup with verification
guides/QUICKSTART.md Common tasks and workflows
guides/AI_FEATURES_GUIDE.md LLM integration and AI insights
guides/DATA_VALIDATION_GUIDE.md Data validation rules and checks
guides/CLUSTER_VISUALIZATION_GUIDE.md Clustering analysis guide
reports/IMPLEMENTATION_REPORT.md Technical implementation details
FILE_MANIFEST.md Complete file inventory

🆘 Troubleshooting

Ollama Connection Issues

Problem: Failed to connect to Ollama server

Solution:

# 1. Check if Ollama is running
netstat -ano | findstr :11434

# 2. Start Ollama service
ollama serve

# 3. Verify model availability
ollama list

# 4. Test connection
python -c "import requests; print(requests.get('http://localhost:11434/api/tags').status_code)"

Dependencies Installation Issues

Problem: ModuleNotFoundError after installation

Solution:

# Verify virtual environment is activated
# (You should see (.venv) in your prompt)

# Reinstall requirements
pip install --force-reinstall -r requirements.txt

# Check installed packages
pip list

Memory Issues with Large Datasets

Problem: Crashes when analyzing 200K+ rows

Solution: Adjust in config.py:

DATA_SAMPLE_SIZE = 5000  # Reduce sample size
CLUSTERING_SAMPLE_SIZE = 25000  # Reduce clustering sample

Streamlit Port Already in Use

Problem: Port 8501 is already in use

Solution:

# Run on different port
streamlit run app.py --server.port 8502

🔒 Security & Privacy

  • Offline Processing: All analysis happens locally
  • No Data Upload: Data never leaves your machine
  • Local LLM: AI insights generated via local Ollama instance
  • Open Source: Code is transparent and auditable

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📞 Support

For issues, questions, or suggestions:

  • Check the docs/ directory for detailed guides
  • Review existing test cases in tests/
  • Open an issue on GitHub

🗺️ Roadmap

  • Multi-language support
  • Advanced deep learning models
  • GPU acceleration support
  • Cloud deployment options
  • REST API interface
  • Advanced report generation
  • Real-time data streaming

Built with ❤️ for data privacy and local intelligence

Last Updated: January 2026

About

- Automated pre-import validation classifies columns, identifies quality issues (null values, constant columns, low-variance data), and provides actionable recommendations on data suitability for various analysis types. The system assigns quality scores to each column and determines analysis readiness before processing.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages