Instructions to use Delower/kidney-arch3-bagging-deployment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Delower/kidney-arch3-bagging-deployment with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Delower/kidney-arch3-bagging-deployment", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Download validate.py from Delower/kidney-arch3-bagging-deployment: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/Delower/kidney-arch3-bagging-deployment/resolve/main/validate.py
- Command line
-
hf download hf://Delower/kidney-arch3-bagging-deployment/validate.py
-
curl -L -o validate.py https://huggingface.co/Delower/kidney-arch3-bagging-deployment/resolve/main/validate.py
1.01 kB
| # validate.py — loads the shipped Arch3 deployment weights and | |
| # reproduces the model's predictions on examples.json (8 DPP-4 leads | |
| # screened with this exact model; expected probabilities stored | |
| # alongside the SMILES). Exits non-zero if any reproduced probability | |
| # deviates by > 1e-6 (the model is deterministic). | |
| import json, os, sys | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.insert(0, HERE) | |
| from predict import predict | |
| examples = json.load(open(os.path.join(HERE, "examples.json"))) | |
| worst = 0.0 | |
| for ex in examples: | |
| got = predict(ex["smiles"]) | |
| exp = ex["expected_Kidney_BaggingClassifier_deployment_prob"] | |
| assert got is not None, f"unparseable example: {ex['lead_id']}" | |
| dev = abs(got - exp) | |
| worst = max(worst, dev) | |
| print(f"{ex['lead_id']:>8} expected {exp:.6f} got {got:.6f} dev {dev:.2e}") | |
| assert dev <= 1e-6, f"deviation too large for {ex['lead_id']}: {dev}" | |
| print(f"VALIDATION PASSED — max deviation {worst:.2e} over {len(examples)} examples") | |