mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
docs: fix a bug in the document (#466)
* fix a bug * edit guidance to run kaggle application * update docs * optimize docs * read RTD badge --------- Co-authored-by: TPLin22 <tplin2@163.com> Co-authored-by: Linlang <Lv.Linlang@hotmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
[](http://mypy-lang.org/)
|
||||
[](https://github.com/astral-sh/ruff)
|
||||
[](https://discord.gg/ybQ97B6Jjy)
|
||||
[](https://rdagent.readthedocs.io/en/latest/?badge=latest)
|
||||
[](https://github.com/microsoft/RD-Agent/actions/workflows/readthedocs-preview.yml) <!-- this badge is too long, please place it in the last one to make it pretty -->
|
||||
|
||||
# 📰 News
|
||||
@@ -139,30 +140,34 @@ The **[🖥️ Live Demo](https://rdagent.azurewebsites.net/)** is implemented b
|
||||
rdagent general_model "https://arxiv.org/pdf/2210.09789"
|
||||
```
|
||||
|
||||
- Run the **Automated Kaggle Model Tuning & Feature Engineering**: self-loop model proposal and feature engineering implementation application
|
||||
- Run the **Automated Kaggle Model Tuning & Feature Engineering**: self-loop model proposal and feature engineering implementation application <br />
|
||||
> Using **sf-crime** *(San Francisco Crime Classification)* as an example. <br />
|
||||
> 1. Register and login on the [Kaggle](https://www.kaggle.com/) website. <br />
|
||||
> 2. Configuring the Kaggle API. <br />
|
||||
> (1) Click on the avatar (usually in the top right corner of the page) -> `Settings` -> `Create New Token`, A file called `kaggle.json` will be downloaded. <br />
|
||||
> (2) Move `kaggle.json` to `~/.config/kaggle/` <br />
|
||||
> (3) Modify the permissions of the kaggle.json file. Reference command: `chmod 600 ~/.config/kaggle/kaggle.json` <br />
|
||||
> 3. Join the competition: Click `Join the competition` -> `I Understand and Accept` at the bottom of the [competition details page](https://www.kaggle.com/competitions/sf-crime/data).
|
||||
```bash
|
||||
# Generally, you can run the Kaggle competition program with the following command:
|
||||
rdagent kaggle --competition <your competition name>
|
||||
|
||||
**Note**: This application will automatically download Kaggle competition data unless you prepare the data locally. If you do not have the data locally, you need to configure the Kaggle API and agree to the corresponding competition rules on the Kaggle website.
|
||||
```sh
|
||||
# 1. the competition name should must match the name used with the API on the Kaggle platform.
|
||||
rdagent kaggle --competition [your-competition-name]
|
||||
|
||||
# 2. Specifically, you can fill the competition name as follows:
|
||||
|
||||
# download the competition description files to youre local directory
|
||||
# Specifically, you will need to first prepare some competition description files and configure the competition description file path, which you can follow for this specific example:
|
||||
|
||||
# 1. Prepare the competition description files
|
||||
wget https://github.com/SunsetWolf/rdagent_resource/releases/download/kaggle_data/kaggle_data.zip
|
||||
unzip kaggle_data.zip -d git_ignore_folder/kaggle_data
|
||||
|
||||
# unzip the files to your local directory
|
||||
unzip kaggle_data.zip -d /your/local/directory/kaggle_data
|
||||
# 2. Add the competition description file path to the `.env` file.
|
||||
dotenv set KG_LOCAL_DATA_PATH "$(pwd)/git_ignore_folder/kaggle_data"
|
||||
|
||||
# set environment variables
|
||||
export LOCAL_DATA_PATH=/your/local/directory/kaggle_data/kaggle
|
||||
|
||||
# run the application
|
||||
# 3. run the application
|
||||
rdagent kaggle --competition sf-crime
|
||||
```
|
||||
The [Competition List Available](https://rdagent.readthedocs.io/en/latest/scens/kaggle_agent.html#competition-list-available) can be found here.
|
||||
|
||||
For more details, you can refer to the [example guide](https://rdagent.readthedocs.io/en/latest/scens/kaggle_agent.html#example-guide-running-a-specific-experiment).
|
||||
> **Description of the above example:** <br />
|
||||
> - Kaggle competition data, contains two parts: competition description file (json file) and competition dataset (zip file). We prepare the competition description file for you, the competition dataset will be downloaded automatically when you run the program, as in the example. <br />
|
||||
> - If you want to download the competition description file automatically, you need to install chromedriver, The instructions for installing chromedriver can be found in the [documentation](https://rdagent.readthedocs.io/en/latest/scens/kaggle_agent.html#example-guide-running-a-specific-experiment). <br />
|
||||
> - The **Competition List Available** can be found [here](https://rdagent.readthedocs.io/en/latest/scens/kaggle_agent.html#competition-list-available). <br />
|
||||
|
||||
### 🖥️ Monitor the Application Results
|
||||
- You can serve our demo app to monitor the RD loop by running the following command:
|
||||
|
||||
+119
-89
@@ -61,100 +61,96 @@ Here's an enhanced outline of the steps:
|
||||
- Adjust hypotheses based on validation feedback.
|
||||
- Iterate the process to continuously improve the model.
|
||||
|
||||
⚡ Quick Start
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Please refer to the installation part in :doc:`../installation_and_configuration` to prepare your system dependency.
|
||||
|
||||
You can try our demo by running the following command:
|
||||
|
||||
- 🐍 Create a Conda Environment
|
||||
|
||||
- Create a new conda environment with Python (3.10 and 3.11 are well tested in our CI):
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
conda create -n rdagent python=3.10
|
||||
|
||||
- Activate the environment:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
conda activate rdagent
|
||||
|
||||
- 📦 Install the RDAgent
|
||||
|
||||
- You can install the RDAgent package from PyPI:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
pip install rdagent
|
||||
|
||||
- 🚀 Run the Application
|
||||
|
||||
- You can directly run the application by using the following command:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
rdagent kaggle --competition [your competition name]
|
||||
|
||||
The `competition name` parameter must match the name used with the API on the Kaggle platform.
|
||||
|
||||
(NOTE: The code for crawling Kaggle competition information may not be applicable to your environment.
|
||||
|
||||
If you cannot execute it normally, you can refer to the following **Example Guide: Running a Specific Experiment**.)
|
||||
|
||||
|
||||
📋 Competition List Available
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| **Competition Name** | **Task** | **Modal** | **ID** |
|
||||
+===================================+==================+===========+===============================+
|
||||
| Media Campaign Cost Dataset | Regression | Tabular | playground-series-s3e11 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Wild Blueberry Yield Dataset | Regression | Tabular | playground-series-s3e14 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Crab Age Dataset | Regression | Tabular | playground-series-s3e16 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Flood Prediction Dataset | Regression | Tabular | playground-series-s4e5 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Used Car Prices Dataset | Regression | Tabular | playground-series-s4e9 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Cirrhosis Outcomes Dataset | Multi-Class | Tabular | playground-series-s3e26 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| San Francisco Crime Classification| Multi-Class | Tabular | sf-crime |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Poisonous Mushrooms Dataset | Classification | Tabular | playground-series-s4e8 |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Spaceship Titanic | Classification | Tabular | spaceship-titanic |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Forest Cover Type Prediction | Classification | Tabular | forest-cover-type-prediction |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| Digit Recognizer | Classification | Image | digit-recognizer |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
| To be continued ... |
|
||||
+-----------------------------------+------------------+-----------+-------------------------------+
|
||||
|
||||
|
||||
|
||||
🧭 Example Guide: Running a Specific Experiment
|
||||
🧭 Example Guide
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
**Example Competition Name**: San Francisco Crime Classification (sf-crime)
|
||||
|
||||
- 🔧 **Set up RD-Agent Environment**
|
||||
|
||||
- 📥 **Download Competition Data (Optional)**
|
||||
- Before you start, please make sure you have installed RD-Agent and configured the environment for RD-Agent correctly. If you want to know how to install and configure the RD-Agent, please refer to the `documentation <../installation_and_configuration.html>`_.
|
||||
|
||||
- If web information and data are not prepared locally, the RD-Agent loop will automatically download them at startup.
|
||||
- 🔨 **Configuring the Kaggle API**
|
||||
|
||||
- Register and login on the `Kaggle <https://www.kaggle.com/>`_ website.
|
||||
- Click on the avatar (usually in the top right corner of the page) -> ``Settings`` -> ``Create New Token``, A file called ``kaggle.json`` will be downloaded.
|
||||
- Move ``kaggle.json`` to ``~/.config/kaggle/``
|
||||
- Modify the permissions of the ``kaggle.json`` file.
|
||||
|
||||
- In this case, you need to configure the Kaggle API yourself, agree to the competition rules on the Kaggle page, and configure `chromedriver` for Selenium.
|
||||
.. code-block:: sh
|
||||
|
||||
- Alternatively, you can manually place the dataset in the specified location in advance.
|
||||
chmod 600 ~/.config/kaggle/kaggle.json
|
||||
|
||||
- you can download the kaggle_data.zip in the release and unzip it to the directory configured by the `KG_LOCAL_DATA_PATH` environment variable.
|
||||
- For more information about Kaggle API Settings, refer to the `Kaggle API <https://github.com/Kaggle/kaggle-api>`_.
|
||||
|
||||
- 🔩 **Setting the Environment variables at .env file**
|
||||
|
||||
- Determine the path where the data will be stored and add it to the ``.env`` file.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
dotenv set KG_LOCAL_DATA_PATH <your local directory>/kaggle_data
|
||||
|
||||
- 📥 **Download Competition Data**
|
||||
|
||||
- Kaggle competition data, contains two parts: competition description file (json file) and competition dataset (zip file).
|
||||
|
||||
- **How to get the competition description file**
|
||||
|
||||
- *Manual Download (General User Suggestions):*
|
||||
|
||||
- Download the competition description file prepared in advance, and extract it to the specified directory.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
wget https://github.com/SunsetWolf/rdagent_resource/releases/download/kaggle_data/kaggle_data.zip
|
||||
unzip kaggle_data.zip -d <your local directory>/kaggle_data
|
||||
|
||||
- *Automatic Download (Developer Suggestions):*
|
||||
|
||||
- Alternatively, you can choose to download the competition description file automatically when you run the program, but it requires ``chromedriver`` to be installed, as follows:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
# install chrome
|
||||
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||
sudo apt install ./google-chrome-stable_current_amd64.deb
|
||||
google-chrome --version
|
||||
|
||||
# install chromedriver
|
||||
wget "https://storage.googleapis.com/chrome-for-testing-public/$(google-chrome --version | grep -oP '\d+\.\d+\.\d+\.\d+')/linux64/chromedriver-linux64.zip"
|
||||
unzip chromedriver-linux64.zip
|
||||
cd chromedriver-linux64
|
||||
sudo mv chromedriver /usr/local/bin
|
||||
sudo chmod +x /usr/local/bin/chromedriver
|
||||
chromedriver --version
|
||||
|
||||
- **How to get the competition dataset**
|
||||
|
||||
- The competition dataset is downloaded and extracted automatically when the program is run. If the zip file exists, the download will be skipped, if the unzip folder exists, the unzip will be skipped.
|
||||
|
||||
- **Correct directory structure (Here is an example of competition data with id sf-crime)**
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
kaggle_data
|
||||
└── zip_files
|
||||
| └── sf-crime.zip
|
||||
├── sf-crime.json
|
||||
└── sf-crime
|
||||
└── ...
|
||||
|
||||
- ``kaggle_data/zip_files/sf-crime.zip:`` Competition dataset zip files downloaded from the Kaggle website.
|
||||
|
||||
- ``kaggle_data/sf-crime.json:`` Competition description file.
|
||||
|
||||
- ``kaggle_data/sf-crime:`` The target folder for unzipping the competition dataset.
|
||||
|
||||
- 🗳️ **Join the competition**
|
||||
|
||||
- If your Kaggle API account has not joined a competition, you will need to join the competition before running the program.
|
||||
|
||||
- At the bottom of the competition details page, you can find the ``Join the competition`` button, click on it and select ``I Understand and Accept`` to join the competition.
|
||||
|
||||
- In the **Competition List Available** below, you can jump to the competition details page.
|
||||
|
||||
- 🚀 **Run the Application**
|
||||
|
||||
@@ -162,15 +158,49 @@ If you cannot execute it normally, you can refer to the following **Example Guid
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
rdagent kaggle --competition sf-crime
|
||||
rdagent kaggle --competition <Competition ID>
|
||||
|
||||
- 📤 **Submit the Result Automatically or Manually**
|
||||
|
||||
- If Auto: You need to configure the Kaggle API, agree to the competition rules on the page, and set `KG_AUTO_SUBMIT=true`.
|
||||
- If Auto: You need to set ``KG_AUTO_SUBMIT`` to ``true`` in the ``.env`` file.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
dotenv set KG_AUTO_SUBMIT true
|
||||
|
||||
- Else: You can download the prediction results from the UI interface and submit them manually. For more details, refer to the :doc:`UI guide <../ui>`.
|
||||
|
||||
For more information about Kaggle API Settings, refer to the `Kaggle API <https://github.com/Kaggle/kaggle-api>`_.
|
||||
📋 Competition List Available
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| **index** | **Competition Name** | **Task** | **Modal** | **ID** |
|
||||
+===========+===================================+==================+===========+=========================================================================================================+
|
||||
| 01 | Media Campaign Cost Dataset | Regression | Tabular | `playground-series-s3e11 <https://www.kaggle.com/competitions/playground-series-s3e11/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 02 | Wild Blueberry Yield Dataset | Regression | Tabular | `playground-series-s3e14 <https://www.kaggle.com/competitions/playground-series-s3e14/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 03 | Crab Age Dataset | Regression | Tabular | `playground-series-s3e16 <https://www.kaggle.com/competitions/playground-series-s3e16/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 04 | Flood Prediction Dataset | Regression | Tabular | `playground-series-s4e5 <https://www.kaggle.com/competitions/playground-series-s4e5/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 05 | Used Car Prices Dataset | Regression | Tabular | `playground-series-s4e9 <https://www.kaggle.com/competitions/playground-series-s4e9/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 06 | Cirrhosis Outcomes Dataset | Multi-Class | Tabular | `playground-series-s3e26 <https://www.kaggle.com/competitions/playground-series-s3e26/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 07 | San Francisco Crime Classification| Multi-Class | Tabular | `sf-crime <https://www.kaggle.com/competitions/sf-crime/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 08 | Poisonous Mushrooms Dataset | Classification | Tabular | `playground-series-s4e8 <https://www.kaggle.com/competitions/playground-series-s4e8/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 09 | Spaceship Titanic | Classification | Tabular | `spaceship-titanic <https://www.kaggle.com/competitions/spaceship-titanic/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 10 | Forest Cover Type Prediction | Classification | Tabular | `forest-cover-type-prediction <https://www.kaggle.com/competitions/forest-cover-type-prediction/data>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| 11 | Digit Recognizer | Classification | Image | `digit-recognizer <https://www.kaggle.com/competitions/digit-recognizer>`_ |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
| To be continued ... |
|
||||
+-----------+-----------------------------------+------------------+-----------+---------------------------------------------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
🎨 Customize one template for a new competition
|
||||
@@ -237,6 +267,6 @@ The following environment variables can be set in the `.env` file to customize t
|
||||
|
||||
.. autopydantic_settings:: rdagent.components.coder.factor_coder.config.FactorImplementSettings
|
||||
:settings-show-field-summary: False
|
||||
:members: coder_use_cache, data_folder, data_folder_debug, file_based_execution_timeout, select_method, select_threshold, max_loop, knowledge_base_path, new_knowledge_base_path
|
||||
:members: coder_use_cache, file_based_execution_timeout, select_method, max_loop
|
||||
:exclude-members: Config, fail_task_trial_limit, v1_query_former_trace_limit, v1_query_similar_success_limit, v2_query_component_limit, v2_query_error_limit, v2_query_former_trace_limit, v2_error_summary, v2_knowledge_sampler, v2_add_fail_attempt_to_latest_successful_execution, new_knowledge_base_path, knowledge_base_path, data_folder, data_folder_debug, select_threshold
|
||||
:no-index:
|
||||
|
||||
Reference in New Issue
Block a user