Packages

Explainable AI (XAI) tools for the Crucible framework. Includes LIME implementations, SHAP-like explanations, feature attribution, and model interpretability for local and global explanations.

Current section

Files

Jump to
Raw

mix.exs

defmodule CrucibleXai.MixProject do
use Mix.Project
@version "0.3.0"
@source_url "https://github.com/North-Shore-AI/crucible_xai"
def project do
[
app: :crucible_xai,
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
description: description(),
package: package(),
docs: docs(),
source_url: @source_url,
homepage_url: @source_url,
name: "CrucibleXAI",
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test
],
dialyzer: [
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:mix, :ex_unit],
flags: [:error_handling, :underspecs, :unmatched_returns]
]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp deps do
[
{:nx, "~> 0.7"},
{:ex_doc, "~> 0.31", only: :dev, runtime: false},
{:jason, "~> 1.4"},
{:stream_data, "~> 1.1", only: :test},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev], runtime: false},
{:excoveralls, "~> 0.18", only: :test}
]
end
defp description do
"Explainable AI (XAI) tools for the Crucible framework. Includes LIME implementations, SHAP-like explanations, feature attribution, and model interpretability for local and global explanations."
end
defp package do
[
name: "crucible_xai",
description: description(),
files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE),
licenses: ["MIT"],
links: %{
"GitHub" => @source_url,
"Online documentation" => "https://hexdocs.pm/crucible_xai"
},
maintainers: ["nshkrdotcom"]
]
end
defp docs do
[
main: "readme",
name: "CrucibleXAI",
source_ref: "v#{@version}",
source_url: @source_url,
homepage_url: @source_url,
extras: [
"README.md",
"CHANGELOG.md",
"docs/architecture.md",
"docs/lime.md",
"docs/feature_attribution.md",
"docs/roadmap.md"
],
groups_for_extras: [
Documentation: ["docs/architecture.md", "docs/lime.md", "docs/feature_attribution.md"],
Planning: ["docs/roadmap.md"]
],
assets: %{"assets" => "assets"},
logo: "assets/crucible_xai.svg",
before_closing_head_tag: &mermaid_config/1
]
end
defp mermaid_config(:html) do
"""
<script defer src="https://cdn.jsdelivr.net/npm/mermaid@10.2.3/dist/mermaid.min.js"></script>
<script>
let initialized = false;
window.addEventListener("exdoc:loaded", () => {
if (!initialized) {
mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
initialized = true;
}
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
end
defp mermaid_config(_), do: ""
end