PageSourceSearch

https://ais-package.github.io/assets/js/72bdd51f.289f8ed8.js

js ais-package.github.io collected 2026-10-03 08:36:07 UTC 4,011 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkais_package_github_io=self.webpackChunkais_package_github_io||[]).push([[2946],{2124:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>a,default:()=>u,frontMatter:()=>c,metadata:()=>n,toc:()=>d});const n=JSON.parse('{"id":"advanced-guides/Utils/Metrics","title":"Metrics","description":"The metrics file provides utilities to measure, analyze, and compare the performance of the package\'s algorithms in a standardized way.","source":"@site/versioned_docs/version-0.3.x/advanced-guides/Utils/Metrics.md","sourceDirName":"advanced-guides/Utils","slug":"/advanced-guides/Utils/Metrics","permalink":"/docs/0.3.x/advanced-guides/Utils/Metrics","draft":false,"unlisted":false,"tags":[],"version":"0.3.x","lastUpdatedBy":"Jo\xe3o Paulo","lastUpdatedAt":1781982648000,"sidebarPosition":1,"frontMatter":{"sidebar_position":1,"title":"Metrics","sidebar_label":"Metrics","lastUpdatedAt":"2025/04/04","author":"Jo\xe3o Paulo"},"sidebar":"docs","previous":{"title":"Negative Selection","permalink":"/docs/0.3.x/advanced-guides/Core/negative-selection"},"next":{"title":"Multiclass","permalink":"/docs/0.3.x/advanced-guides/Utils/Multiclass"}}');var r=t(74848),i=t(28453);const c={sidebar_position:1,title:"Metrics",sidebar_label:"Metrics",lastUpdatedAt:"2025/04/04",author:"Jo\xe3o Paulo"},a=void 0,o={},d=[{value:"def accuracy_score(...)",id:"def-accuracy_score",level:3}];function l(e){const s={code:"code",em:"em",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.p,{children:"The metrics file provides utilities to measure, analyze, and compare the performance of the package's algorithms in a standardized way."}),"\n",(0,r.jsx)(s.h3,{id:"def-accuracy_score",children:"def accuracy_score(...)"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-python",children:"def accuracy_score(\n    y_true: Union[npt.NDArray, list],\n    y_pred: Union[npt.NDArray, list]\n) -> float\n"})}),"\n",(0,r.jsx)(s.p,{children:"Function to calculate precision accuracy based on lists of true labels and\npredicted labels."}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Parameters"}),":"]}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.em,{children:"y_true"})})," (",(0,r.jsx)(s.code,{children:"Union[npt.NDArray, list]"}),"): Ground truth (correct) labels.\nExpected to be of the same length as ",(0,r.jsx)(s.code,{children:"y_pred"}),"."]}),"\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.em,{children:"y_pred"})})," (",(0,r.jsx)(s.code,{children:"Union[npt.NDArray, list]"}),"): Predicted labels. Expected to\nbe of the same length as ",(0,r.jsx)(s.code,{children:"y_true"}),"."]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Returns:"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.strong,{children:(0,r.jsx)(s.em,{children:"Accuracy"})})," (",(0,r.jsx)(s.code,{children:"float"}),"): The ratio of correct predictions to the total\nnumber of predictions."]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Raises"}),":"]}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsxs)(s.li,{children:[(0,r.jsx)(s.code,{children:"ValueError"}),": If ",(0,r.jsx)(s.code,{children:"y_true"})," or ",(0,r.jsx)(s.code,{children:"y_pred"})," are empty or if they do not have the same length."]}),"\n"]}),"\n",(0,r.jsx)(s.hr,{})]})}function u(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},28453:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>a});var n=t(96540);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.