roverdevkit / webapp /frontend /src /hooks /use-shap.ts
jjreif's picture
Deploy roverdevkit @ 2676a67
b3d14e3
Raw
History Blame Contribute Delete
429 Bytes
import { useMutation } from "@tanstack/react-query";
import { api } from "@/lib/api";
import type { ShapExplainRequest, ShapLocalResponse } from "@/types/api";
/** Per-design TreeSHAP-style contributions for a selected target. */
export function useShapExplain() {
return useMutation<ShapLocalResponse, Error, ShapExplainRequest>({
mutationKey: ["shap", "explain"],
mutationFn: (req) => api.shapExplain(req),
});
}