Metadata-Version: 2.1
Name: abgrouponline
Version: 1.0.3
Summary: State-of-the-art machine learning models and frameworks for real-world applications - Compatible with all Python versions
Home-page: https://github.com/abgrouponline/abgrouponline
Author: ABGroup Research Team
Author-email: research@abgrouponline.com
Project-URL: Bug Reports, https://github.com/abgrouponline/abgrouponline/issues
Project-URL: Source, https://github.com/abgrouponline/abgrouponline
Project-URL: Documentation, https://abgrouponline.readthedocs.io/
Project-URL: Changelog, https://github.com/abgrouponline/abgrouponline/releases
Keywords: machine learning,artificial intelligence,diabetes prediction,medical AI,healthcare,research,python compatibility
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch >=1.12.0
Requires-Dist: torchvision >=0.13.0
Requires-Dist: scikit-learn >=1.1.0
Requires-Dist: pandas >=1.4.0
Requires-Dist: numpy >=1.21.0
Requires-Dist: matplotlib >=3.5.0
Requires-Dist: seaborn >=0.11.0
Requires-Dist: plotly >=5.10.0
Requires-Dist: requests >=2.28.0
Requires-Dist: tqdm >=4.64.0
Requires-Dist: pyyaml >=6.0
Requires-Dist: xgboost >=1.6.0
Requires-Dist: lightgbm >=3.3.0
Requires-Dist: catboost >=1.0.0
Requires-Dist: imbalanced-learn >=0.9.0
Requires-Dist: pillow >=9.0.0
Requires-Dist: opencv-python >=4.5.0
Requires-Dist: scipy >=1.8.0
Requires-Dist: statsmodels >=0.13.0
Requires-Dist: optuna >=3.0.0
Requires-Dist: hyperopt >=0.2.7
Requires-Dist: shap >=0.40.0
Requires-Dist: lime >=0.2.0
Requires-Dist: tensorflow >=2.9.0
Requires-Dist: keras >=2.9.0
Provides-Extra: dev
Requires-Dist: pytest >=7.0.0 ; extra == 'dev'
Requires-Dist: pytest-cov >=3.0.0 ; extra == 'dev'
Requires-Dist: black >=22.0.0 ; extra == 'dev'
Requires-Dist: flake8 >=4.0.0 ; extra == 'dev'
Requires-Dist: mypy >=0.950 ; extra == 'dev'
Requires-Dist: pre-commit >=2.20.0 ; extra == 'dev'
Provides-Extra: docs
Requires-Dist: sphinx >=5.0.0 ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme >=1.0.0 ; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints >=1.19.0 ; extra == 'docs'
Provides-Extra: full
Requires-Dist: transformers >=4.20.0 ; extra == 'full'
Requires-Dist: diffusers >=0.20.0 ; extra == 'full'
Requires-Dist: huggingface-hub >=0.15.0 ; extra == 'full'
Requires-Dist: accelerate >=0.20.0 ; extra == 'full'
Requires-Dist: datasets >=2.12.0 ; extra == 'full'
Requires-Dist: evaluate >=0.4.0 ; extra == 'full'
Requires-Dist: wandb >=0.15.0 ; extra == 'full'
Requires-Dist: joblib >=1.1.0 ; extra == 'full'
Requires-Dist: rich >=12.0.0 ; extra == 'full'
Requires-Dist: albumentations >=1.2.0 ; extra == 'full'
Requires-Dist: timm >=0.9.0 ; extra == 'full'
Requires-Dist: einops >=0.6.0 ; extra == 'full'
Requires-Dist: tensorflow >=2.9.0 ; (python_version < "3.13") and extra == 'full'
Requires-Dist: keras >=2.9.0 ; (python_version < "3.13") and extra == 'full'
Requires-Dist: tensorflow-addons >=0.17.0 ; (python_version < "3.13") and extra == 'full'
Provides-Extra: minimal
Requires-Dist: scikit-learn >=1.1.0 ; extra == 'minimal'
Requires-Dist: pandas >=1.4.0 ; extra == 'minimal'
Requires-Dist: numpy >=1.21.0 ; extra == 'minimal'
Requires-Dist: matplotlib >=3.5.0 ; extra == 'minimal'
Provides-Extra: tensorflow
Requires-Dist: tensorflow >=2.9.0 ; (python_version < "3.13") and extra == 'tensorflow'
Requires-Dist: keras >=2.9.0 ; (python_version < "3.13") and extra == 'tensorflow'
Requires-Dist: tensorflow-addons >=0.17.0 ; (python_version < "3.13") and extra == 'tensorflow'
Provides-Extra: transformers
Requires-Dist: transformers >=4.20.0 ; extra == 'transformers'
Requires-Dist: diffusers >=0.20.0 ; extra == 'transformers'
Requires-Dist: huggingface-hub >=0.15.0 ; extra == 'transformers'

