Skip to main content

A TabularGRPO classifier package

Project description

TabularGRPO

Overview

TabularGRPO

Dataset

Dataset download url: https://zenodo.org/records/15081413. After you download, please drop in data/ folder

Project Structure

The project structure is as follows:

  • tabulargrpo: Root directory
    • README.md: the reamde
    • data: Data directory
      • synthetic_data_small.csv: Download dataset and drop here
    • models: Model directory
      • MoETransformer.py: MoETransformer model
    • tabulargrpo_classifier.py: Training script
    • demo.py: Demo script

Features

  • Tabular Classifier: Tabular Data Training
  • MoE Transformer: MoE Transformer
  • GRPO: GRPO

Installation

To install the TabularGRPO project, follow these steps:

  1. Clone the repository:
    git clone https://github.com/yourusername/tabulargrpo.git
    
  2. Navigate to the project directory:
    cd tabulargrpo
    
  3. Install the required dependencies:
    pip install -r requirements.txt
    

Usage

To use the TabularGRPO train, run the following command:

        from tabulargrpo_classifier import TabularGRPOClassifier
        from models.transformer_moe import MoETransformer
        from sklearn.datasets import make_classification
        from sklearn.model_selection import train_test_split
        
        X, y = make_classification(n_samples=5000, n_features=14, n_classes=2, random_state=42)
 
        X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
        
        classifier = TabularGRPOClassifier(model_class=MoETransformer,input_dim=14, num_classes=2, epochs=10,group_size=10)
        classifier.fit(X_train,y_train)

To use the TabularGRPO evaluate, run the following command:

        from tabulargrpo_classifier import TabularGRPOClassifier
        from models.transformer_moe import MoETransformer
        from sklearn.datasets import make_classification
        from sklearn.model_selection import train_test_split
        
        X, y = make_classification(n_samples=5000, n_features=14, n_classes=2, random_state=42)
 
        X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
        
        classifier = TabularGRPOClassifier(model_class=MoETransformer,input_dim=14, num_classes=2, epochs=10,group_size=10)
        classifier.fit(X_train,y_train)
        classifier.evaluate(X_test, y_test)

To use the TabularGRPO predict, run the following command:

        from tabulargrpo_classifier import TabularGRPOClassifier
        from models.transformer_moe import MoETransformer
        from sklearn.datasets import make_classification
        from sklearn.model_selection import train_test_split
        
        X, y = make_classification(n_samples=5000, n_features=14, n_classes=2, random_state=42)
 
        X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
        
        classifier = TabularGRPOClassifier(model_class=MoETransformer,input_dim=14, num_classes=2, epochs=10,group_size=10)
        classifier.fit(X_train,y_train)
        classifier.evaluate(X_test, y_test)
        data = [[0,0,0,0]]
        p = classifier.predict(data)
        print(p)

To use the TabularGRPO demo, run the following command:

        python demo.py

Contributing

We welcome contributions to the TabularGRPO project. To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Commit your changes and push to your branch.
  4. Create a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any questions or inquiries, please contact us at enkhtogtokh.java@gmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tabulargrpo-0.1.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tabulargrpo-0.1.3-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file tabulargrpo-0.1.3.tar.gz.

File metadata

  • Download URL: tabulargrpo-0.1.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for tabulargrpo-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4a70a5b073e05d074c9da9157942bd0c5feb7f2b3dca755ac7ab574df664a22e
MD5 bbbfd873cef3c057741dcd30848627bc
BLAKE2b-256 14dda15ce8d7188ff0383813a00e3cb7527e4fbf54cfa231a9c775ac001e193d

See more details on using hashes here.

File details

Details for the file tabulargrpo-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tabulargrpo-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for tabulargrpo-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 abf2e9c2887091c99ca50acbeeb314b66978b4ebc994ca1a44afca69f312fb01
MD5 ad32da5493ff7c6a031b5f06361a6267
BLAKE2b-256 72e0beebd529cb5de3757d28065d36f86947b8901eee7b471028890ab1517694

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page