Close Menu
techwavedispatch.com

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Deploying ๐Ÿค— ViT on Kubernetes with TF Serving

    November 15, 2026

    Introducing Skops

    November 15, 2026

    Hugging Face’s TensorFlow Philosophy

    November 15, 2026
    Facebook X (Twitter) Instagram
    Trending
    • Deploying ๐Ÿค— ViT on Kubernetes with TF Serving
    • Introducing Skops
    • Hugging Face’s TensorFlow Philosophy
    • A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using transformers, accelerate and bitsandbytes
    • Vision Transformers On Hugging Face Optimum Graphcore
    • Deploying ๐Ÿค— ViT on Vertex AI
    • Stable Diffusion with ๐Ÿงจ Diffusers
    • Pre-Train BERT with Hugging Face Transformers and Habana Gaudi
    Facebook X (Twitter) Instagram
    techwavedispatch.com
    Subscribe
    Sunday, November 15
    • Home
    • AI Tools & Software
    • Machine Learning
    • Generative AI
    • Robotics & Automation
    • Future Tech & Hardware
    • AI in Business
    • Ethics & Regulations
    • More
      • Gadgets & Smart Devices
      • Cybersecurity & AI
      • Tech Breakthroughs
    techwavedispatch.com
    Home»AI Tools & Software»Introducing Skops
    AI Tools & Software

    Introducing Skops

    adminBy adminNovember 15, 2026No Comments5 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Introducing Skops
    Share
    Facebook Twitter LinkedIn Pinterest Email



    Introducing Skops

    At Hugging Face, we are working on tackling various problems in open-source machine learning, including, hosting models securely and openly, enabling reproducibility, explainability and collaboration. We are thrilled to introduce you to our new library: Skops! With Skops, you can host your scikit-learn models on the Hugging Face Hub, create model cards for model documentation and collaborate with others.

    Let’s go through an end-to-end example: train a model first, and see step-by-step how to leverage Skops for sklearn in production.

    
    import sklearn
    from sklearn.datasets import load_breast_cancer
    from sklearn.tree import DecisionTreeClassifier
    from sklearn.model_selection import train_test_split
    
    
    X, y = load_breast_cancer(as_frame=True, return_X_y=True)
    X_train, X_test, y_train, y_test = train_test_split(
        X, y, test_size=0.3, random_state=42
    )
    
    
    model = DecisionTreeClassifier().fit(X_train, y_train)
    

    You can use any model filename and serialization method, like pickle or joblib. At the moment, our backend uses joblib to load the model. hub_utils.init creates a local folder containing the model in the given path, and the configuration file containing the specifications of the environment the model is trained in. The data and the task passed to the init will help Hugging Face Hub enable the inference widget on the model page as well as discoverability features to find the model.

    from skops import hub_utils
    import pickle
    
    
    model_path = "example.pkl"
    local_repo = "my-awesome-model"
    with open(model_path, mode="bw") as f:
        pickle.dump(model, file=f)
    
    
    hub_utils.init(
        model=model_path, 
        requirements=[f"scikit-learn={sklearn.__version__}"], 
        dst=local_repo,
        task="tabular-classification",
        data=X_test,
    )
    

    The repository now contains the serialized model and the configuration file.
    The configuration contains the following:

    • features of the model,
    • the requirements of the model,
    • an example input taken from X_test that we’ve passed,
    • name of the model file,
    • name of the task to be solved here.

    We will now create the model card. The card should match the expected Hugging Face Hub format: a markdown part and a metadata section, which is a yaml section at the top. The keys to the metadata section are defined here and are used for the discoverability of the models.
    The content of the model card is determined by a template that has a:

    • yaml section on top for metadata (e.g. model license, library name, and more)
    • markdown section with free text and sections to be filled (e.g. simple description of the model),
      The following sections are extracted by skops to fill in the model card:
    • Hyperparameters of the model,
    • Interactive diagram of the model,
    • For metadata, library name, task identifier (e.g. tabular-classification), and information required by the inference widget are filled.

    We will walk you through how to programmatically pass information to fill the model card. You can check out our documentation on the default template provided by skops, and its sections here to see what the template expects and what it looks like here.

    You can create the model card by instantiating the Card class from skops. During model serialization, the task name and library name are written to the configuration file. This information is also needed in the card’s metadata, so you can use the metadata_from_config method to extract the metadata from the configuration file and pass it to the card when you create it. You can add information and metadata using add.

    from skops import card
    
    
    model_card = card.Card(model, metadata=card.metadata_from_config(Path(destination_folder)))
    
    limitations = "This model is not ready to be used in production."
    model_description = "This is a DecisionTreeClassifier model trained on breast cancer dataset."
    model_card_authors = "skops_user"
    get_started_code = "import pickle \nwith open(dtc_pkl_filename, 'rb') as file: \n    clf = pickle.load(file)"
    citation_bibtex = "bibtex\n@inproceedings{...,year={2020}}"
    
    
    model_card.add(
        citation_bibtex=citation_bibtex,
        get_started_code=get_started_code,
        model_card_authors=model_card_authors,
        limitations=limitations,
        model_description=model_description,
    )
    
    
    model_card.metadata.license = "mit"
    

    We will now evaluate the model and add a description of the evaluation method with add. The metrics are added by add_metrics, which will be parsed into a table.

    from sklearn.metrics import (ConfusionMatrixDisplay, confusion_matrix,
                                accuracy_score, f1_score)
    
    y_pred = model.predict(X_test)
    
    model_card.add(eval_method="The model is evaluated using test split, on accuracy and F1 score with macro average.")
    model_card.add_metrics(accuracy=accuracy_score(y_test, y_pred))
    model_card.add_metrics(**{"f1 score": f1_score(y_test, y_pred, average="micro")})
    

    We can also add any plot of our choice to the card using add_plot like below.

    import matplotlib.pyplot as plt
    from pathlib import Path
    
    cm = confusion_matrix(y_test, y_pred, labels=model.classes_)
    disp = ConfusionMatrixDisplay(confusion_matrix=cm, display_labels=model.classes_)
    disp.plot()
    
    
    plt.savefig(Path(local_repo) / "confusion_matrix.png")
    
    
    
    model_card.add_plot(confusion_matrix="confusion_matrix.png")
    

    Let’s save the model card in the local repository. The file name here should be README.md since it is what Hugging Face Hub expects.

    model_card.save(Path(local_repo) / "README.md")
    

    We can now push the repository to the Hugging Face Hub. For this, we will use push from hub_utils. Hugging Face Hub requires tokens for authentication, therefore you need to pass your token in either notebook_login if you’re logging in from a notebook, or huggingface-cli login if you’re logging in from the CLI.

    
    repo_id = "skops-user/my-awesome-model"
    hub_utils.push(
        repo_id=repo_id,
        source=local_repo,
        token=token,
        commit_message="pushing files to the repo from the example!",
        create_remote=True,
    )
    

    Once we push the model to the Hub, anyone can use it unless the repository is private. You can download the models using download. Apart from the model file, the repository contains the model configuration and the environment requirements.

    download_repo = "downloaded-model"
    hub_utils.download(repo_id=repo_id, dst=download_repo)
    

    The inference widget is enabled to make predictions in the repository.

    Hosted Inference Widget

    If the requirements of your project have changed, you can use update_env to update the environment.

    hub_utils.update_env(path=local_repo, requirements=["scikit-learn"])
    

    You can see the example repository pushed with above code here.
    We have prepared two examples to show how to save your models and use model card utilities. You can find them in the resources section below.



    Resources

    Introducing Skops
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    Deploying ๐Ÿค— ViT on Kubernetes with TF Serving

    November 15, 2026

    Hugging Face’s TensorFlow Philosophy

    November 15, 2026

    A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using transformers, accelerate and bitsandbytes

    November 15, 2026
    Leave A Reply Cancel Reply

    Top Posts

    NVIDIA Is Investigating Reports That CEO Jensen Huang Was The Target Of Chinese Spy Efforts

    November 8, 202619 Views

    ADIndex: Layer-Adaptive Sparse Attention Indexing via Group-Level Distillation

    November 11, 20265 Views

    Anthropic releases new Mythos and Fable models amid RSI concerns

    November 9, 20265 Views

    One Policy for 100 Household Tasks: Our Solution for the 2026 BEHAVIOR Challenge

    November 11, 20264 Views
    Don't Miss
    AI Tools & Software

    Deploying ๐Ÿค— ViT on Kubernetes with TF Serving

    By adminNovember 15, 20260

    In the previous post, we showed how to deploy a Vision Transformer (ViT) model from…

    Introducing Skops

    November 15, 2026

    Hugging Face’s TensorFlow Philosophy

    November 15, 2026

    A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using transformers, accelerate and bitsandbytes

    November 15, 2026
    About Us

    Welcome to TechWave Dispatch

    At TechWave Dispatch, we bring you the latest news, insights, and developments from the ever-evolving world of technology. Our mission is to keep readers informed about the innovations shaping our digital future.

    From artificial intelligence and machine learning to cybersecurity, robotics, smart devices, and groundbreaking technologies, we cover the topics that matter in today's fast-moving tech landscape.

    Our Picks

    Deploying ๐Ÿค— ViT on Kubernetes with TF Serving

    November 15, 2026

    Introducing Skops

    November 15, 2026

    Hugging Face’s TensorFlow Philosophy

    November 15, 2026
    Most Popular

    After blocking Muse, Amazon now lets users text Alexa to help them shop

    November 6, 20260 Views

    A controlled world for robot learning and evaluation

    November 6, 20260 Views

    Perplexity now has its own always-on AI agent

    November 6, 20260 Views
    Facebook X (Twitter) Instagram Pinterest
    • Terms and Conditions
    • Privacy Policy
    • Contact Us
    • About Us
    ยฉ 2026 TechWave Dispatch. All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.