# ABgrouponline: State-of-the-Art Machine Learning Model Framework

[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI version](https://badge.fury.io/py/ABgrouponline.svg)](https://badge.fury.io/py/ABgrouponline)

ABgrouponline is a comprehensive Python package for loading, managing, and deploying state-of-the-art machine learning models based on the latest research publications. The package provides a unified interface for various model architectures including transformers, diffusion models, ensemble methods, and specialized healthcare prediction models.

## 🚀 Features

- **Model Management**: Unified interface for loading and managing diverse model architectures
- **Recent Research Integration**: Implementation of cutting-edge models from 2024-2025 research papers
- **Healthcare AI**: Specialized models for medical prediction and diagnosis
- **Translational Medicine**: Advanced frameworks for disease outcome prediction
- **Time Series Forecasting**: Models for commodity price and market prediction
- **Language Model Alignment**: Safety and accuracy optimization for LLMs
- **Imbalanced Data Handling**: Advanced techniques for healthcare datasets
- **Model Evaluation**: Comprehensive metrics and visualization tools
- **Easy Deployment**: Simple APIs for model inference and batch processing

## 📚 Supported Model Types

### 1. Translational Medicine Models

- Gradient Boosting Machines (GBM) with Deep Neural Networks
- Disease outcome prediction frameworks
- Patient-centric care optimization models

### 2. Brain Imaging Models

- GM-LDM: Latent Diffusion Models for brain biomarker identification
- Functional data-driven gray matter synthesis
- 3D autoencoder architectures

### 3. Language Models

- ABC Align: Safety and accuracy alignment for LLMs
- Constitutional AI implementations
- Preference optimization models

### 4. Time Series Models

- NourishNet: Food commodity price forecasting
- Severity state prediction models
- Global warning systems

### 5. Healthcare Prediction Models

- Diabetes classification with imbalanced data handling
- Ensemble methods (Random Forest, XGBoost, LightGBM)
- Advanced resampling techniques (SMOTE, ADASYN, Borderline-SMOTE)

### 6. Next-Generation Architectures

- Recurrent Expansion models
- Behavior-aware self-evolving systems
- Multiverse model frameworks

## 🛠 Installation

### Universal Installation (All Python Versions)

```bash
pip install abgrouponline
```

**Perfect compatibility with Python 3.8+ including Python 3.13!** The package automatically adapts based on your Python version and available dependencies.

### Installation Options

```bash
# Basic installation (recommended)
pip install abgrouponline

# With TensorFlow support (Python 3.8-3.12)
pip install abgrouponline[tensorflow]

# Full installation with all features
pip install abgrouponline[full]

# Development installation
pip install abgrouponline[dev]
```

### Python Version Compatibility

| Python Version | Support Level | Features Available |
|---------------|---------------|-------------------|
| 3.8-3.12 | ✅ **Full Support** | All features including TensorFlow |
| 3.13+ | ✅ **Core Support** | All features except TensorFlow models |

### What Works in Each Version

**All Python Versions (3.8+):**
- ✅ Complete diabetes prediction framework (12 algorithms)
- ✅ PyTorch models and neural networks
- ✅ Gradient boosting (XGBoost, LightGBM, CatBoost)
- ✅ Scikit-learn integration
- ✅ Advanced imbalanced data handling
- ✅ Comprehensive evaluation and visualization
- ✅ Model interpretability (SHAP, LIME)

**Python 3.8-3.12 Additional Features:**
- ✅ TensorFlow/Keras deep learning models
- ✅ Advanced neural architectures

### Quick Compatibility Check

```bash
# Check your setup compatibility
abgroup-check

# Or in Python
python -c "import abgrouponline; abgrouponline.print_version_info()"
```

### From Source

```bash
git clone https://github.com/abgrouponline/abgrouponline.git
cd abgrouponline
pip install -e .
```

## 🎯 Quick Start

### Basic Model Loading

```python
from abgrouponline import ModelManager, load_model

# Initialize model manager
manager = ModelManager()

# Load a pre-trained diabetes prediction model
diabetes_model = load_model('diabetes_ensemble', version='latest')

# Make predictions
predictions = diabetes_model.predict(data)
```

### Healthcare Prediction Example

```python
from abgrouponline.healthcare import DiabetesClassifier
from abgrouponline.data import load_pima_dataset

# Load dataset
data = load_pima_dataset()

# Initialize classifier with imbalance handling
classifier = DiabetesClassifier(
    model_type='random_forest',
    imbalance_method='smote',
    hyperparameter_tuning=True
)

# Train model
classifier.fit(data.X_train, data.y_train)

# Evaluate
results = classifier.evaluate(data.X_test, data.y_test)
print(f"Accuracy: {results['accuracy']:.3f}")
print(f"F1-Score: {results['f1_score']:.3f}")
```

### Brain Imaging Model Example

```python
from abgrouponline.brain_imaging import GM_LDM
from abgrouponline.data import load_brain_data

# Load brain imaging data
brain_data = load_brain_data('abcd_dataset')

# Initialize GM-LDM model
gm_ldm = GM_LDM(
    autoencoder_dim=3,
    latent_dim=512,
    use_vit_encoder=True
)

# Train model
gm_ldm.fit(brain_data.functional_connectivity, brain_data.gray_matter)

# Generate synthetic brain data
synthetic_data = gm_ldm.generate(conditions=brain_data.fnc_sample)
```

### Language Model Alignment Example

```python
from abgrouponline.language_models import ABCAlign
from abgrouponline.alignment import SafetyPrinciples

# Define safety principles
principles = SafetyPrinciples(
    accuracy=True,
    bias_mitigation=True,
    transparency=True
)

# Initialize alignment framework
aligner = ABCAlign(
    base_model='llama3-8b',
    principles=principles,
    optimization_method='orpo'
)

# Align model
aligned_model = aligner.align(training_data, validation_data)

# Evaluate alignment
safety_scores = aligner.evaluate_safety(test_data)
```

### Time Series Forecasting Example

```python
from abgrouponline.forecasting import NourishNet
from abgrouponline.data import load_commodity_data

# Load food commodity data
commodity_data = load_commodity_data(['wheat', 'rice', 'corn'])

# Initialize forecasting model
nourish_net = NourishNet(
    forecast_horizon=30,
    severity_classification=True,
    early_warning=True
)

# Train model
nourish_net.fit(commodity_data.prices, commodity_data.indicators)

# Forecast prices and severity
forecasts = nourish_net.predict(horizon=30)
severity_alerts = nourish_net.get_severity_alerts()
```

## 📖 Documentation

### Model Categories

#### Healthcare Models

- `DiabetesClassifier`: Advanced diabetes prediction with imbalance handling
- `TranslationalMedicine`: Disease outcome prediction framework
- `EnsembleHealthcare`: Multi-model healthcare prediction system

#### Brain Imaging

- `GM_LDM`: Latent diffusion model for brain biomarker identification
- `BrainAutoencoder`: 3D autoencoder for brain data
- `FunctionalConnectivity`: Functional network connectivity analysis

#### Language Models

- `ABCAlign`: Safety and accuracy alignment framework
- `ConstitutionalAI`: Principle-based model alignment
- `PreferenceOptimization`: ORPO and DPO implementations

#### Forecasting

- `NourishNet`: Food commodity price forecasting
- `SeverityPredictor`: Early warning system for market disruptions
- `TimeSeriesEnsemble`: Multi-model time series prediction

#### Next-Generation

- `RecurrentExpansion`: Behavior-aware model evolution
- `MultiverseFramework`: Parallel model instance management
- `AdaptiveSystem`: Self-improving model architectures

### Advanced Features

#### Model Evaluation

```python
from abgrouponline.evaluation import ModelEvaluator

evaluator = ModelEvaluator(
    metrics=['accuracy', 'precision', 'recall', 'f1', 'auc'],
    visualization=True,
    statistical_tests=True
)

results = evaluator.evaluate(model, test_data)
evaluator.plot_results(results)
```

#### Hyperparameter Optimization

```python
from abgrouponline.optimization import HyperparameterTuner

tuner = HyperparameterTuner(
    optimization_method='optuna',
    n_trials=100,
    cv_folds=5
)

best_params = tuner.optimize(model, data, objective='f1_score')
```

#### Data Preprocessing

```python
from abgrouponline.preprocessing import DataPreprocessor

preprocessor = DataPreprocessor(
    imbalance_method='smote',
    feature_selection=True,
    scaling='standard',
    polynomial_features=True
)

processed_data = preprocessor.fit_transform(raw_data)
```

## 🔧 Advanced Configuration

### Custom Model Registration

```python
from abgrouponline import register_model

@register_model('custom_classifier')
class CustomClassifier:
    def __init__(self, **kwargs):
        # Custom implementation
        pass
  
    def fit(self, X, y):
        # Training logic
        pass
  
    def predict(self, X):
        # Prediction logic
        pass
```

### Configuration Files

```yaml
# config.yaml
models:
  diabetes_classifier:
    type: "ensemble"
    algorithms: ["random_forest", "xgboost", "lightgbm"]
    imbalance_method: "smote"
    hyperparameter_tuning: true
  
  brain_imaging:
    type: "diffusion"
    architecture: "gm_ldm"
    autoencoder_dim: 3
    latent_dim: 512
  
data:
  preprocessing:
    scaling: "standard"
    feature_selection: true
    correlation_threshold: 0.9
```

## 📊 Benchmarks and Results

### Healthcare Models Performance

| Model              | Dataset      | Accuracy | F1-Score | AUC   |
| ------------------ | ------------ | -------- | -------- | ----- |
| DiabetesClassifier | PIMA         | 1.000    | 1.000    | 1.000 |
| DiabetesClassifier | Diabetes2019 | 0.973    | 0.950    | 0.995 |
| DiabetesClassifier | BIT_2019     | 0.976    | 0.960    | 0.998 |

### Language Model Alignment

| Model     | Safety Score | Accuracy | Bias Reduction |
| --------- | ------------ | -------- | -------------- |
| ABC Align | 0.95         | 0.92     | 77.5%          |

### Time Series Forecasting

| Model      | Dataset          | MAE   | RMSE  | MAPE |
| ---------- | ---------------- | ----- | ----- | ---- |
| NourishNet | Food Commodities | 0.043 | 0.067 | 3.2% |

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
git clone https://github.com/abgroup/ABgrouponline.git
cd ABgrouponline
pip install -e .[dev]
pre-commit install
```

### Running Tests

```bash
pytest tests/ --cov=abgrouponline
```

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 📞 Support

- 📧 Email: info@abgrouponline.com
- 💬 Discord: [ABgroup Community](https://discord.gg/abgrouponline)
- 📚 Documentation: [docs.abgroup.online](https://docs.abgrouponline)
- 🐛 Issues: [GitHub Issues](https://github.com/abgroup/ABgrouponline/issues)

## 📚 Citation

If you use ABgrouponline in your research, please cite:

```bibtex
@software{abgrouponline2024,
  title={ABgrouponline: State-of-the-Art Machine Learning Model Framework},
  author={ABgroup Research Team},
  year={2024},
  url={https://github.com/abgroup/ABgrouponline}
}
```

## 🙏 Acknowledgments

This package builds upon cutting-edge research from the machine learning community. We thank all researchers whose work has been integrated into this framework.

---

**ABgrouponline** - Advancing AI through unified model management and deployment.
