Metadata-Version: 2.1
Name: autogluon.assistant
Version: 0.0.1.dev20241119
Summary: ML Assistant for Competitive Machine Learning
Author: AutoGluon Community
Project-URL: Homepage, https://github.com/autogluon/autogluon-assistant
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: autogluon.tabular[all]<2.0,>=1.1
Requires-Dist: importlib-resources<7.0,>=6.4.5
Requires-Dist: langchain<0.4,>=0.3.3
Requires-Dist: langchain_openai<0.3,>=0.2.2
Requires-Dist: langchain_aws<0.3,>=0.2.2
Requires-Dist: pydantic<3.0,>=2.9.2
Requires-Dist: hydra-core>=1.3
Requires-Dist: matplotlib>=3.9.2
Requires-Dist: typer>=0.12.5
Requires-Dist: rich>=13.8.1
Requires-Dist: s3fs>=2024.9.0
Requires-Dist: joblib>=1.4.2
Requires-Dist: python-calamine
Requires-Dist: tenacity<10.0,>=8.2.2
Requires-Dist: pandas>=2.2
Requires-Dist: streamlit<1.41,>=1.37
Requires-Dist: streamlit-aggrid<1.1,>=1.0.2
Requires-Dist: streamlit-extras<0.6,>=0.4
Requires-Dist: psutil>=5.9.8
Provides-Extra: dev
Requires-Dist: black>=24; extra == "dev"
Requires-Dist: GitRepo>=1; extra == "dev"
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: ruff==0.4; extra == "dev"

# AutoGluon Assistant

[![Python Versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)](https://pypi.org/project/autogluon-assistant/)
[![GitHub license](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
[![Continuous Integration](https://github.com/autogluon/autogluon-assistant/actions/workflows/lint.yml/badge.svg)](https://github.com/autogluon/autogluon-assistant/actions/workflows/lint.yml)

AutoGluon Assistant (AG-A) provides users a simple interface where they can input their data, describe their problem, and receive a highly accurate and competitive ML solution — without writing any code. By leveraging the state-of-the-art AutoML capabilities of AutoGluon and integrating them with a Large Language Model (LLM), AG-A automates the entire data science pipeline. AG-A takes AutoGluon’s automation from three lines of code to zero, enabling users to solve new supervised learning tabular problems using only natural language descriptions.

## Setup

Installing from source: 

```bash
# create a conda env
conda create -n aga python=3.10
conda activate aga

# clone repositories
git clone https://github.com/autogluon/autogluon-assistant.git
cd autogluon-assistant && pip install -e "." && cd ..
```

or simply:

```bash
pip install autogluon.assistant
```

#### Beta Features

AG-A now supports automatic feature generation as part of its beta features. To enable these features, please install the beta version dependencies using the following command:

```bash
pip install -r requirements.txt
```

### API Keys

#### Configuring LLMs
AG-A supports using both AWS Bedrock and OpenAI as LLM model providers. You will need to set up API keys for the respective provider you choose. By default, AG-A uses AWS Bedrock for its language models.

#### AWS Bedrock Setup
AG-A integrates with AWS Bedrock by default. To use AWS Bedrock, you will need to configure your AWS credentials and region settings:

```bash
export AWS_DEFAULT_REGION="<your-region>"
export AWS_ACCESS_KEY_ID="<your-access-key>"
export AWS_SECRET_ACCESS_KEY="<your-secret-key>"
```

Ensure you have an active AWS account and appropriate permissions set up for using Bedrock models. You can manage your AWS credentials through the AWS Management Console. See [Bedrock supported AWS regions](https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-regions.html)


#### OpenAI Setup
To use OpenAI, you'll need to set your OpenAI API key as an environment variable:

```bash
export OPENAI_API_KEY="sk-..."
```

You can sign up for an OpenAI account [here](https://platform.openai.com/) and manage your API keys [here](https://platform.openai.com/account/api-keys).

Important: Free-tier OpenAI accounts may be subject to rate limits, which could affect AG-A's performance. We recommend using a paid OpenAI API key for seamless functionality.


## Usage

We support two ways of using AutoGluon Assistant: WebUI and CLI.

### Web UI
AutoGluon Assistant Web UI allows users to leverage the capabilities of AG-A through an intuitive web interface.

The web UI enables users to upload datasets, configure AG-A runs with customized settings, preview data, monitor execution progress, view and download results, and supports secure, isolated sessions for concurrent users.

#### To run the AG-A Web UI:

```bash
aga ui

# OR

# Launch Web-UI on specific port e.g. 8888
aga ui --port 8888
```

AG-A Web UI should now be accessible in your web browser at `http://localhost:8501` or the specified port.


### CLI

Before launching AG-A CLI, prepare your data files in the following structure:

```
└── data # Data files directory
    ├── train.[ext] # Training dataset (required)
    ├── test.[ext]  # Test dataset (required)
    └── description.txt # Dataset and task description (recommended)
```

Note:
- The training and test files can be in any tabular data format (e.g., csv, parquet, xlsx)
- While there are no strict naming requirements, we recommend using clear, descriptive filenames
- The description file is optional but recommended for better model selection and optimization. It can include:
  - Dataset description
  - Problem context
  - Evaluation metrics
  - Any other relevant information

Now you can launch the AutoGluon Assistant run using the following command:

```bash
aga run [NAME_OF_DATA_DIR] --presets [PRESET_QUALITY]
# e.g. aga run ./toy_data --presets best_quality
```

We support three presets, including `medium_quality`, `high_quality` and `best_quality`. We use `best_quality` as a default setting.

After the run is complete, model predictions on test dataset are saved into the `aga-output-<timestamp>.csv` file. It will be formatted according to optional `sample_submission.csv` file if provided.

#### Overriding Configs

You can override specific settings in the YAML configuration defined in the [config folder](https://github.com/autogluon/autogluon-assistant/tree/main/src/autogluon/assistant/configs) using
the `config_overrides` parameter with format `"key1=value1, key2.nested=value2"` from the command line.


Here are some example commands on using configuration overrides:

```bash
aga run toy_data --config_overrides "feature_transformers.enabled_models=None, time_limit=3600"

# OR

aga run toy_data --config_overrides "feature_transformers.enabled_models=None" --config_overrides "time_limit=3600"
```
