Legend for changelogs
Major Feature something big that you couldn’t do before.
Feature something that you couldn’t do before.
Efficiency an existing feature now may not require as much computation or memory.
Enhancement a miscellaneous minor improvement.
Fix something that previously didn’t work as documented – or according to reasonable expectations – should now work.
API Change you will need to change your code to have the same effect in the future; or a feature will be removed in the future.
Version 0.5#
Version 0.5.dev0+git.20261115.c051ece#
November 2026
Build and packaging#
Feature The
corpusextra requirespypdfium2, which renders PDF pages forPDFReader’s OCR. It has wheels for every supported CPython, including the free-threaded builds. #931Fix Building scikit-plots from a checkout owned by another user (conda-forge, Docker, CI caches) no longer writes
safe.directoryinto your global Git configuration, which also named the wrong directory and so never helped: the version step retries its onegit logwithgit -c safe.directory=<checkout>, only after Git’s “dubious ownership” refusal. The generated Annoy Cython sources now passcython_generate.py --validate, which compares each output with its template rendered again, and are written atomically. The Mesonfeaturesmodule is reinstalled when its content differs or a stale file remains, not only when the source is newer. A source build with numpy installed outside the checkout no longer fails withInclude dir ../../venv/... does not existwhen the build directory is nested (pip’sbuild/cp3XY): the numpy include path is now computed relative to the project root, and is absolute unless numpy lives inside the source tree. #909Fix The
corpusextra no longer requirespdfminernext topdfminer.six. The two distributions install the samepdfminerpackage; installed together they could leave one that cannot importpdfminer.high_level, whichPDFReaderneeds.PDFReadernow reports such an install by name, with the commands that repair it, instead of reading with pypdf without a word; if you installed the extra before, runpip uninstall pdfminer pdfminer.sixand thenpip install pdfminer.six. #930
Compatibility and dependencies#
New optional extra
rank-bm25(pip install "scikit-plots[rank-bm25]", orscikit-plots-rank-bm25[rank-bm25]) installsnumba>=0.57.0for the compiled BM25 scoring backend, on Python below 3.15 until Numba supports 3.15. Nothing changes without it. #906
Documentation#
Fix
scikitplot.mlflow: the module documentation’s command-line example,python -m scikitplot.mlflow --profile local --open-ui-seconds 5, is now a shell code block. It was written as a Python doctest line, which could not run, and was copied as Python into the publishedscikitplot-mlflowskill. #916Fix The
CorpusBuilderexample in thescikitplot.corpusREADME now runs as written: it raisedRuntimeErrorbecausesearchdefaults to hybrid search, which needs embeddings the example’s build does not make. It now asks formatch_mode="keyword"and says how to enable hybrid search (BuilderConfig(embed=True)). #921New gallery sections for the notebook magics (
galleries/examples/ipymagic: commands, acleanpromptcell, the MCP server, the profiler) and for the environment builder (galleries/examples/env: plan, build and remove, configuration files, policies and error codes), andscikitplot._ipymagicin the API reference. #891The Claude Code plugins no longer carry a copy of
skill-creator. The users’scikitplotplugin is Markdown only and depends on nothing; installskill-creator@claude-plugins-officialto write skills.scikitplot-devdeclares it as a dependency, so Claude Code installs the current version that Anthropic publishes. #906New user-guide page Metadata routing: where scikit-plots takes part in scikit-learn’s metadata routing (estimators built on
BaseEstimator, the experimentalPipeline, the corpus scorers with and without scikit-learn), with the result of each call with routing on and off. The experimentalPipeline’s docstrings linked to this page before it existed, and showed scikit-learn’s version numbers as if they were scikit-plots versions; both are fixed. #909Installation guide, Installing A lightweight version scikit-plots-x: each git command for a single part now installs
scikit-plots-skinnywith it, as a quoted"name @ git+..."requirement. A part alone failed with “No matching distribution found for scikit-plots-skinny”, because its dependency onscikit-plots-skinnywas looked up on PyPI, where it is not published. The section’s label was also missing its colon, so links to it did not resolve. #911
Security#
Feature
scikitplot.cleanprompt: a custom pack pattern that can backtrack catastrophically (nested quantifiers such as^(a+)+$, overlapping alternations, adjacent quantifiers) is now reported when the pack loads instead of loading silently and stalling a run. Warn is the default;--pattern-risk ignore|warn|refuse(packs,batch,plan,ask,mcp),pattern_riskin a plan file andCLEANPROMPT_PATTERN_RISKtune it per run, team or machine, a pattern can be markedrisk: acceptedwith arisk_reason, andpacks --checklists every finding. #864Enhancement
cleanprompt flask --debugis now refused on any non-loopback bind, container mode included, and the generated container files publish on127.0.0.1only. #864Enhancement
scikitplot.cleanprompt: custom pack patterns can now run under a time limit. With the optionalregexpackage installed (pip install "scikit-plots[cleanprompt-timeout]"),--pattern-timeout SECONDS(packs,batch,plan,ask,mcp),pattern_timeoutin a plan file,FluentCleanPrompt().pattern_timeout()orCLEANPROMPT_PATTERN_TIMEOUTgives each document one time budget for every custom pattern. A document that runs past it is not cleaned and fails withPatternTimeoutError, naming the pack and kind but never the text;batchcontinues with the other files. A limit set withoutregex, or a patternregexcannot compile, is refused before any document is read. Built-in patterns are unchanged, anddoctorreports the newtimeouttier. #909Fix
scikitplot.cleanprompt: values written with invisible format characters (zero-width spaces and joiners, bidirectional controls, soft hyphens), full-width or other compatibility forms, or Unicode spaces and dashes inside them are now detected and restored exactly as written; previously they were sent unredacted. #864Fix
scikitplot.cleanprompt: three disguises that sent a value to the model unredacted are closed. First, an invisible character (a zero-width space or joiner, a soft hyphen, a bidirectional control) inside a variable name or a code identifier no longer hides the value it names, as inexport DB_PASS<ZWSP>WORD=...in shell,.env, JavaScript, R, SQL and Python files; the same holds inside a JSON string value, such as an e-mail address. The file’s structure and its exact round trip are unchanged. Second, an e-mail address with one non-ASCII letter anywhere in it is no longer missed whole: an accented local part or domain, an address written in another script, or one starting with a look-alike letter from another script. Addresses may hold letters, digits and combining marks of any script, as internationalised addresses and domains allow. Third, a letter or digit of another script that looks like an ASCII one (a CyrillicAin an AWS access key, a Cyrillicain a URL) no longer hides the value or cuts it short: detection reads it as the ASCII character it imitates, from a table generated from the Unicode confusables data. #909
scikitplot (top-level)#
Fix Looking up a name
scikitplotdoes not have (as pytest and other tools do for optional hooks) anddir(scikitplot)no longer import the plotting API (scikitplot.api, with scikit-learn, SciPy and the vendored seaborn), and a failed import of it is no longer repeated by every such lookup: the re-exported names are now a fixed list, checked againstscikitplot.api.__all__by the test suite.scikitplot.plot_rocand the other plotting functions resolve as before; a brokenscikitplot.apinow fails when one of its names is used, with the import error as the cause, anddir(scikitplot)works even then. #909Fix The command printed when a part of
scikitplotis missing (Install it with: ..., in Python, in thescikitplotcommand line, inscikitplot doctorand in thecleanpromptandmcpcorpus messages) now works as written. It named partial distributions such asscikit-plots-corpusas if they were on PyPI, where they are not yet; it now installs them from the repository together withscikit-plots-skinny, which every part depends on. The partial distributions’ own descriptions also give the two commands for the project’s staging index. New inscikitplot._distributions:requirement,pip_installandstaging_install. #911
scikitplot._build_utils#
Feature
python -m scikitplot._build_utils.generate_apis_reference importschecks only that the documentation build can import what the API reference names: every_get_submoduletarget (imported whenconf.pyloadsapis_reference.py), every documented module and everyautosummaryand deprecated name. A target that needs an absent optional dependency is reported as unavailable and fails only with--strict; coverage of public names is not checked. CircleCI runs it right after building the package, before the documentation build, and it is thecheck-apis-referencepre-push hook. #891Enhancement
generate_apis_reference coveragecompares each module’s__all__, read from the source without importing it, with the API reference, and fails on a public name missing from it or a documented name no longer public that is not already incoverage_baseline.json(known gaps, which may only shrink). It needs no build and runs as the pre-commit hookapis-reference-coverage. A_namein__all__is reported as a gap of its own (private). Names a module exports lazily (imported underif TYPE_CHECKING:with a module__getattr__) count as public, and an entry written"sub.Name"documentsName. An entry that names a submodule, or a name through one (also throughfrom .x import *), is resolved in the source as autosummary resolves it, so it is not reported stale. The API reference now lists every exception and warning inscikitplot.exceptions(19 were missing); so do the global configuration functions ofscikitplot.configand the scikit-learn imputers re-exported byscikitplot.impute; and the remainingagent,mcpandapinames. An entry ofDEPRECATED_APIS_REFERENCEnow documents its name for its module. The known gaps fall from 209 to none.__all__built undertry:(and itselse) orwith:is followed, as for an optional backend;exceptfallbacks are not. #937Fix
generate_apis_reference checkno longer reports a documented submodule that the package does not import itself (such asscikitplot.experimental.enable_ann_imputer) as stale: a simple name is resolved as autosummary resolves it, the attribute or else the submodule of that name, socheckpasses on a complete build. #891
scikitplot._cli#
Feature New command
python -m scikitplot api [MODULE] [--name NAME]lists the public API of the installed scikit-plots: each name in a module’s__all__with its kind, call signature and the first sentence of its docstring, or one name in full with--name. Output istext,markdown,json,yamlortoml. It reads only the installed package (read-only, no network), imports onlyscikitplotmodules, lists a package’s submodules without importing them, and reports a name that does not resolve in a partial install instead of failing. The usage skills are rendered by the same code. #942Fix The
scikitplot cleanpromptinstall hint now names the NLTK extra and says that vault encryption needs no optional package; thecleanprompt-cryptoextra adds only the Fernet cipher. #864
scikitplot._env#
Feature
scikitplot env(alsopython -m scikitplot._envand thescikitplot._envfunctionsplan,create,remove,run,doctor,shell_initandbatch) builds one described environment with whichever tool the machine has: uv,venv+ pip, pipenv (aPipfile.lockinstalled exactly), micromamba, mamba or conda. The request comes from arguments or a TOML, JSON or YAML file (scikitplot-env.toml, or[tool.scikitplot.env]inpyproject.toml; JSON Lines for batches) and names PyPI and Conda packages andrequirements.txt,environment.yml,pyproject.toml(extras and dependency groups) andPipfilesources.planprints every command before anything runs;createruns exactly that plan under a per-environment lock, writes a receipt, and does nothing the next time unless the request or a dependency file changed. Installing micromamba (the conda-forge build, checked against a pinned SHA-256; from a cached archive offline) or uv, editing a shell start-up file and deleting an environment each need an approval given on the command line, in Python or at a terminal, never by a configuration file.--offlineplans only steps that need no network,--targetcross-builds for another Conda platform or the browser (emscripten-wasm32, andpyodideas amicropipscript), and Android and iOS are refused with the reason.--format jsonand--events FILE(JSON Lines) give results and errors, each with a stablecodeand ahint, to CI jobs and agents. #869Fix The JupyterLite Xeus add-on in
scikitplot._envnow builds its browser environments through the environment builder: micromamba is looked up when a build starts instead of once at import, anenvironment.ymlwithoutnameuses its file name instead of raisingKeyError, aprefixgiven as apathlib.Pathno longer raisesUnboundLocalError, a malformedconda-meta/historyline raises instead of being printed and skipped, the empack configuration is downloaded with a timeout and an HTTP status check, and a PyPI package with a compiled file is refused before any of its files is copied into the prefix. #869
scikitplot._externals#
Fix The
_sphinx_jinja_renderSphinx extension now fails the build when an*.rst.templatedoes not render (an undefined variable, a syntax error, an unreadable template or an unwritable output) instead of skipping it silently, which let Sphinx build the.rstleft over from an earlier run. The error names every failing template with its cause and says when an existing output was not regenerated.render_rst_templates(..., strict=True)now attempts every template before raising oneRuntimeErrorthat lists all failures, and best-effort mode logs each skipped template as a warning. Values are no longer HTML-escaped into the generated reStructuredText (a link with&came out as&); templates named.html,.htmor.xmlare still escaped. #909
scikitplot._externals._sphinx_ext._sphinx_feedback#
Feature Page feedback can open a reviewed pull request on Bitbucket Data Center. A
bitbucketstorage target whoseapi_urlis a Data Center REST root,https://<host>[/<context path>]/rest/api/1.0, runs the same reviewed-change engine as GitHub, GitLab and Bitbucket Cloud: a deterministic branch, one immutable event file, one pull request, and every broken-pipe step reconciled from what the server reports.repois<project key>/<repository slug>and the credential is an HTTP access token (Authorization: Bearer). Paged, capped or unexpected answers fail closed, and review URLs must be on the server’s host under the configured repository.check-provideralso reads, without writing, the changes of the base head and confirms their shape. A server whose certificate comes from a private CA is trusted throughSSL_CERT_FILE; verification is never disabled. #909
scikitplot._externals._sphinx_ext._sphinx_gallery_grid#
Fix A gallery-grid card with a
headerbuilds without thedesign.card_legacywarning on Sphinx Design 0.8 and newer: the header is written as acard-headerdirective there, and with the^^^separator on older versions. #928
scikitplot._ipymagic#
Feature
%load_ext scikitplotadds IPython magics that bring thescikitplotcommand line and a profiler into Jupyter, JupyterLab, VS Code, Colab and terminal IPython.%scikitplot ARGSruns any command (info,doctor,env,cleanprompt,mcp…) with the same options, output and exit status as in a terminal, and returns aCommandResult(exit status, captured output and, for--format json, the parsed data in.data);%%scikitplot ARGSgives the cell to the command on standard input. Short native commands run in the kernel and leave its logging configuration as it was; delegated ones run in a subprocess of the kernel’s Python, show their output as it comes, and are stopped together with the processes they started by the interrupt button or thetimeoutsetting. A mistyped command is refused with the closest names (did you mean 'env'?) instead of being guessed,<TAB>completes commands and options from the CLI’s own command model, and errors are shown in two lines instead of a traceback.%scikitplot_profile/%%scikitplot_profileprofile a statement or cell and show the slowest functions as a table (-s,-l,-D FILE), refuse to start while another profiler records the kernel, and with--snakevizopen the profile in snakeviz served on 127.0.0.1 only and stopped when the extension is unloaded.%scikitplot_configsetsraise_on_error(for notebooks run in CI),timeout,isolateandstream. The engine is also a plain function,scikitplot._ipymagic.run_command, for scripts and agents.pip install scikit-plots[ipymagic]installs IPython and snakeviz. #870Fix
%load_ext scikitplot._magicnow loads the new magics with aFutureWarning. Its old%scikitplotran a fuzzy-matched guess when a command was mistyped (so a typo could run another command), called plotting functions that do not exist, imported matplotlib and NumPy and created~/.scikitplotas soon as it was loaded. #870
scikitplot._testing#
Fix The test-performance recorder counts the program of one subprocess launch once on Python 3.13 and newer, where
subprocess.Popenraises a second audit event (os.posix_spawn) for the same launch; its tests now run their child pytest sessions without autoloading installed plugins, so they no longer fail under pytest 9.2 when a plugin warns while it is configured. #891
scikitplot._utils#
Fix
run_with_timeoutaccepts fractional seconds (run_with_timeout(0.5)raisedTypeError), refuses a limit that is not a finite number above zero, refuses to cancel a real-time timer already armed in the process, and puts back theSIGALRMhandler it replaced #867
scikitplot.agent#
Feature New submodule
scikitplot.agent: bounded, audited tool use.Agentruns a goal with a caller-supplied planner (a model adapter or a rule) that returns aDecision(call aTool, or finish); the runtime alone decides whether an action runs, through five gates in order: Validation (the tool’s JSON Schema, a declared subset checked againstjsonschema), Permissions and Scope (Policy, least privilege by default:readtools without scopes only), Budget (Limits:max_steps, which ends every run, tool calls, cost, tokens the planner must report, running time) and Approval (writeandexternaltools need a person’sApproval, bound to the digest of the exact action and re-checked at resume). A denied action is the step’s outcome, not an exception. Every decision, denial, approval and tool call is written to a hash-chained audit trail (MemoryAuditSink,JsonlAuditSink,verify_audit), and theRunStateis saved after every step (MemoryStore,JsonFileStore), so a paused or crashed run resumes; a non-idempotent call in flight at a crash is not repeated. Standard library only. #865Feature A planner can keep a plan in the run:
Decision.actandDecision.finishtakeplan=(the whole list ofPlanItem, eachpending,in_progress,doneordropped), andRunState.planis the plan of the last decision that carried one, saved, audited and resumed with the decisions. A change that removes an item instead of marking itdropped, or alters adoneordroppeditem, fails the run withinvalid_decision, at most one item may bein_progress, and a saved state whose plan history breaks a rule is refused at load. A decision withoutplan=is written exactly as before, so existing states and audit trails are unchanged. Large tool results can be kept out of the run state:Agent(artifacts=..., offload_results_over=N)stores a result whose canonical JSON exceedsNbytes in a content-addressedMemoryArtifactStoreorDirectoryArtifactStoreand records onlyStep.result_ref(digest and size); the digest is the audited result digest, reads verify it, and a run without a store saves exactly what it saved before.delegate(name, child_agent, max_steps=...)runs another agent as a tool inside the parent’s budget: the delegate has the strongest effect and every scope of the child’s tools, so the parent’s gates and approval decide it; the child’s limits are capped by what the parent has left and its spend is charged to the parent; it writes to the parent’s audit trail under a run id derived from the call, linked by asubrunrecord.evaluate_auditverifies an audit trail and reports, per run and over top-level runs, how runs ended, decisions, tool calls, denials by code, failures, approvals, sub-runs, plan changes, tokens, cost and wall time. #906Feature
WorkflowGraphwrites a known order of steps down instead of a planner:Tasknodes call one tool,FanOutnodes call several – one audited step per branch (mode="ordered") or one step that runs every branch at the same time (mode="concurrent"), judged by the gates as its branches together and joined in declared order –Finishnodes answer, andEdgeobjects choose the next node, optionally on a condition. Results are folded into named channels by reducers (replace,append,extend,add,mergeor a function).graph.tools()andgraph.planner()drive an ordinaryAgent, so every call still passes the five gates and is audited;WorkflowGraph.sequence(...)builds a straight line. A graph is checked when it is built – every node reachable, aFinishreachable from every node, every loop through a node withmax_visitsand itson_exhaustedexit not leading back – so every graph that can be built terminates. The planner replays the recorded steps at each decision, so resume needs no new state, the state schema is unchanged, and a state the graph did not produce is refused withWorkflowError;graph.replay(state)returns the position andWorkflowView.digest()its digest. #909
scikitplot.annoy#
The Annoy test suite writes nothing into the package: every index a test saves goes to
tmp_path, and a guard fails a test module, or the session for a write at a module’s import, that adds or changes a file in the test directory (every file there is shipped in the wheel).index_test.pyno longer downloadstest.treeat import, which no test read; without the network the module was a collection error that stopped the whole directory. The fixturetest64.treeis committed (its.gitignorenegation now follows the patterns it undoes). The ann-benchmarks accuracy tests are opt-in: setSKPLT_ANNOY_ACCURACY_DATAto a cache directory to run them. They were allxfail, which hid thattest_lastfm_angularbuilds a 65-dimensional index from 64-dimensional rows; it is now a strictxfailon thatValueError. #865
scikitplot.cleanprompt#
Feature
--style surrogatecan use your own stand-in names: a surrogate set is a YAML or JSON file ofPERSON,ORG,GPE,LOCandFACpools, validated when it loads (unknown keys, empty or duplicate entries, look-alike or mixed-script entries and anything a structural pattern would detect are refused), selected with--surrogates FILEonredact,encode,roundtrip,batch,ask,mcpandplan, withFluentCleanPrompt().surrogates(path)or in a plan file, and loaded in Python withload_surrogate_set. The set’s identity is part of the tag style and of the plan fingerprint, so editing a set makes a saved plan stale;EMAIL,PHONEandURLkeep their built-in reserved forms, and the default output is unchanged. #864Feature
scikitplot.cleanprompt: a policy can now choose what happens to each kind of value once it is detected:tokenize(a placeholder),surrogate(an invented stand-in),report(leave it and list it) orblock(refuse the whole text withBlockedError). Set it with--action KIND=ACTIONon every command that cleans,FluentCleanPrompt().action(),RedactionPolicy(actions=...), a plan file or a config file. A run that reports values prints an alert,doctorlists reported kinds as blind spots, and the guard and the MCP server refuse to send them. Without actions the output is unchanged. #909Enhancement The CleanPrompt user guide is now several task-oriented pages, including entity-engine readiness, web and container deployment, and an explicit list of what is and is not protected. #864
Enhancement
scikitplot.cleanprompt:kinds --matrixprints the coverage matrix. For every detection kind it shows which core patterns, packs, entity engines and tiers find it, whether a validator checks it, whether a stand-in exists, and what the policy’s actions do with it (--action KIND=ACTIONto see your own). The user guide’s new coverage table is generated from the same data. A newvehiclepack (--pack vehicle) finds vehicle identification numbers: in running text only when the North American check digit holds, and next to aVINorchassis numberlabel in any well-formed spelling, plus licence-plate fields. A surrogate set can list ordinary words underavoid(avoid: [the, ash]): an entry equal to one is refused when the set loads, and no stand-in equal to one is issued, combined names and the built-in names included, sodecodecan no longer rewrite those words in the model’s reply. Words compare ignoring case, compatibility forms and separators. A newdepack (--pack de) finds the German tax identification number (Steuer-ID), written together or in groups, only when its published structure rule and check digit hold, and in fields such assteuer_id. #909Fix
doctor,inspect,encodeand the web app now agree on whether an entity engine can run: an engine installed without its spaCy model or NLTK data is reported as not ready with the exact download command,autono longer selects it, and an explicit--nerrequest fails before any text is read. NLTK data present only under pre-3.9 names is detected as unloadable. The web app now honoursner_engine,languageandmodel_size, anddocker --with-nerinstalls the model it runs with. #864Fix
scikitplot.cleanprompt: telephone numbers in common international groupings are now hidden whole. Previously the country and area code of+33 1 23 45 67 89or+49 (0)30 1234 5678were sent beside the placeholder, and numbers with a long subscriber group (+49 30 12345678,030 12345678,+44 7700 900123) were not found at all. An extension (ext. 123,x12) is hidden with its number. Year ranges such as2019-2024and day-month-year dates are no longer mistaken for phone numbers. Separately, a placeholder spelling already present in the source text, such as[email_1]or\[EMAIL-1\], is now restored exactly as written, in a single call and across a session’s turns. Previously restoration replaced it with the value issued under that label, in the same call or an earlier turn. #909The API reference of
scikitplot.cleanpromptlists 44 public names it lacked: the error classes, result types, logging and audit helpers, the pattern catalog and surrogate sets, pattern-risk analysis, engine readiness and coverage, policy actions,new_key,corpora_statusand the corpus integration functions. #937
scikitplot.config#
Enhancement New
scikitplot.config.citationreturns a BibTeX entry.citation("all")(the default) isscikitplot.__bibtex__, which cites every version.citation("build")cites the installed build: its version and kind, the build version with its commit, and the URL of that exact source tree, so a notebook can record exactly what it ran. A build made without git has no year or month and cites the repository. A release gets its own Zenodo DOI only when the DOI was known at build time. The entry is the same onetools/citation/citation_ref.pywrites for that version, commit and date; nothing is read from the network. #909Fix
scikitplot.config.__all__liststestonce, and only when the pytest runner imports; it was listed twice before. #937
scikitplot.corpus#
Feature Corpus can now measure retrieval and answers. Ranking metrics (
precision_at_k,recall_at_k,hit_rate_at_k,mean_reciprocal_rank,mean_average_precision,r_precision,ndcg_at_kandranking_metrics) and answer metrics (exact_match_score,token_f1_score,edit_similarity_score,anls_score) take scikit-learn’s(y_true, y_pred)signature;make_corpus_scorerandget_corpus_scorerturn them into scorers forcross_validateandGridSearchCVthat can also score a corpus index directly (response_method="search"), on scikit-learn’s own_BaseScoreror a vendored copy when scikit-learn is absent;evaluate_retrievalruns a retriever over a query set and returns a report of per-query and mean metrics, rankings, latency and response statuses, written as strict JSON, JSON Lines, YAML or TOML and compared with a baseline by a paired randomisation test;make_pairwise_rankerandmake_levenshtein_rankerbuildCustomRetrievalIndexrankers. Generated answers can be judged by language models:make_llmputs OpenAI, Anthropic, Gemini or any callable behind one call (SDKs imported only when used, nothing sent that was not asked for);LLMJudgescores faithfulness, answer relevance, context precision and recall, answer correctness, a custom rubric and order-swapped pairwise preference from strictly parsed JSON verdicts;evaluate_answersandevaluate_preferencerun one judge or a panel over a dataset (your system, or stored answers from any model) with token usage, judge identities and failures recorded;cohen_kappa,fleiss_kappaandkrippendorff_alphameasure agreement between judges. Documents can be named by time-ordered RFC 9562 UUIDv7 instead of the content-addressed SHA-256 default:BuilderConfig(doc_id_scheme="uuid7"),CorpusPipeline,HookableCorpusPipelineandcreate_corpus(keyworddoc_id_scheme) andFluentCorpus().identity("uuid7")mint one id per document, per source in reading order, right after the source is read, with parent links inside the source kept.uuid7(),UUID7Generator(thread-safe, monotonic within a process, reseeded in a forked child, injectable clock and random source),uuid7_unix_ms,doc_id_scheme_of,assign_doc_idsandDocIdSchemeare public. A UUIDv7 is new on every build, so deduplicate bycontent_hashand keep qrels for the build that minted the ids. Searches can be filtered:RetrievalIndex.search,CorpusBuilder.search,RuntimeCorpus.searchandCustomRetrievalIndex.searchtakefilter=(aFilterexpression of scalar document fields ormetadata.<key>, or its JSON form), applied by every leg before ranking so a filtered query returns the besttop_kmatching documents, and each leg reports how it answered the filter (LegOutcome.filter_capability, every operatorEMULATED); aSecurityFilterbound to an index (RetrievalIndex,CustomRetrievalIndex,BuilderConfig(security_filter=...)) is AND-ed with every query and with the vector seamRetrievalIndex.query, keeps BM25 statistics inside the scope, and is reported by its label; callers can narrow but never widen what they see;filter_to_dict,filter_from_dictandvalidate_filtercarry and check filters through JSON with strict validation and size limits.RecursiveChunkercuts a text by a separator hierarchy (blank line, line, sentence end, space, character) until every piece fitschunk_size, andParentChildChunkerproduces large parents for context with small children inside them for retrieval; documents built from a child carryparent_doc_id, the first producer of that field. Both are registered by name ("recursive","parent_child"), keep every chunk a slice of its source, and are not defaults.StructureChunkerchunks Markdown or reStructuredText by its headings and code blocks: code blocks are chunks of their own, the prose of each section is split by the recursive rule, a heading not followed by prose is a chunk of its own, and every chunk and its document carryheading_path,section_levelandblock; registered as"structure", not a default.RetrievalExecutionPlanruns retrieval through typed stages, in a fixed order: transform (multi-query, rewrites), retrieve (index.searchper query, unchanged), fuse (byFusionPolicy), rerank and compress (character spans of each hit’s text). Each stage reports aStageOutcomewith its status, calls, seconds and budget; a stage that fails or is stopped says why, and the result’s status is derived. AStageBudgetlimits the calls and seconds of retrieve, the one stage of several calls, anddeadline_secondsstops any later stage from starting. An empty plan returns exactly whatindex.searchreturns, andevaluate_retrieval(plan.bind(index), ...)measures a plan.CharBudgetCompressorkeeps context within a character budget.CorrectiveRetrievalgrades what a search returned and then accepts it, retries with a caller’s rewritten query withinmax_roundsanddeadline_seconds, returns the ambiguous rounds fused as partial evidence, or abstains with no hit; every round is graded against the original query, reported in aCorrectionResult(verdict, rounds, grades with the grader’s name), and measured byevaluate_retrievallike an index.TermCoverageGraderis the deterministic grader (the share of query words in the top hits, against two thresholds); a model grader is any callable returning aGradeResult. #865Feature Corpus can measure whether scores presented as probabilities of relevance behave like probabilities:
brier_score,binary_log_loss,reliability_table,expected_calibration_errorandcalibration_reporttake scikit-learn’s(y_true, y_prob)order, keep empty bins in the reliability table so two tables line up, refuse graded labels instead of thresholding them, and need no scikit-learn (their results equalbrier_score_loss,log_lossandcalibration_curve).LogOddsFusioncombines retriever legs whose scores have fitted calibrators into probabilities of relevance: each leg’s evidencelogit(p) - logit(prevalence), weighted, is added tologit(base_rate)(Bayes’ rule for legs independent given relevance), a leg that did not list a document adds nothing, and an unfitted calibrator is refused. Each fused item carries its per-leg contributions, and the result reports the marginal correlation of every pair of legs’ evidence. Rank fusion (FusionPolicy) stays the default. Hybrid search fuses this way when givenRetrievalConfig(match_mode="hybrid", probability_fusion=ProbabilityFusion(policy, calibrators)): each leg’s native score (BM25, cosine) is calibrated by that leg’s calibrator, hits are scored by the fused probability (native_metric="logodds_probability"), leg weights come from the policy (hybrid_alphamust stay at its default), and an index bound to aSecurityFilterscope is refused because its BM25 statistics differ from the ones the calibrator was fitted on.CutPolicykeeps a fixed count, every hit at or above a probability threshold (refused on scores outside[0, 1]) or the hits above the largest score gap, clamped bymin_k/max_k, and reports its evidence in aCutResult.CachedSearchis an exact, bounded, thread-safe cache in front of an index, keyed by the index’s content generation, its security filter, the query, every config field, the caller’s filter and the query embedding; onlysuccessandemptyresponses are kept, and hits come back as copies. #906Feature
routedetects the shape of a query from its words and adds the evidence paths that shape needs, when the index has them:multi_hopandhierarchyadd graph traversal,aggregation,negationandtemporaladd metadata filters (newhas_metadata=).RoutePlangainsshapesandunavailable(the paths a shape needed that the index lacks); a plain query routes exactly as before and a quoted phrase is still lexical only. The rules are data:RoutingRule(a shape, its legs, whole-wordphrasesand an optionalmatcher(tokens) -> bool) andRoutingPolicy(rules in order,with_rulesto extend or replace), withDEFAULT_ROUTING_POLICYfor English androute(query, policy=...)for another language or vocabulary. Matching is on whole words, never on caller-supplied regular expressions, so routing is linear in the query’s length. A labelled routing set of 45 queries, near misses included, pins the default policy. #909Feature
derive_graphderives a document’s outline from theheading_paththatStructureChunkerrecords on every chunk: oneheadingnode (NodeKind.HEADING) per source and heading path,containsandparent_ofedges between a heading, its sub-headings and the documents directly under it, andsame_sourcefrom each top heading to its source. A traversal can therefore walk from a chunk to its section, its sibling chunks and the rest of the outline. Nothing is stored, and documents without a heading path give the same graph as before. #928Feature
PDFReadertakespdfminer_kwargs, keyword arguments forpdfminer.high_level.extract_pages; a mapping under"laparams"becomes the layout parameters. pdfminer.six can order the text boxes of a page differently on two reads of the same file;pdfminer_kwargs={"laparams": {"boxes_flow": None}}orders them by position, which gives the same text every time. #930Feature
PDFReadercan read scanned pages with OCR.ocr="auto"renders a page whose text layer is empty (or shorter thanocr_min_chars) with pypdfium2 and reads it with Tesseract or easyocr (ocr_engine);ocr="always"reads every page, and a callable(page_number, text) -> booldecides per page.ocr_enginealso takes a callable,ocr_dpisets the resolution,pypdfium2_kwargspasses rendering options, andocr_max_pages(default 64) bounds the work, with a warning for the pages left. Readers in parallel threads render one page at a time, since PDFium is not thread-safe. The default,ocr="off", reads as before. #931Feature New
OfficeReaderreads office documents with the standard library only: Office Open XML (.docx,.docm,.dotx,.dotm,.pptx,.pptm,.potx,.potm,.ppsx,.ppsm,.xlsx,.xlsm,.xltx,.xltm; Strict and Transitional) and OpenDocument (.odt,.ott,.ods,.ots,.odp,.otp,.odg,.otg,.odfand the flat.fodt,.fods,.fodp,.fodg). Body text and tables come in document order, slides and pages in deck order, sheets as tab-separated rows (rows_per_chunk=; stored values, formulas never computed), with speaker notes, footnotes and endnotes (notes=) and hidden slides and sheets (hidden=). In Word and OpenDocument text a heading starts a new chunk, and the chunks under it carryheadingandheading_level(headings=). The content decides how a file is read, not its extension. XML parts are parsed with entity declarations refused, sizes and repeat counts are bounded, encrypted and ambiguous packages are refused, and macros are flagged (has_macros), never run. #935Feature
OfficeReadernow identifies every Office file name. Office add-ins, macro sheets and workspaces (.wll,.wwl,.xll,.xla,.xlam,.xlm,.xlw,.ppa,.ppamand the Mac variants) are refused as code, not documents, instead of failing with “no reader registered”. Legacy names (.doc,.dot,.wbk,.xls,.xlt,.ppt,.pot,.pps) are registered: a legacy binary file is refused with the reason, and a modern file saved under such a name is read.code_files="skip"passes over add-ins with a warning instead, so a large folder or archive is read past them; neither setting reads one. #937Efficiency Keyword (BM25) search over an unscoped index scores from contributions computed once per build when
scikitplot.rank_bm25is installed: about 99 ms to about 2 ms per four-term query on 200 000 documents, with bit-identical results. Searches under aSecurityFilterscope, whose statistics depend on the scope, and installs withoutscikitplot.rank_bm25keep the previous evaluation. #906Efficiency
detect_scriptdecides an ASCII sample without testing its characters against every script’s code-point ranges, which reached Latin last: in ASCII onlyA-Zanda-zcount, and only as Latin, so every result is unchanged. On English text such samples are 20 to 33 times faster. The sentence, word, paragraph, fixed-window and semantic chunkers run it on every chunk:CorpusBuilder.buildover 64 English markdown and text files took 3.2 s instead of 6.2 s. #920Efficiency The input check that the sentence, word, paragraph, fixed-window, semantic and recursive chunkers run before chunking finds a lone surrogate with one compiled search instead of a Python loop over every character. It refuses the same texts with the same message, and over 64 English markdown and text files (3.35 M characters) it took 14 to 16 ms instead of 120 to 197 ms. #921
Efficiency
CorpusDocument.replacecomputes the document’s field names once per class instead of on every call, so it accepts and refuses the same names 20 to 25% faster;CorpusBuilder.build, whose normalizer steps call it for every chunk, took 2.9 s instead of 3.2 s over 64 English markdown and text files. #922Efficiency
NormalizationPipelinebuilds one document for each run of consecutive built-in text-only steps (UnicodeNormalizer,WhitespaceNormalizer,HTMLStripNormalizer,LowercaseNormalizer,DedupLinesNormalizer) instead of one per step; those steps gainnormalize_text(text). The normalised documents are unchanged, and a custom step, a step that sets another field or a subclass that overridesnormalize_docruns as before.CorpusBuilder.buildwith its default two steps took 2.7 s instead of 3.0 to 3.1 s over 64 English markdown and text files. #926Efficiency
PDFReaderreads a file in one pass per backend instead of opening it again for every page: pdfminer.six walks the page tree once, and pypdf parses and decrypts the file once. A 277-page PDF takes 7 s instead of 75 s with pdfminer.six and 5 s instead of 33 s with pypdf; the text of each page is unchanged. #930Enhancement Probability fusion now runs on an index bound to a
SecurityFilter. Pass the scope the lexical calibrator was fitted under asProbabilityFusion(scope=...); hybrid search fuses only when the index’s scope has the same digest, and otherwise refuses with aValueErrornaming both digests (a calibrator fitted unscoped is still refused on a scoped index, and the reverse). The newSecurityFilter.digestis the SHA-256 of the expression’s canonical JSON, so two filters with one label are two scopes. A dense-only fusion (lexical weight 0) runs under any scope, because cosine similarity does not depend on it. Rank fusion is unchanged. #909Enhancement
DefaultFilterno longer drops text in scripts written without spaces between words (Chinese, Japanese, Thai, Lao, Khmer, Myanmar, Tibetan): with the new defaultword_count="script",min_wordscounts one word per character of those scripts and counts other text as before.word_count="whitespace"restores the old count, and a callable(text) -> int(a word segmenter, for example) counts in its own way. #932Enhancement
OfficeReaderflags Word text formatted as hidden: a chunk that holds any carrieshas_hidden_text=True, andhidden=False(which already left out hidden slides and sheets) leaves the hidden runs out. Hidden text is invisible to a reader but reaches a model that reads the file. OpenDocument text counts the same way: conditional hidden text, a paragraph marked hidden and a section that is not displayed. In Word a character style, a paragraph style or the document default that hides text counts as well. In OpenDocument, a span or paragraph style that is not displayed counts too. Chunks of a text document also carryheading_path, the headings they sit under from the top down, and a slide’s chunks and notes carry its title as their heading. #936Enhancement Every corpus reader takes
max_text_chars,max_text_chars_per_byteandon_text_limit("refuse"or"truncate"): a bound on the text one input yields, counted as chunks stream at the one place every chunk passes, custom extractors and archive members included. The limit is the smaller ofmax_text_charsandmax(max_text_chars_per_byte x file size, 1 Mi)characters, so output, and the work of extracting it, stay in proportion to the input. Both are off by default, except where a small file can expand:OfficeReader(a cell repeated across columns and rows: 483 bytes could yield 34 billion characters) andPDFReader(pages sharing one compressed stream: 4 KB yielded 4 million characters) default to 256 Mi characters and 50 characters per byte.ZipReaderbounds each member by its own reader and the archive total by its own setting; a truncated chunk is markedtext_truncated. #937Fix
EmbeddingEngineno longer serves one custom provider’s cached vectors to another (a custom provider is cached only under acustom_fn_id), loads themodel_revisionit records, appliesnormalize=Trueto every backend before thedtypecast (float16rows no longer come back as zeros, and a non-finite vector is no longer hidden as one), returnsfloat64cache hits without rounding, caches URL sources like files, and stamps every embedded document with its embedding manifest so an index refuses to rank vectors from two embedding generations together (CorpusBuildernow embeds through the same path);SemanticChunkerreports the backend that actually ran, with the requested one and the fallback reason beside it, names a model on the result and on each chunk only when the model was called, falls back (or, withallow_fallback=False, raises) when the model fails to load or to encode as well as whensentence-transformersis missing, and no longer encodes every chunk a second time.CorpusBuilderresolves chunker names and normaliser steps through the shared componentregistry, the same table plans andRuntimeCorpusnow use:chunker_kwargsnow build the named chunker’s config (a config option used to raiseTypeErrorfor every built-in chunker), go on to the chunker’s constructor when it takes them (gensim_dictionary,adapter), and an unknown key raises naming the valid ones;"word"and"semantic"are registered; a chunker added withregistry.register_chunkeris reachable by name and is never replaced by a built-in of the same name; an unknown normaliser step raises instead of being dropped with a warning;normalizer_kwargs, documented but read nowhere, now maps a step to its options; options given with a chunker instance, without a chunker, or beside achunker_factoryare refused, and so is a chunker class given instead of an instance; a configuration error raises frombuildbefore any source is read instead of failing once per source.ComponentRegistry.load_from_snapshotaccepts the built-in chunkers and normalisers it used to refuse, a subclass of a built-in chunker uses that chunker’s bridge, a chunker config’s enum option given by value (SentenceChunkerConfig(backend="regex")) is converted at construction (an unknown value raises there) instead of failing insidechunk(), and an unknownSemanticChunkerConfig.adapter_unitraises. Chunk text is a slice of the source: overlap chunks (sentence, paragraph), merged and split chunks (paragraphmerge_short/max_length, the semantic merges and splits) and fixed windows (strip_whitespace, token windows) used to re-join parts with a space or a newline (inserting a space into CJK text) or keep an unstripped span;Chunkgainscontext_start/context_end(context_span, the region its text comes from) beside the anchorstart_char/end_char(anchor_span),WordChunkersentence chunks span their own sentence instead of(0, len(sentence)), a sentence splitter whose output is not in the source raises when offsets are enabled instead of being placed at a guessed position, and a document built from a chunk spans the chunk’s context (it used to span the anchor start plus the text length, the wrong region for an overlap chunk, and itsraw_textwith it), with the anchor inmetadata["anchor_span"]when they differ, and no span when the chunker reports no offsets. A document’sraw_textisNonewhen its region is unknown instead of the whole parent text for every chunk of a split parent with offsets disabled, an overlap chunk’s multilangraw_textcovers its context instead of its anchor, and noraw_textis sliced by spans that do not index it (a reader’s HTML or XML markup, or text that multilang preprocessing changed:metadata["span_basis"]is then"preprocessed").WordChunkerhonoursinclude_offsets(Falseby default: no span), andSemanticChunkerwithinclude_offsets=Falsereports(0, 0). An overlap chunk’s context includes a unitmin_lengthdropped inside it. An unpinned embedding model’s cached vectors were served after an upstream change of the model, and the embedding cache grew without bound.MultimodalEmbeddingEngine.embed_documents_with_cachekeyed its cache on the source path, its modification time and the document count: changed text, another custom function or anothernormalizesetting were served the first vectors, and a document left without an embedding made it raise; the key is now the content and every setting that changes the output (entries written under the old key are not found again).ScriptSegmentercalledregex.get_script, which theregexlibrary does not have, so withregexinstalled every text came back as one span of unknown script (with a warning about'_unknown'); it now detects scripts with\p{Script=...}, itsstart/endare character offsets (they were grapheme-cluster indices, which every consumer read as character offsets), a script the map does not name is a span of its own instead of being absorbed by its neighbours, short spans merged bymin_span_charsleave one span per run, Tamil, Telugu, Kannada, Malayalam and Sinhala map toSOUTH_ASIANand Lao toSOUTHEAST_ASIAN(as documented), and Han that meets kana (Japanese) or Hangul (Korean) letter to letter stays in one span. Withregexinstalled,SemanticChunkerandWritingSystemAdaptertherefore dispatch each span to its script’s strategy, so their chunks change: Chinese withoutjiebabecomes one chunk per character, and Arabic, Hebrew, Devanagari, the Dravidian scripts and others use their own strategies.RetrievalResponse.to_dict()andLegOutcome.to_dict()now return a JSON-compatible mapping as documented: a leg’sgenerationis written as itsIndexGeneration.to_dict(), where it used to be the object itself andjson.dumpsraised. #865Fix
SQLiteStorage.search_textandStorageQuery(full_text=...)onSQLiteStorageno longer raise for text holding a NUL character (sqlite3.OperationalError: unterminated string) or a lone surrogate, U+D800 to U+DFFF (UnicodeEncodeError), which a JSON request can carry. Thescikitplot.mcplexical leg (Bm25Retriever) reported such a query as a failed search, so hybrid search ran without its keyword results. Each such character now separates words like a space. #919Fix
SQLiteStorageandJSONLStoragerefuse a document holding a lone surrogate (U+D800 to U+DFFF) before writing anything, with aValueErrornaming the document and the place (JSONLStorage: document '...': $.metadata.k holds a lone surrogate, which JSONLStorage cannot encode as UTF-8), as the JSON, JSON Lines and TOML exports already do. They raised a bareUnicodeEncodeErrorinstead, and on CPython 3.11 and newer SQLite could report it as an earlier, unrelated error.InMemoryStoragekeeps such a document, as the YAML export does. #923Fix
ImageReaderreads the frames of a multi-frame image one at a time instead of copying all of them before the first OCR call, and stops at the newmax_frames(default 64;Nonereads every frame). When a file holds more, a warning names the file, its frame count and the frames left unread. A 280-frame GIF took about 1 GiB before any text was produced and now takes about 60 MiB. #928Fix
PDFReaderpassespasswordto pdfminer.six. An encrypted PDF read withprefer_backend="pdfminer"and the right password gave no documents, and in the default mode its text came from the pypdf fallback only. #930Fix
PDFReaderno longer returns nothing for a file it cannot read. A file that is not a complete PDF, or an encrypted one with the wrongpassword, raises aValueErrorthat gives each backend’s reason (CorpusPipeline.run_batchreports it and goes on to the next file). A page no backend can read is skipped instead of ending the read, and the skipped pages are named in a warning. A file whose pages hold no text, such as a scan, gives a warning thatPDFReaderdoes not run OCR. #931Fix
TextReader(.txt,.md,.rst) detects the encoding from the whole file instead of its first 8 KiB. A UTF-8 file with a multi-byte character across byte 8192 was decoded as latin-1 where chardet is not installed, and a file whose first non-UTF-8 byte came later raisedUnicodeDecodeError. UTF-16 and UTF-32 text no longer starts with U+FEFF, a binary file raisesValueErrorinstead of becoming a document, and text that is not UTF-8 is decoded as Windows-1252 when it can be, so curly quotes, dashes and the euro sign are kept. #932Fix
AudioReaderraisesValueErrorfor an empty (0-byte) audio file unless acustom_extractoris set. It returned no documents and logged a warning suggestingtranscribe=True, which then ran the speech recognition backends on a file with no audio. #933Fix
ZipReaderwarnings for a member that cannot be read name it inside the archive (docs.zip/a/bad.png), as other member warnings do. They named the random temporary extraction path, so the same archive gave a different message on every run. #934Fix
PDFReadergives the same text for every page on every read. pdfminer.six ordered text boxes that are equally far apart by their memory address, so a page with many such boxes (a figure with repeated labels) could come out in a different order on another read of the same file. Pages without such ties read as before, columns included.pdfminer_ties="pdfminer"reads in pdfminer.six’s own order. #935Fix
OfficeReaderreads every piece of text once: a text box or equation that a file also stores as a compatibility fallback, text that tracked changes moved, and a table nested in a table cell (Word and OpenDocument) no longer appear twice. A package member that is damaged, or encrypted at the ZIP level, raisesValueErrornaming the part instead ofBadZipFileorRuntimeError. #936Fix
OfficeReaderrefuses an Excel cell referenced past the last column (XFD, 16,384) withValueError, as it already did for OpenDocument. Before, one such cell in a tiny workbook expanded its row to the referenced width: a seven-letter reference took 2.9 GB and 28 seconds, and longer ones ran out of memory. A spreadsheet row or chunk is also no longer built past the text limit before the limit refuses it: a 485-byte OpenDocument file took 845 MB to refuse (far more with longer cells), now 55 MB. #937Fix
OfficeReaderbounds a package part in proportion to the file: the new optionmax_part_bytes_per_byte(default 50;Noneturns it off) lets an XML part inflate tomax(50 x file size, 1 Mi)bytes, and never more thanmax_part_bytes. Before, a 50 kB.docxor.pptxwhose main part inflated to 14.5 MB took 112 MiB and 7 seconds to refuse, and a file under 1 MB could reach the 256 MB part limit (about 2 GB of memory). Such a file is now refused before the part is read, with a message that names the option; a file with honestly repeated content past the ratio needs a larger value. #938Fix
ZipReaderbounds an archive in proportion to its size on disk. It defaults tomax_text_chars=256 Miandmax_text_chars_per_byte=50(asOfficeReaderandPDFReader), and the whole archive tree, nested archives included, may extract at most 4 bytes for each character that ratio allows (by defaultmax(200 x archive size, 4 Mi)bytes, never more thanmax_total_bytes). Before, a 52 kB archive of one compressed text file yielded 25 million characters in 50 seconds, and a 5 kB archive of 25 nested archives extracted 105 MB; both are now refused before extraction with the newArchiveBudgetError(aValueError), which ends the whole tree instead of skipping one member. Withon_text_limit="truncate"the archive ends with a warning and keeps what was read. Highly compressible members past these limits need a largermax_text_chars_per_byte(orNone, which turns both off). #941API Change
TextReader(encoding=...)is a policy, and chardet is no longer consulted unless asked for.Nonedetects by fixed rules, the same on every machine; a codec name decodes strictly; a list of codecs takes the first that decodes the whole file;"chardet"asks chardet; a callable(raw) -> codecdecides. Every chunk records the codec used in itsencodingmetadata. A file that is neither marked nor UTF-8 now decodes as Windows-1252 (or latin-1) with a warning where an installed chardet used to guess: passencoding="chardet"or the corpus’s codecs. #932API Change
scikitplot.corpusno longer exports five private names byimport *:_PROMOTED_RAW_KEYS,_SOURCE_EXT_MAP,_coerce_documents,_split_cjk_chars_legacyand_validate_text_input. They remain importable by name from their own modules. 29 public names (capability registry, download and backend policies, speech-recognition backends,runtime_policyand others) are now in the API reference. #937A hostile-sample test gate reads one small crafted file per reader format (
.xlsx,.ods,.docx,.pptx,.pdf,.zip,.xml; each under 64 KiB) with the default settings, in a child process, under a time ceiling (20 s) and a traced-memory ceiling (64 MiB): a small input that expands far past its size now fails a test. #938
scikitplot.datasets#
scikitplot.datasetsdeclares__all__(the loader functions it already exported), so the API-reference check reads it. #937
scikitplot.feature_selection#
Feature New
scikitplot.feature_selectionfor wide pandas tables.profile_features(orFeatureProfilerin a pipeline) fits aFeatureSchemaon training data: every column gets a role, dtype family, semantic kind, user tags, a bin recommendation (Knuth, Freedman-Diaconis, Scott … with frozen edges) and policy-backed assessments such asskewed,discrete,constant,binary,identifier_likeorhigh_cardinality, each with evidence and an explicitunknown/not_applicablestate; thresholds, roles, kinds, tags and manual overrides live in aFeaturePolicyread from TOML, YAML or JSON, and new questions are added withregister_assessment.FeatureColumnSelectorroutes columns into aColumnTransformerby kind or assessment on each training fold,FeatureFilterdrops constant and identifier-like columns and non-feature roles, andFeatureRenamerapplies a frozen rename plan.trace_pipelinereads a fittedPipeline/ColumnTransformer/FeatureUnionand reports, per raw column, the steps that touched it, the columns it became and where it was dropped, checks every stage’s width against its real output, andFeatureLineage.attributesums one-hot (or any exactly traced) importances and SHAP values back to raw columns.ReferenceProfilefreezes a training reference and reports per-feature PSI, Jensen-Shannon distance, missingness change and unseen categories. #867
scikitplot.logging#
Fix The notebook check behind the default log stream calls
IPython.get_ipython()and inspects the shell it returns; it read an attribute of the function instead, so a running Jupyter kernel withoutJPY_PARENT_PIDor a loadedipykernelwas taken for a terminal #867API Change
scikitplot.loggingno longer exports_default_logging_level,_get_thread_idand_is_jupyter_notebookbyimport *; they stay reachable as attributes.TaskLevelStatusMessageis now exported, and the re-exported standard-library names (Logger,Handler,getLoggerand others) are listed in the API reference. #937
scikitplot.mcp#
Feature The Corpus+Annoy retriever can be scoped by the corpus filter contract:
CorpusIndexRetriever(..., filter=...)andCorpusAnnoyRetriever.from_corpus_annoy(..., filter=...)take ascikitplot.corpusfilter expression (or its JSON form), checked byvalidate_filterbefore anything is built and passed to everyindex.search, where the corpus applies it in every leg and AND-s it with the index’sSecurityFilter;scikitplot mcp --corpus-filter PATHreads it from a JSON file. With a filter,semanticmode runs the corpus’s dense leg throughsearch, the seam that takes one; a filter that narrows nothing is refused, and thedocs://chunk/{doc_id}resource serves only documents in scope.CorpusIndexRetrievergainsget(anddocuments=), so the server also starts inhybridandkeywordcorpus modes, where it used to stop with anAttributeError. #865Efficiency
InMemoryBm25Retriever.searchvisits only the documents that hold a query term (a postings list per term) instead of every document, with scores and order unchanged to the last bit. Over 20,000 documents a search took 1.8 to 2.4 ms instead of 11 to 22 ms, and the index holds about 19 MiB instead of 35 MiB; building it takes about 0.15 s longer. #927
scikitplot.memmap#
Fix An array from
MemoryMap.as_numpy_arraystays valid afterclose()(including thewithblock exit): the mapping now exports its bytes through the buffer protocol and unmaps only when the last view is released.close()from another thread likewise defers the unmap until the end of a runningread,write,msync,mlockormunlock;mprotectrefuses (BufferError) to remove any protection bit while a view is alive or such an operation is running; and a mapping withoutPROT_READexports nothing and refusesread. Each of these used to crash the interpreter (SIGSEGV).Threads may share one
MemoryMapon free-threaded Python too: its open/closed state, export count and protection flags change under a lock of the mapping (aPyMutex; nothing with the GIL, which already serialised them), so a view or a method never starts on a closed mapping and the region is unmapped once, after the last view. Without it, threads exporting views lost counts:close()left the region mapped, or unmapped it under a live view (SIGSEGV). #865
scikitplot.nc#
scikitplot.ncdeclares__all__(dotandget_include, as exported before), so the API-reference check reads it. #937
scikitplot.random#
Fix
Kiss32Random.index,Kiss64Random.indexandKissGenerator.integers(withKissRandomState.randint) draw without modulo bias: a raw draw below2**w mod nis rejected before the modulo (atn = 3e9the 32-bitindexput 60.3% of draws in the lower 43.2% of the range). A seeded stream equals the old one until the first rejection, which for smallnpractically never happens.Kiss32Random.index(n)reaches indices of2**32and more (two draws per index forn > 2**32);indexraisesValueErrorforn < 0as documented (it raisedOverflowError),TypeErrorfor aboolor a non-integer, andOverflowErrorabovesize_t;integersrefuses non-integer bounds and a range wider than2**64.KissSeedSequence.spawnreserves its spawn keys under a lock, so threads never mint the same key (identical child streams) on free-threaded builds. Annoy, which shares the C++ generator, is unchanged. #865
scikitplot.rank_bm25#
Feature
ScoreCalibratorturns BM25 scores into probabilities of relevance fitted on labelled (query, document) pairs, by Platt scaling ("sigmoid", the default) or isotonic regression ("isotonic"), with the results of scikit-learn’s sigmoid calibration andIsotonicRegressionand without needing scikit-learn.fitrequires the query of every pair and the population the pairs were drawn from;require_held_outrefuses evaluation queries that were used to fit (they are kept only as SHA-256 digests), a fit that would reverse the ranking raises, andshift_priormoves a calibrator to a population with another share of relevant documents by the Bayes prior correction.to_dictandfrom_dictstore it as JSON. #906Efficiency
BM25Okapi,BM25LandBM25Plusscore from contributions computed once per index (on the first query, or by the newprepare()) instead of re-evaluating the formula for every document on every query:get_top_idson 200 000 documents went from about 600 ms to about 2.5 ms per query. Results are bit-identical to the reference evaluation for every recipe, including ties and duplicate and unknown query terms. A newbackendargument ("auto", the default,"numpy","numba"or"reference") chooses how the sums run;"auto"uses Numba when it is installed and NumPy otherwise, and every backend returns the same values, soidentitydoes not depend on it. Numba is imported only when the compiled backend is first used, the compiled kernel is cached on disk, andSCIKITPLOT_RANK_BM25_DISABLE_NUMBA=1forces NumPy. A subclass that overrides the scoring formula keeps the previous evaluation.savewrites generations of schemabm25-index/2: the postings as.npyarrays whose SHA-256, dtype and shapeindex.jsonrecords, instead of every document’s term counts in the JSON.loadrefuses an array that does not match, reads withallow_pickle=False, recomputes the contributions exactly, and acceptsmmap_mode="r"; on 100 000 documents a generation went from 173 MB to 82 MB and loading plus a first query from 4.2 s to 0.6 s. #906Fix
BM25Okapi,BM25LandBM25Plusno longer score an empty documentNaN(with aRuntimeWarning) whenb=1. An empty document holds no query term, so it now scores the recipe’s absent-term value for everybin[0, 1]:0forBM25Okapiand thedeltalower bound forBM25LandBM25Plus, the same as a non-empty document lacking every query term. Scores of non-empty documents are unchanged bit for bit. The recipes are nowokapi-epsilon-floor/2,bm25l-delta/2andbm25plus-delta/2, soidentitytells indexes built before and after the change apart. #909API Change
BM25Okapi.load,BM25L.loadandBM25Plus.loadnow verify what they load before rebuilding the index, and refuse with aValueErrornaming the cause: a generation of another scorer (load it with BM25Okapi), one built with an earlier version of the formula or an unknown recipe (rebuild it from the corpus), a parameter that is missing, unknown or outside its domain (a persistedb=7is no longer scored), or metadata whose recordedidentitydoes not match the recipe, analyzer and parameters it declares. Loading with theBM25base class raisesTypeError. Generations of schemabm25-index/1are no longer read: every one was written with a previous recipe version, so rebuild those indexes with this version. #909
scikitplot.stats#
API Change
scikitplot.statsdeclares__all__: each optional backend (astropy statistics, Tweedie) adds its names only when it imports, so__all__never lists an absent name, andimport *no longer leakslogger,suppressandannotations. 20 functions and classes (biweight, sigma clipping, circular statistics, jackknife, Ripley K) are now in the API reference. #937
scikitplot.utils#
API Change
scikitplot.utilsdeclares__all__:from scikitplot.utils import *no longer leaksloggerandannotations.get_pathandremove_pathare now in the API reference. #937
tools (top-level)#
New manual workflow “CI Prune Workflow Runs” and
tools/maint_tools/prune_workflow_runs.pydelete old GitHub Actions runs and their logs in bulk: the newestkeep_latestruns (default 25, the first page) are always kept, with optionalolder_than_days,beforeandworkflowfilters. It is a dry run unless asked to delete, never deletes a running run or itself, and deletes nothing more when run again. #937
tools/citation#
Feature
CITATION.bibandCITATION.cffnow name the version they were generated for next to the all-versions DOI: the public version (for example0.5.dev0), its kind, the build version with its commit (0.5.dev0+git.20261028.b656b70), a link to that exact source tree, and a release’s own DOI when Zenodo archived it. The first BibTeX entry keeps its key.python tools/citation/citation_ref.pyrenders, checks (check, run by a pull-request workflow) and writes (sync --apply) both files. #891
tools/maint_tools#
Feature
tools/maint_tools/check_refused_requirements.pyfails when a requirement list (pyproject.toml,libs/*/pyproject.toml,requirements/*.txt) names a distribution that must not be required, and says which one to require instead and why. Its first entry ispdfminer, which installs the same package aspdfminer.six. It runs in CI and as a pre-push hook. #930Feature
tools/maint_tools/security_review.pyprints the S1 to S8 security review of a change (secrets, dependencies, code execution, network, file writes, untrusted parsing, CI and build files, weakened tests) as a table with each hit’s file and line, and the workflow “CI Security Review” runs it on every pull request into the job summary. A hit is a place to look, not a verdict; the job fails only when a credential pattern is added, and never prints the matched value. #940Fix
tools/maint_tools/generate_usage_skills.pyloads its renderer (scikitplot/_api_listing.py) from its own checkout by file path instead of importing an installed scikit-plots, so its golden tests run on every Python with nothing installed and skills are always rendered by the tree they describe. #944The usage skills of the
scikitplotClaude plugin no longer ship a frozenreferences/API.mdper module (1,331 lines removed). Each skill tells the assistant to read the API of the installed version:python -m scikitplot api <module>for every name at once, and on any release__all__,help()andinspect.signature, which are the source of truth if the two differ. The example name in each skill is now the first one with a call signature, so every command in every skill runs as written (before, eight skills named a constant or a compiled class). #943
Code and documentation contributors
Thanks to everyone who has contributed to the maintenance and improvement of the project since version 0.4, including:
TODO: update at the time of the release.