https://github.com/alcoholrithm/rias

https://github.com/alcoholrithm/rias

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.5%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: Alcoholrithm
  • Language: Jupyter Notebook
  • Default Branch: main
  • Size: 3.23 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme

README.md

How to install

sh pip install -r requirements.txt

How to use RIAS for a specific dataset and user-defined model

1. Define a DataModule Class that inherit DataModule class.

```python from src.data_utils import DataModule

class MyDataModule(DataModule): pass ```

2. Define a ModelModule Class that inherit BaseModel or use a predefined ModelModule.

```python from src.models import BaseModel

class MyModel(BaseModel): pass ```

or

python from src.models import XGB

3. Complete the configuration settings for the experiment. Load the base_config and define the missing options. If you use predefined ModelModule, load corresponding config in the src.config.

```python from src.config import base_config as config

config.experiment.random_seed = 0 ... ```

or

```python from src.config import xgb_config as config

config.experiment.random_seed = 0 ... ```

4. Define the evaluation metric for the given dataset.

```python from src.misc.eval_metric import EvalMetric

class MyEvalMetric(EvalMetric): pass ```

5. Run RIAS

```python

Assume we define MyDataModule, MyModel and config

from src.rias import RIAS from src.models import XGB

Prepare the data

datamodule = MyDataModule() data, label, continuouscols, categoricalcols = datamodule.prepare_data()

test_size = 0.2

trainidx, testidx, , _ = traintestsplit(np.arange(len(label)).reshape((-1, 1)), label, testsize=testsize, randomstate=config.experiment.randomseed, stratify=label) trainidx, testidx = trainidx.ravel(), test_idx.ravel()

Xtest, ytest = data.iloc[testidx], label[testidx] data, label = data.iloc[trainidx], label[trainidx]

Run RIAS

rias = RIAS.preparerias(config, MyModel, data, label, continuouscols, categorical_cols, True)

rias.train()

rias.initcalibrator() rias.test(Xtest, y_test, DiabetesEvalMetric()) ```

See the example.ipynb for detail example

Owner

  • Login: Alcoholrithm
  • Kind: user

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Dependencies

requirements.txt pypi
  • BorutaShap ==1.0.16
  • dice-ml ==0.10
  • lightgbm ==4.1.0
  • lime ==0.2.0.1
  • netcal ==1.3.5
  • numpy ==1.24.3
  • optuna ==3.3.0
  • pandas ==1.5.3
  • pytorch_tabular ==1.0.2
  • scikit-learn ==1.3.1
  • shap ==0.42.1
  • tensorflow ==2.13.1
  • torch ==1.13.1
  • torchmetrics ==0.11.4
  • tqdm ==4.66.1
  • xgboost ==2.0.0