Instructions to use Zipeng365/WISP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Zipeng365/WISP with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Zipeng365/WISP", "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 src/wisp_release/methods.py from Zipeng365/WISP: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/Zipeng365/WISP/resolve/main/src/wisp_release/methods.py
- Command line
-
hf download hf://Zipeng365/WISP/src/wisp_release/methods.py
-
curl -L -o methods.py https://huggingface.co/Zipeng365/WISP/resolve/main/src/wisp_release/methods.py
1.92 kB
| """Paper names and executable fixed-family constructors (no baselines).""" | |
| from __future__ import annotations | |
| from typing import Any | |
| FIXED_METHODS = { | |
| "wisp_ss": "WISP-SS", | |
| "wisp_rc": "WISP-RC", | |
| "wisp_so": "WISP-SO", | |
| "wisp_cse": "WISP-CSE", | |
| "wisp_gis": "WISP-GIS", | |
| "wisp_cis": "WISP-CIS", | |
| "wisp_ese": "WISP-ESE", | |
| } | |
| SELECTION_METHODS = { | |
| "wisp_select5": "WISP-Select5", | |
| "wisp_select7": "WISP-Select7", | |
| } | |
| SEARCH_METHODS = { | |
| "wisp_random": "WISP-Random", | |
| "wisp_evolution": "WISP-Evolution", | |
| } | |
| def list_methods() -> list[dict[str, Any]]: | |
| """Describe the full paper series without importing optional backends.""" | |
| out: list[dict[str, Any]] = [] | |
| for group, names in ( | |
| ("fixed_family", FIXED_METHODS), | |
| ("validation_selection", SELECTION_METHODS), | |
| ("search", SEARCH_METHODS), | |
| ): | |
| for method_id, name in names.items(): | |
| out.append({ | |
| "method_id": method_id, | |
| "paper_name": name, | |
| "group": group, | |
| "checkpoint_loading": True, | |
| "family_fit": group == "fixed_family", | |
| "select_fit": group == "validation_selection", | |
| "search": group == "search", | |
| }) | |
| return out | |
| def build_family(method_id: str, *, seed: int, n_jobs: int = 1, | |
| direct: bool = False, overrides: dict[str, Any] | None = None) -> Any: | |
| """Construct one fixed WISP family; construction does not fit it.""" | |
| if method_id not in FIXED_METHODS: | |
| raise ValueError(f"family-fit supports fixed families only: {', '.join(FIXED_METHODS)}") | |
| if n_jobs < 1: | |
| raise ValueError("n_jobs must be positive") | |
| from wisp.registry import build_method | |
| params = dict(overrides or {}) | |
| if direct: | |
| params["use_hmm"] = False | |
| return build_method(method_id, seed=seed, n_jobs=n_jobs, overrides=params) | |