Tabular Classification
Scikit-learn
Joblib
ml-lab
scikit-learn
predictive-maintenance
time-series-classification
iot
synthetic-data
Eval Results (legacy)
Instructions to use shalev396/elevator-maintenance with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use shalev396/elevator-maintenance with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("shalev396/elevator-maintenance", "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 handler.py from shalev396/elevator-maintenance: direct link, hf CLI and curl.
- Browser
- Download file 780 Bytes
-
https://huggingface.co/shalev396/elevator-maintenance/resolve/main/handler.py
- Command line
-
hf download hf://shalev396/elevator-maintenance/handler.py
-
curl -L -o handler.py https://huggingface.co/shalev396/elevator-maintenance/resolve/main/handler.py
780 Bytes
| """Hugging Face Inference Endpoints entry point — deploy this repo as a CPU/GPU API. | |
| Request body: {"inputs": <CSV text | list of row dicts | {column: [values]}>} with >= 60 minutely rows of | |
| the 11 sensor columns (optional `timestamp` column). Response: {"failure": p, "healthy": 1 - p}. | |
| """ | |
| import sys | |
| from pathlib import Path | |
| HERE = Path(__file__).resolve().parent | |
| sys.path.insert(0, str(HERE)) | |
| import model as M # noqa: E402 | |
| class EndpointHandler: | |
| def __init__(self, path: str = ""): | |
| self.predictor = M.load(path or HERE, "cuda" if M.cuda_available() else "cpu") | |
| def __call__(self, data: dict): | |
| inputs = data.pop("inputs", data) | |
| parameters = data.pop("parameters", None) or {} | |
| return self.predictor.predict(inputs, **parameters) | |