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 corpus extra requires pypdfium2, which renders PDF pages for PDFReader’s OCR. It has wheels for every supported CPython, including the free-threaded builds. #931

  • Fix Building scikit-plots from a checkout owned by another user (conda-forge, Docker, CI caches) no longer writes safe.directory into your global Git configuration, which also named the wrong directory and so never helped: the version step retries its one git log with git -c safe.directory=<checkout>, only after Git’s “dubious ownership” refusal. The generated Annoy Cython sources now pass cython_generate.py --validate, which compares each output with its template rendered again, and are written atomically. The Meson features module 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 with Include dir ../../venv/... does not exist when the build directory is nested (pip’s build/cp3XY): the numpy include path is now computed relative to the project root, and is absolute unless numpy lives inside the source tree. #909

  • Fix The corpus extra no longer requires pdfminer next to pdfminer.six. The two distributions install the same pdfminer package; installed together they could leave one that cannot import pdfminer.high_level, which PDFReader needs. PDFReader now 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, run pip uninstall pdfminer pdfminer.six and then pip install pdfminer.six. #930

Compatibility and dependencies#

  • New optional extra rank-bm25 (pip install "scikit-plots[rank-bm25]", or scikit-plots-rank-bm25[rank-bm25]) installs numba>=0.57.0 for 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 published scikitplot-mlflow skill. #916

  • Fix The CorpusBuilder example in the scikitplot.corpus README now runs as written: it raised RuntimeError because search defaults to hybrid search, which needs embeddings the example’s build does not make. It now asks for match_mode="keyword" and says how to enable hybrid search (BuilderConfig(embed=True)). #921

  • New gallery sections for the notebook magics (galleries/examples/ipymagic: commands, a cleanprompt cell, the MCP server, the profiler) and for the environment builder (galleries/examples/env: plan, build and remove, configuration files, policies and error codes), and scikitplot._ipymagic in the API reference. #891

  • The Claude Code plugins no longer carry a copy of skill-creator. The users’ scikitplot plugin is Markdown only and depends on nothing; install skill-creator@claude-plugins-official to write skills. scikitplot-dev declares it as a dependency, so Claude Code installs the current version that Anthropic publishes. #906

  • New user-guide page Metadata routing: where scikit-plots takes part in scikit-learn’s metadata routing (estimators built on BaseEstimator, the experimental Pipeline, the corpus scorers with and without scikit-learn), with the result of each call with routing on and off. The experimental Pipeline’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. #909

  • Installation guide, Installing A lightweight version scikit-plots-x: each git command for a single part now installs scikit-plots-skinny with it, as a quoted "name @ git+..." requirement. A part alone failed with “No matching distribution found for scikit-plots-skinny”, because its dependency on scikit-plots-skinny was 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_risk in a plan file and CLEANPROMPT_PATTERN_RISK tune it per run, team or machine, a pattern can be marked risk: accepted with a risk_reason, and packs --check lists every finding. #864

  • Enhancement cleanprompt flask --debug is now refused on any non-loopback bind, container mode included, and the generated container files publish on 127.0.0.1 only. #864

  • Enhancement scikitplot.cleanprompt: custom pack patterns can now run under a time limit. With the optional regex package installed (pip install "scikit-plots[cleanprompt-timeout]"), --pattern-timeout SECONDS (packs, batch, plan, ask, mcp), pattern_timeout in a plan file, FluentCleanPrompt().pattern_timeout() or CLEANPROMPT_PATTERN_TIMEOUT gives each document one time budget for every custom pattern. A document that runs past it is not cleaned and fails with PatternTimeoutError, naming the pack and kind but never the text; batch continues with the other files. A limit set without regex, or a pattern regex cannot compile, is refused before any document is read. Built-in patterns are unchanged, and doctor reports the new timeout tier. #909

  • Fix 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. #864

  • Fix 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 in export 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 Cyrillic A in an AWS access key, a Cyrillic a in 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 scikitplot does not have (as pytest and other tools do for optional hooks) and dir(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 against scikitplot.api.__all__ by the test suite. scikitplot.plot_roc and the other plotting functions resolve as before; a broken scikitplot.api now fails when one of its names is used, with the import error as the cause, and dir(scikitplot) works even then. #909

  • Fix The command printed when a part of scikitplot is missing (Install it with: ..., in Python, in the scikitplot command line, in scikitplot doctor and in the cleanprompt and mcp corpus messages) now works as written. It named partial distributions such as scikit-plots-corpus as if they were on PyPI, where they are not yet; it now installs them from the repository together with scikit-plots-skinny, which every part depends on. The partial distributions’ own descriptions also give the two commands for the project’s staging index. New in scikitplot._distributions: requirement, pip_install and staging_install. #911

scikitplot._build_utils#

  • Feature python -m scikitplot._build_utils.generate_apis_reference imports checks only that the documentation build can import what the API reference names: every _get_submodule target (imported when conf.py loads apis_reference.py), every documented module and every autosummary and 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 the check-apis-reference pre-push hook. #891

  • Enhancement generate_apis_reference coverage compares 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 in coverage_baseline.json (known gaps, which may only shrink). It needs no build and runs as the pre-commit hook apis-reference-coverage. A _name in __all__ is reported as a gap of its own (private). Names a module exports lazily (imported under if TYPE_CHECKING: with a module __getattr__) count as public, and an entry written "sub.Name" documents Name. An entry that names a submodule, or a name through one (also through from .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 in scikitplot.exceptions (19 were missing); so do the global configuration functions of scikitplot.config and the scikit-learn imputers re-exported by scikitplot.impute; and the remaining agent, mcp and api names. An entry of DEPRECATED_APIS_REFERENCE now documents its name for its module. The known gaps fall from 209 to none. __all__ built under try: (and its else) or with: is followed, as for an optional backend; except fallbacks are not. #937

  • Fix generate_apis_reference check no longer reports a documented submodule that the package does not import itself (such as scikitplot.experimental.enable_ann_imputer) as stale: a simple name is resolved as autosummary resolves it, the attribute or else the submodule of that name, so check passes 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 is text, markdown, json, yaml or toml. It reads only the installed package (read-only, no network), imports only scikitplot modules, 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. #942

  • Fix The scikitplot cleanprompt install hint now names the NLTK extra and says that vault encryption needs no optional package; the cleanprompt-crypto extra adds only the Fernet cipher. #864

scikitplot._env#

  • Feature scikitplot env (also python -m scikitplot._env and the scikitplot._env functions plan, create, remove, run, doctor, shell_init and batch) builds one described environment with whichever tool the machine has: uv, venv + pip, pipenv (a Pipfile.lock installed exactly), micromamba, mamba or conda. The request comes from arguments or a TOML, JSON or YAML file (scikitplot-env.toml, or [tool.scikitplot.env] in pyproject.toml; JSON Lines for batches) and names PyPI and Conda packages and requirements.txt, environment.yml, pyproject.toml (extras and dependency groups) and Pipfile sources. plan prints every command before anything runs; create runs 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. --offline plans only steps that need no network, --target cross-builds for another Conda platform or the browser (emscripten-wasm32, and pyodide as a micropip script), and Android and iOS are refused with the reason. --format json and --events FILE (JSON Lines) give results and errors, each with a stable code and a hint, to CI jobs and agents. #869

  • Fix The JupyterLite Xeus add-on in scikitplot._env now builds its browser environments through the environment builder: micromamba is looked up when a build starts instead of once at import, an environment.yml without name uses its file name instead of raising KeyError, a prefix given as a pathlib.Path no longer raises UnboundLocalError, a malformed conda-meta/history line 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_render Sphinx extension now fails the build when an *.rst.template does 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 .rst left 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 one RuntimeError that 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 &amp;); templates named .html, .htm or .xml are still escaped. #909

scikitplot._externals._sphinx_ext._sphinx_feedback#

  • Feature Page feedback can open a reviewed pull request on Bitbucket Data Center. A bitbucket storage target whose api_url is 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. repo is <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-provider also reads, without writing, the changes of the base head and confirms their shape. A server whose certificate comes from a private CA is trusted through SSL_CERT_FILE; verification is never disabled. #909

scikitplot._ipymagic#

  • Feature %load_ext scikitplot adds IPython magics that bring the scikitplot command line and a profiler into Jupyter, JupyterLab, VS Code, Colab and terminal IPython. %scikitplot ARGS runs any command (info, doctor, env, cleanprompt, mcp …) with the same options, output and exit status as in a terminal, and returns a CommandResult (exit status, captured output and, for --format json, the parsed data in .data); %%scikitplot ARGS gives 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 the timeout setting. 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_profile profile 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 --snakeviz open the profile in snakeviz served on 127.0.0.1 only and stopped when the extension is unloaded. %scikitplot_config sets raise_on_error (for notebooks run in CI), timeout, isolate and stream. The engine is also a plain function, scikitplot._ipymagic.run_command, for scripts and agents. pip install scikit-plots[ipymagic] installs IPython and snakeviz. #870

  • Fix %load_ext scikitplot._magic now loads the new magics with a FutureWarning. Its old %scikitplot ran 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 ~/.scikitplot as 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.Popen raises 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_timeout accepts fractional seconds (run_with_timeout(0.5) raised TypeError), 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 the SIGALRM handler it replaced #867

scikitplot.agent#

  • Feature New submodule scikitplot.agent: bounded, audited tool use. Agent runs a goal with a caller-supplied planner (a model adapter or a rule) that returns a Decision (call a Tool, 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 against jsonschema), Permissions and Scope (Policy, least privilege by default: read tools without scopes only), Budget (Limits: max_steps, which ends every run, tool calls, cost, tokens the planner must report, running time) and Approval (write and external tools need a person’s Approval, 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 the RunState is 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. #865

  • Feature A planner can keep a plan in the run: Decision.act and Decision.finish take plan= (the whole list of PlanItem, each pending, in_progress, done or dropped), and RunState.plan is 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 it dropped, or alters a done or dropped item, fails the run with invalid_decision, at most one item may be in_progress, and a saved state whose plan history breaks a rule is refused at load. A decision without plan= 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 exceeds N bytes in a content-addressed MemoryArtifactStore or DirectoryArtifactStore and records only Step.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 a subrun record. evaluate_audit verifies 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. #906

  • Feature WorkflowGraph writes a known order of steps down instead of a planner: Task nodes call one tool, FanOut nodes 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 – Finish nodes answer, and Edge objects choose the next node, optionally on a condition. Results are folded into named channels by reducers (replace, append, extend, add, merge or a function). graph.tools() and graph.planner() drive an ordinary Agent, 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, a Finish reachable from every node, every loop through a node with max_visits and its on_exhausted exit 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 with WorkflowError; graph.replay(state) returns the position and WorkflowView.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.py no longer downloads test.tree at import, which no test read; without the network the module was a collection error that stopped the whole directory. The fixture test64.tree is committed (its .gitignore negation now follows the patterns it undoes). The ann-benchmarks accuracy tests are opt-in: set SKPLT_ANNOY_ACCURACY_DATA to a cache directory to run them. They were all xfail, which hid that test_lastfm_angular builds a 65-dimensional index from 64-dimensional rows; it is now a strict xfail on that ValueError. #865

scikitplot.cleanprompt#

  • Feature --style surrogate can use your own stand-in names: a surrogate set is a YAML or JSON file of PERSON, ORG, GPE, LOC and FAC pools, 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 FILE on redact, encode, roundtrip, batch, ask, mcp and plan, with FluentCleanPrompt().surrogates(path) or in a plan file, and loaded in Python with load_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, PHONE and URL keep their built-in reserved forms, and the default output is unchanged. #864

  • Feature 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) or block (refuse the whole text with BlockedError). Set it with --action KIND=ACTION on every command that cleans, FluentCleanPrompt().action(), RedactionPolicy(actions=...), a plan file or a config file. A run that reports values prints an alert, doctor lists reported kinds as blind spots, and the guard and the MCP server refuse to send them. Without actions the output is unchanged. #909

  • Enhancement 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 --matrix prints 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=ACTION to see your own). The user guide’s new coverage table is generated from the same data. A new vehicle pack (--pack vehicle) finds vehicle identification numbers: in running text only when the North American check digit holds, and next to a VIN or chassis number label in any well-formed spelling, plus licence-plate fields. A surrogate set can list ordinary words under avoid (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, so decode can no longer rewrite those words in the model’s reply. Words compare ignoring case, compatibility forms and separators. A new de pack (--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 as steuer_id. #909

  • Fix doctor, inspect, encode and 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, auto no longer selects it, and an explicit --ner request fails before any text is read. NLTK data present only under pre-3.9 names is detected as unloadable. The web app now honours ner_engine, language and model_size, and docker --with-ner installs the model it runs with. #864

  • Fix scikitplot.cleanprompt: telephone numbers in common international groupings are now hidden whole. Previously the country and area code of +33 1 23 45 67 89 or +49 (0)30 1234 5678 were 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 as 2019-2024 and 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. #909

  • The API reference of scikitplot.cleanprompt lists 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_status and the corpus integration functions. #937

scikitplot.config#

  • Enhancement New scikitplot.config.citation returns a BibTeX entry. citation("all") (the default) is scikitplot.__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 one tools/citation/citation_ref.py writes for that version, commit and date; nothing is read from the network. #909

  • Fix scikitplot.config.__all__ lists test once, 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_k and ranking_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_scorer and get_corpus_scorer turn them into scorers for cross_validate and GridSearchCV that can also score a corpus index directly (response_method="search"), on scikit-learn’s own _BaseScorer or a vendored copy when scikit-learn is absent; evaluate_retrieval runs 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_ranker and make_levenshtein_ranker build CustomRetrievalIndex rankers. Generated answers can be judged by language models: make_llm puts OpenAI, Anthropic, Gemini or any callable behind one call (SDKs imported only when used, nothing sent that was not asked for); LLMJudge scores faithfulness, answer relevance, context precision and recall, answer correctness, a custom rubric and order-swapped pairwise preference from strictly parsed JSON verdicts; evaluate_answers and evaluate_preference run 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_kappa and krippendorff_alpha measure 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, HookableCorpusPipeline and create_corpus (keyword doc_id_scheme) and FluentCorpus().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_ids and DocIdScheme are public. A UUIDv7 is new on every build, so deduplicate by content_hash and keep qrels for the build that minted the ids. Searches can be filtered: RetrievalIndex.search, CorpusBuilder.search, RuntimeCorpus.search and CustomRetrievalIndex.search take filter= (a Filter expression of scalar document fields or metadata.<key>, or its JSON form), applied by every leg before ranking so a filtered query returns the best top_k matching documents, and each leg reports how it answered the filter (LegOutcome.filter_capability, every operator EMULATED); a SecurityFilter bound to an index (RetrievalIndex, CustomRetrievalIndex, BuilderConfig(security_filter=...)) is AND-ed with every query and with the vector seam RetrievalIndex.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_dict and validate_filter carry and check filters through JSON with strict validation and size limits. RecursiveChunker cuts a text by a separator hierarchy (blank line, line, sentence end, space, character) until every piece fits chunk_size, and ParentChildChunker produces large parents for context with small children inside them for retrieval; documents built from a child carry parent_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. StructureChunker chunks 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 carry heading_path, section_level and block; registered as "structure", not a default. RetrievalExecutionPlan runs retrieval through typed stages, in a fixed order: transform (multi-query, rewrites), retrieve (index.search per query, unchanged), fuse (by FusionPolicy), rerank and compress (character spans of each hit’s text). Each stage reports a StageOutcome with its status, calls, seconds and budget; a stage that fails or is stopped says why, and the result’s status is derived. A StageBudget limits the calls and seconds of retrieve, the one stage of several calls, and deadline_seconds stops any later stage from starting. An empty plan returns exactly what index.search returns, and evaluate_retrieval(plan.bind(index), ...) measures a plan. CharBudgetCompressor keeps context within a character budget. CorrectiveRetrieval grades what a search returned and then accepts it, retries with a caller’s rewritten query within max_rounds and deadline_seconds, returns the ambiguous rounds fused as partial evidence, or abstains with no hit; every round is graded against the original query, reported in a CorrectionResult (verdict, rounds, grades with the grader’s name), and measured by evaluate_retrieval like an index. TermCoverageGrader is the deterministic grader (the share of query words in the top hits, against two thresholds); a model grader is any callable returning a GradeResult. #865

  • Feature Corpus can measure whether scores presented as probabilities of relevance behave like probabilities: brier_score, binary_log_loss, reliability_table, expected_calibration_error and calibration_report take 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 equal brier_score_loss, log_loss and calibration_curve). LogOddsFusion combines retriever legs whose scores have fitted calibrators into probabilities of relevance: each leg’s evidence logit(p) - logit(prevalence), weighted, is added to logit(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 given RetrievalConfig(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_alpha must stay at its default), and an index bound to a SecurityFilter scope is refused because its BM25 statistics differ from the ones the calibrator was fitted on. CutPolicy keeps 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 by min_k/max_k, and reports its evidence in a CutResult. CachedSearch is 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; only success and empty responses are kept, and hits come back as copies. #906

  • Feature route detects the shape of a query from its words and adds the evidence paths that shape needs, when the index has them: multi_hop and hierarchy add graph traversal, aggregation, negation and temporal add metadata filters (new has_metadata=). RoutePlan gains shapes and unavailable (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-word phrases and an optional matcher(tokens) -> bool) and RoutingPolicy (rules in order, with_rules to extend or replace), with DEFAULT_ROUTING_POLICY for English and route(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. #909

  • Feature derive_graph derives a document’s outline from the heading_path that StructureChunker records on every chunk: one heading node (NodeKind.HEADING) per source and heading path, contains and parent_of edges between a heading, its sub-headings and the documents directly under it, and same_source from 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. #928

  • Feature PDFReader takes pdfminer_kwargs, keyword arguments for pdfminer.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. #930

  • Feature PDFReader can read scanned pages with OCR. ocr="auto" renders a page whose text layer is empty (or shorter than ocr_min_chars) with pypdfium2 and reads it with Tesseract or easyocr (ocr_engine); ocr="always" reads every page, and a callable (page_number, text) -> bool decides per page. ocr_engine also takes a callable, ocr_dpi sets the resolution, pypdfium2_kwargs passes rendering options, and ocr_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. #931

  • Feature New OfficeReader reads 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, .odf and 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 carry heading and heading_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. #935

  • Feature OfficeReader now identifies every Office file name. Office add-ins, macro sheets and workspaces (.wll, .wwl, .xll, .xla, .xlam, .xlm, .xlw, .ppa, .ppam and 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. #937

  • Efficiency Keyword (BM25) search over an unscoped index scores from contributions computed once per build when scikitplot.rank_bm25 is installed: about 99 ms to about 2 ms per four-term query on 200 000 documents, with bit-identical results. Searches under a SecurityFilter scope, whose statistics depend on the scope, and installs without scikitplot.rank_bm25 keep the previous evaluation. #906

  • Efficiency detect_script decides an ASCII sample without testing its characters against every script’s code-point ranges, which reached Latin last: in ASCII only A-Z and a-z count, 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.build over 64 English markdown and text files took 3.2 s instead of 6.2 s. #920

  • Efficiency 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.replace computes 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. #922

  • Efficiency NormalizationPipeline builds one document for each run of consecutive built-in text-only steps (UnicodeNormalizer, WhitespaceNormalizer, HTMLStripNormalizer, LowercaseNormalizer, DedupLinesNormalizer) instead of one per step; those steps gain normalize_text(text). The normalised documents are unchanged, and a custom step, a step that sets another field or a subclass that overrides normalize_doc runs as before. CorpusBuilder.build with its default two steps took 2.7 s instead of 3.0 to 3.1 s over 64 English markdown and text files. #926

  • Efficiency PDFReader reads 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. #930

  • Enhancement Probability fusion now runs on an index bound to a SecurityFilter. Pass the scope the lexical calibrator was fitted under as ProbabilityFusion(scope=...); hybrid search fuses only when the index’s scope has the same digest, and otherwise refuses with a ValueError naming both digests (a calibrator fitted unscoped is still refused on a scoped index, and the reverse). The new SecurityFilter.digest is 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. #909

  • Enhancement DefaultFilter no longer drops text in scripts written without spaces between words (Chinese, Japanese, Thai, Lao, Khmer, Myanmar, Tibetan): with the new default word_count="script", min_words counts 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. #932

  • Enhancement OfficeReader flags Word text formatted as hidden: a chunk that holds any carries has_hidden_text=True, and hidden=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 carry heading_path, the headings they sit under from the top down, and a slide’s chunks and notes carry its title as their heading. #936

  • Enhancement Every corpus reader takes max_text_chars, max_text_chars_per_byte and on_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 of max_text_chars and max(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) and PDFReader (pages sharing one compressed stream: 4 KB yielded 4 million characters) default to 256 Mi characters and 50 characters per byte. ZipReader bounds each member by its own reader and the archive total by its own setting; a truncated chunk is marked text_truncated. #937

  • Fix EmbeddingEngine no longer serves one custom provider’s cached vectors to another (a custom provider is cached only under a custom_fn_id), loads the model_revision it records, applies normalize=True to every backend before the dtype cast (float16 rows no longer come back as zeros, and a non-finite vector is no longer hidden as one), returns float64 cache 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 (CorpusBuilder now embeds through the same path); SemanticChunker reports 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, with allow_fallback=False, raises) when the model fails to load or to encode as well as when sentence-transformers is missing, and no longer encodes every chunk a second time. CorpusBuilder resolves chunker names and normaliser steps through the shared component registry, the same table plans and RuntimeCorpus now use: chunker_kwargs now build the named chunker’s config (a config option used to raise TypeError for 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 with registry.register_chunker is 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 a chunker_factory are refused, and so is a chunker class given instead of an instance; a configuration error raises from build before any source is read instead of failing once per source. ComponentRegistry.load_from_snapshot accepts 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 inside chunk(), and an unknown SemanticChunkerConfig.adapter_unit raises. Chunk text is a slice of the source: overlap chunks (sentence, paragraph), merged and split chunks (paragraph merge_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; Chunk gains context_start/context_end (context_span, the region its text comes from) beside the anchor start_char/end_char (anchor_span), WordChunker sentence 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 its raw_text with it), with the anchor in metadata["anchor_span"] when they differ, and no span when the chunker reports no offsets. A document’s raw_text is None when its region is unknown instead of the whole parent text for every chunk of a split parent with offsets disabled, an overlap chunk’s multilang raw_text covers its context instead of its anchor, and no raw_text is 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"). WordChunker honours include_offsets (False by default: no span), and SemanticChunker with include_offsets=False reports (0, 0). An overlap chunk’s context includes a unit min_length dropped 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_cache keyed its cache on the source path, its modification time and the document count: changed text, another custom function or another normalize setting 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). ScriptSegmenter called regex.get_script, which the regex library does not have, so with regex installed every text came back as one span of unknown script (with a warning about '_unknown'); it now detects scripts with \p{Script=...}, its start/end are 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 by min_span_chars leave one span per run, Tamil, Telugu, Kannada, Malayalam and Sinhala map to SOUTH_ASIAN and Lao to SOUTHEAST_ASIAN (as documented), and Han that meets kana (Japanese) or Hangul (Korean) letter to letter stays in one span. With regex installed, SemanticChunker and WritingSystemAdapter therefore dispatch each span to its script’s strategy, so their chunks change: Chinese without jieba becomes one chunk per character, and Arabic, Hebrew, Devanagari, the Dravidian scripts and others use their own strategies. RetrievalResponse.to_dict() and LegOutcome.to_dict() now return a JSON-compatible mapping as documented: a leg’s generation is written as its IndexGeneration.to_dict(), where it used to be the object itself and json.dumps raised. #865

  • Fix SQLiteStorage.search_text and StorageQuery(full_text=...) on SQLiteStorage no 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. The scikitplot.mcp lexical 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. #919

  • Fix SQLiteStorage and JSONLStorage refuse a document holding a lone surrogate (U+D800 to U+DFFF) before writing anything, with a ValueError naming 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 bare UnicodeEncodeError instead, and on CPython 3.11 and newer SQLite could report it as an earlier, unrelated error. InMemoryStorage keeps such a document, as the YAML export does. #923

  • Fix ImageReader reads 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 new max_frames (default 64; None reads 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. #928

  • Fix PDFReader passes password to pdfminer.six. An encrypted PDF read with prefer_backend="pdfminer" and the right password gave no documents, and in the default mode its text came from the pypdf fallback only. #930

  • Fix PDFReader no longer returns nothing for a file it cannot read. A file that is not a complete PDF, or an encrypted one with the wrong password, raises a ValueError that gives each backend’s reason (CorpusPipeline.run_batch reports 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 that PDFReader does not run OCR. #931

  • Fix 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 raised UnicodeDecodeError. UTF-16 and UTF-32 text no longer starts with U+FEFF, a binary file raises ValueError instead 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. #932

  • Fix AudioReader raises ValueError for an empty (0-byte) audio file unless a custom_extractor is set. It returned no documents and logged a warning suggesting transcribe=True, which then ran the speech recognition backends on a file with no audio. #933

  • Fix ZipReader warnings 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. #934

  • Fix PDFReader gives 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. #935

  • Fix OfficeReader reads 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, raises ValueError naming the part instead of BadZipFile or RuntimeError. #936

  • Fix OfficeReader refuses an Excel cell referenced past the last column (XFD, 16,384) with ValueError, 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. #937

  • Fix OfficeReader bounds a package part in proportion to the file: the new option max_part_bytes_per_byte (default 50; None turns it off) lets an XML part inflate to max(50 x file size, 1 Mi) bytes, and never more than max_part_bytes. Before, a 50 kB .docx or .pptx whose 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. #938

  • Fix ZipReader bounds an archive in proportion to its size on disk. It defaults to max_text_chars=256 Mi and max_text_chars_per_byte=50 (as OfficeReader and PDFReader), and the whole archive tree, nested archives included, may extract at most 4 bytes for each character that ratio allows (by default max(200 x archive size, 4 Mi) bytes, never more than max_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 new ArchiveBudgetError (a ValueError), which ends the whole tree instead of skipping one member. With on_text_limit="truncate" the archive ends with a warning and keeps what was read. Highly compressible members past these limits need a larger max_text_chars_per_byte (or None, which turns both off). #941

  • API Change TextReader(encoding=...) is a policy, and chardet is no longer consulted unless asked for. None detects 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) -> codec decides. Every chunk records the codec used in its encoding metadata. 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: pass encoding="chardet" or the corpus’s codecs. #932

  • API Change scikitplot.corpus no longer exports five private names by import *: _PROMOTED_RAW_KEYS, _SOURCE_EXT_MAP, _coerce_documents, _split_cjk_chars_legacy and _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_policy and others) are now in the API reference. #937

  • A 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.datasets declares __all__ (the loader functions it already exported), so the API-reference check reads it. #937

scikitplot.feature_selection#

  • Feature New scikitplot.feature_selection for wide pandas tables. profile_features (or FeatureProfiler in a pipeline) fits a FeatureSchema on 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 as skewed, discrete, constant, binary, identifier_like or high_cardinality, each with evidence and an explicit unknown / not_applicable state; thresholds, roles, kinds, tags and manual overrides live in a FeaturePolicy read from TOML, YAML or JSON, and new questions are added with register_assessment. FeatureColumnSelector routes columns into a ColumnTransformer by kind or assessment on each training fold, FeatureFilter drops constant and identifier-like columns and non-feature roles, and FeatureRenamer applies a frozen rename plan. trace_pipeline reads a fitted Pipeline / ColumnTransformer / FeatureUnion and 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, and FeatureLineage.attribute sums one-hot (or any exactly traced) importances and SHAP values back to raw columns. ReferenceProfile freezes 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 without JPY_PARENT_PID or a loaded ipykernel was taken for a terminal #867

  • API Change scikitplot.logging no longer exports _default_logging_level, _get_thread_id and _is_jupyter_notebook by import *; they stay reachable as attributes. TaskLevelStatusMessage is now exported, and the re-exported standard-library names (Logger, Handler, getLogger and 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=...) and CorpusAnnoyRetriever.from_corpus_annoy(..., filter=...) take a scikitplot.corpus filter expression (or its JSON form), checked by validate_filter before anything is built and passed to every index.search, where the corpus applies it in every leg and AND-s it with the index’s SecurityFilter; scikitplot mcp --corpus-filter PATH reads it from a JSON file. With a filter, semantic mode runs the corpus’s dense leg through search, the seam that takes one; a filter that narrows nothing is refused, and the docs://chunk/{doc_id} resource serves only documents in scope. CorpusIndexRetriever gains get (and documents=), so the server also starts in hybrid and keyword corpus modes, where it used to stop with an AttributeError. #865

  • Efficiency InMemoryBm25Retriever.search visits 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_array stays valid after close() (including the with block 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 running read, write, msync, mlock or munlock; mprotect refuses (BufferError) to remove any protection bit while a view is alive or such an operation is running; and a mapping without PROT_READ exports nothing and refuses read. Each of these used to crash the interpreter (SIGSEGV).

    Threads may share one MemoryMap on free-threaded Python too: its open/closed state, export count and protection flags change under a lock of the mapping (a PyMutex; 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.nc declares __all__ (dot and get_include, as exported before), so the API-reference check reads it. #937

scikitplot.random#

  • Fix Kiss32Random.index, Kiss64Random.index and KissGenerator.integers (with KissRandomState.randint) draw without modulo bias: a raw draw below 2**w mod n is rejected before the modulo (at n = 3e9 the 32-bit index put 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 small n practically never happens. Kiss32Random.index(n) reaches indices of 2**32 and more (two draws per index for n > 2**32); index raises ValueError for n < 0 as documented (it raised OverflowError), TypeError for a bool or a non-integer, and OverflowError above size_t; integers refuses non-integer bounds and a range wider than 2**64. KissSeedSequence.spawn reserves 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 ScoreCalibrator turns 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 and IsotonicRegression and without needing scikit-learn. fit requires the query of every pair and the population the pairs were drawn from; require_held_out refuses evaluation queries that were used to fit (they are kept only as SHA-256 digests), a fit that would reverse the ranking raises, and shift_prior moves a calibrator to a population with another share of relevant documents by the Bayes prior correction. to_dict and from_dict store it as JSON. #906

  • Efficiency BM25Okapi, BM25L and BM25Plus score from contributions computed once per index (on the first query, or by the new prepare()) instead of re-evaluating the formula for every document on every query: get_top_ids on 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 new backend argument ("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, so identity does not depend on it. Numba is imported only when the compiled backend is first used, the compiled kernel is cached on disk, and SCIKITPLOT_RANK_BM25_DISABLE_NUMBA=1 forces NumPy. A subclass that overrides the scoring formula keeps the previous evaluation. save writes generations of schema bm25-index/2: the postings as .npy arrays whose SHA-256, dtype and shape index.json records, instead of every document’s term counts in the JSON. load refuses an array that does not match, reads with allow_pickle=False, recomputes the contributions exactly, and accepts mmap_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. #906

  • Fix BM25Okapi, BM25L and BM25Plus no longer score an empty document NaN (with a RuntimeWarning) when b=1. An empty document holds no query term, so it now scores the recipe’s absent-term value for every b in [0, 1]: 0 for BM25Okapi and the delta lower bound for BM25L and BM25Plus, the same as a non-empty document lacking every query term. Scores of non-empty documents are unchanged bit for bit. The recipes are now okapi-epsilon-floor/2, bm25l-delta/2 and bm25plus-delta/2, so identity tells indexes built before and after the change apart. #909

  • API Change BM25Okapi.load, BM25L.load and BM25Plus.load now verify what they load before rebuilding the index, and refuse with a ValueError naming 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 persisted b=7 is no longer scored), or metadata whose recorded identity does not match the recipe, analyzer and parameters it declares. Loading with the BM25 base class raises TypeError. Generations of schema bm25-index/1 are 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.stats declares __all__: each optional backend (astropy statistics, Tweedie) adds its names only when it imports, so __all__ never lists an absent name, and import * no longer leaks logger, suppress and annotations. 20 functions and classes (biweight, sigma clipping, circular statistics, jackknife, Ripley K) are now in the API reference. #937

scikitplot.utils#

  • API Change scikitplot.utils declares __all__: from scikitplot.utils import * no longer leaks logger and annotations. get_path and remove_path are now in the API reference. #937

tools (top-level)#

  • New manual workflow “CI Prune Workflow Runs” and tools/maint_tools/prune_workflow_runs.py delete old GitHub Actions runs and their logs in bulk: the newest keep_latest runs (default 25, the first page) are always kept, with optional older_than_days, before and workflow filters. 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.bib and CITATION.cff now name the version they were generated for next to the all-versions DOI: the public version (for example 0.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.py renders, 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.py fails 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 is pdfminer, which installs the same package as pdfminer.six. It runs in CI and as a pre-push hook. #930

  • Feature tools/maint_tools/security_review.py prints 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. #940

  • Fix tools/maint_tools/generate_usage_skills.py loads 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. #944

  • The usage skills of the scikitplot Claude plugin no longer ship a frozen references/API.md per 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() and inspect.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.