<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Giskard - 機器學習模型測試框架推薦

          共 4413字,需瀏覽 9分鐘

           ·

          2023-08-23 20:32

          關注 "GitHub精選",設為 " 星標 " 探索有意思的開源項目

          大家好,又見面了,我是 GitHub 精選君!

          背景介紹

          在機器學習領域,對于模型的測試是一項關鍵任務。由于機器學習模型依賴于數(shù)據(jù),測試場景會受到特定領域問題的影響,往往是無限多的。那么從哪里開始測試?該實施哪些測試?應該覆蓋哪些問題?如何實施這些測試?在Giskard項目中,我們相信機器學習需要自己的測試框架。Giskard 是一個專注于機器學習模型的開源測試框架,涵蓋了從表格模型到語言模型(LLMs)的測試需求。

          Giskard-AI/giskard 項目在 GitHub 有超過 1000 Star,用一句話介紹該項目就是:“The testing framework dedicated to ML models, from tabular to LLMs”。

          ac22276e3ebb8d8368c0a6a4052476a2.webp

          項目介紹

          Giskard致力于掃描AI模型以檢測偏差、性能問題和錯誤的風險。它是一個適用于機器學習模型的測試框架,可以從表格模型到語言模型進行測試。Giskard的主要功能包括:

          • 掃描模型以發(fā)現(xiàn)漏洞:Giskard的掃描功能可以自動檢測性能偏差、數(shù)據(jù)泄漏、不穩(wěn)定性、虛假相關性、過度自信、不足自信、倫理問題等漏洞。

          917a41d49376e0abac324399c5025648.webp
          • 自動生成特定領域的測試用例:根據(jù)掃描結果,Giskard可以自動生成相關的測試用例。你可以通過定義領域特定的數(shù)據(jù)切片器和轉換器來定制測試用例,以適應你的使用場景。

          1f48d27a957fd4954d5f5f5007b641ac.webp
          • 借鑒開源社區(qū)的質量保證最佳實踐:Giskard的目標是成為機器學習質量保證的開源中心,你可以輕松貢獻和加載數(shù)據(jù)切片、轉換函數(shù)以及AI基礎檢測器、生成器或評估器。受到Hugging Face哲學的啟發(fā),Giskard旨在成為機器學習質量保證的開源平臺。

          925e69ddeb2ad6bf8e46f9b65dc6398b.webp

          此外,Giskard可以與任何模型和環(huán)境配合使用,并與你喜歡的工具無縫集成。

          12021c03d3e0f094b3e5c53f01769a6d.webp

          如何使用

          • ? 安裝:可以通過以下命令安裝Giskard:

              pip install "giskard[server]>=2.0.0b" -U
          giskard server start
          • ? 掃描模型以檢測漏洞:在封裝好模型和數(shù)據(jù)集之后,你可以使用以下代碼對模型進行漏洞掃描:

              import giskard
          # 替換這里的模型和數(shù)據(jù)集
          df = giskard.demo.titanic_df()
          data_preprocessor, clf = giskard.demo.titanic_pipeline()

          # Wrap your Pandas DataFrame with Giskard.Dataset, containing examples such as:
          # your test set, a golden dataset, etc.
          # See https://docs.giskard.ai/en/latest/guides/wrap_dataset/index.html
          giskard_dataset = giskard.Dataset(
              df=df,  # A pandas.DataFrame that contains the raw data (before all the pre-processing steps) and the actual ground truth variable (target).
              target="Survived",  # Ground truth variable
              name="Titanic dataset"# Optional
              cat_columns=['Pclass''Sex'"SibSp""Parch""Embarked"]  # Optional, but is a MUST if available. Inferred automatically if not.
          )

          # Wrap your model with Giskard.Model:
          # you can use any tabular, text or LLM models (PyTorch, HuggingFace, LangChain, etc.),
          # for classification, regression & text generation.
          # See https://docs.giskard.ai/en/latest/guides/wrap_model/index.html
          def prediction_function(df):
              # The pre-processor can be a pipeline of one-hot encoding, imputer, scaler, etc.
              preprocessed_df = data_preprocessor(df)
              return clf.predict_proba(preprocessed_df)

          giskard_model = giskard.Model(
              model=prediction_function,  # A prediction function that encapsulates all the data pre-processing steps and that could be executed with the dataset used by the scan.
              model_type="classification",  # Either regression, classification or text_generation.
              name="Titanic model",  # Optional
              classification_labels=clf.classes_,  # Their order MUST be identical to the prediction_function's output order
              feature_names=['PassengerId''Pclass''Name''Sex''Age''SibSp''Parch''Fare''Embarked'],  # Default: all columns of your dataset
              # classification_threshold=0.5,  # Default: 0.5
          )

          # Then apply the scan
          results = giskard.scan(giskard_model, giskard_dataset)

          更多的安裝和使用細節(jié)可以參考項目的文檔。

          以下是該項目 Star 趨勢圖(代表項目的活躍程度):

          998bb6a995d0c7ef66bbeecc7c5aca95.webp

          更多項目詳情請查看如下鏈接。

          開源項目地址:https://github.com/Giskard-AI/giskard

          開源項目作者:Giskard-AI

          以下是參與項目建設的所有成員:

          cb9b00ae48f602d9c77df6d33cefd81a.webp

          關注我們,一起探索有意思的開源項目。

          點擊如下卡片后臺回復:加群與技術極客們一起交流人工智能、開源項目,一起成長。

          點擊 支持一下吧
          瀏覽 195
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  成人午夜福利视频 | 草草草视频 | 天天色天天干天天日天天做天天爱 | 色色一级免费电影 | 狼友视频在线播放 |