Repository Analysis

shap/shap

A game theoretic approach to explain the output of any machine learning model.

7.3 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of shap/shap, a Jupyter Notebook project with 25,607 GitHub stars. SynthScan v2.0 examined 151,479 lines of code across 249 source files, recording 859 pattern matches distributed across 17 syntactic categories. The overall adjusted score of 7.3 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

7.3
Adjusted Score
7.3
Raw Score
100%
Time Factor
2026-07-13
Last Push
25.6K
Stars
Jupyter Notebook
Language
151.5K
Lines of Code
249
Files
859
Pattern Hits
2026-07-14
Scan Date
0.14
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 3HIGH 33MEDIUM 28LOW 795

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 859 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers394 hits · 382 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py730 def _use_data_as_feature_names(self) -> dict[Any, list[Any]]:CODE
LOWshap/benchmark/metrics.py143def keep_absolute_mask__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py187def remove_absolute_mask__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py231def keep_absolute_resample__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py275def remove_absolute_resample__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py319def keep_absolute_impute__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py363def remove_absolute_impute__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py455def batch_remove_absolute_retrain__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/metrics.py467def batch_keep_absolute_retrain__roc_auc(X, y, model_generator, method_name, num_fcounts=11):CODE
LOWshap/benchmark/methods.py56def tree_shap_tree_path_dependent(model, data):CODE
LOWshap/maskers/_text.py380def post_process_sentencepiece_tokenizer_output(s):CODE
LOWshap/maskers/_image.py175def _jit_build_partition_tree(xmin, xmax, ymin, ymax, zmin, zmax, total_ywidth, total_zwidth, M, clustering, q):CODE
LOWshap/utils/transformers.py28def parse_prefix_suffix_for_tokenizer(tokenizer):CODE
LOWshap/utils/_clustering.py101def _reverse_window_score_gain(CODE
LOWshap/utils/_masked_model.py171 # def _build_varying_delta_mask_rows(self, masks):COMMENT
LOWshap/utils/_masked_model.py281def _assert_output_input_match(inputs, outputs):CODE
LOWshap/utils/_masked_model.py287def _convert_delta_mask_to_full(masks, full_masks):CODE
LOWshap/utils/_masked_model.py352def _build_fixed_single_output(CODE
LOWshap/utils/_masked_model.py377def _build_fixed_multi_output(CODE
LOWshap/utils/_legacy.py82def convert_to_instance_with_index(val, column_name, index_value, index_name):CODE
LOWshap/models/_topk_lm.py113 def get_output_names_and_update_topk_token_ids(self, X):CODE
LOWshap/models/_text_generation.py206 def parse_prefix_suffix_for_model_generate_output(self, output):CODE
LOWshap/models/_teacher_forcing.py349 def get_teacher_forced_logits(self, X, Y):CODE
LOWshap/explainers/_coalition.py349def create_partition_hierarchy(CODE
LOWshap/explainers/_coalition.py443def _generate_paths_and_combinations(node: Node) -> list[tuple[str, tuple[Any, ...], float]]:CODE
LOWshap/explainers/_coalition.py512def _map_combinations_to_unique_masks(CODE
LOWshap/explainers/_explainer.py516 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_linear.py355 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_additive.py110 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_exact.py245def _compute_grey_code_row_values_st(CODE
LOWshap/explainers/_tree.py59def _safe_check_tree_instance_experimental(tree_instance: Any) -> None:CODE
LOWshap/explainers/_tree.py880 def _get_shap_interactions_output(self, phi: npt.NDArray[Any], flat_output: bool) -> npt.NDArray[Any]:CODE
LOWshap/explainers/_tree.py926 def supports_model_with_masker(model: Any, masker: Any) -> bool:CODE
LOWshap/explainers/_tree.py1594 def _set_xgboost_model_attributes(CODE
LOWshap/explainers/_tree.py2194def get_xgboost_dmatrix_properties(model: Any) -> dict[str, Any]:CODE
LOWshap/explainers/other/_ubjson.py167def _decode_simple_key_value_pair(fp, key_type):CODE
LOWshap/explainers/_deep/deep_tf.py397 def execute_with_overridden_gradients(self, f):CODE
LOWshap/explainers/_deep/deep_tf.py696def linearity_with_excluded_handler(input_inds, explainer, op, *grads):CODE
LOWshap/plots/_decision.py35def __decision_plot_matplotlib(CODE
LOWshap/plots/_text.py1070 def process_text_to_text_shap_values(shap_values):STRING
LOWshap/plots/_text.py1459def unpack_shap_explanation_contents(shap_values):STRING
LOWshap/plots/_force_matplotlib.py303def draw_higher_lower_element(out_value, offset_text):CODE
LOWtests/conftest.py87def compare_numpy_outputs_against_baseline(*, func_file, baseline_dir=None, rtol=1e-4, atol=1e-6):CODE
LOWtests/test_explanation.py67def test_explanation_hstack_errors(random_seed):CODE
LOWtests/test_explanation.py99def test_feature_names_slicing_for_square_arrays(random_seed, N):CODE
LOWtests/test_explanation.py130def test_populating_op_history():CODE
LOWtests/test_explanation.py164def test_cohorts_invalid_input(inp):CODE
LOWtests/test_explanation.py173def test_cohorts_magic_methods(random_seed):CODE
LOWtests/test_explanation.py211def test_cohorts_magic_methods_errors():CODE
LOWtests/test_explanation.py239def test_cohorts_generation_with_one_feature():CODE
LOWtests/test_install.py7def test_importing_from_installed_package_not_local_files():CODE
LOWtests/maskers/test_composite.py9def test_composite_masker_init():CODE
LOWtests/maskers/test_composite.py25def test_composite_masker_with_fixed_maskers():CODE
LOWtests/maskers/test_composite.py40def test_composite_masker_shape_method():CODE
LOWtests/maskers/test_composite.py54def test_composite_masker_mask_shapes():CODE
LOWtests/maskers/test_composite.py69def test_composite_masker_data_transform():CODE
LOWtests/maskers/test_composite.py85def test_composite_masker_arg_count_mismatch():CODE
LOWtests/maskers/test_composite.py101def test_composite_masker_call_arg_count_mismatch():CODE
LOWtests/maskers/test_composite.py114def test_composite_masker_clustering():CODE
LOWtests/maskers/test_composite.py125def test_composite_masker_single_masker():CODE
334 more matches not shown…
Cross-Language Confusion22 hits · 135 pts
SeverityFileLineSnippetContext
HIGHshap/plots/_text.py178 document._zoom_{uuid} = undefined;CODE
HIGHshap/plots/_text.py180 var next_id = undefined;CODE
HIGHshap/plots/_text.py182 if (document._zoom_{uuid} !== undefined) {{CODE
HIGHshap/plots/_text.py202 if (document._zoom_{uuid} !== undefined) {{ return; }}CODE
HIGHshap/plots/_text.py203 if (document._hover_{uuid} !== undefined) {{CODE
HIGHshap/plots/_text.py1317 var {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_text.py1320 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_text.py1338 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_text.py1362 {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_text.py1365 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_text.py1448 if (id === null) {{CODE
HIGHshap/plots/_image.py331 var {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_image.py335 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_image.py342 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_image.py344 {uuid}_update_image_and_overlay(null);CODE
HIGHshap/plots/_image.py349 if ({uuid}_heatmap_flat_state === null) {{CODE
HIGHshap/plots/_image.py359 {uuid}_update_image_and_overlay(null);CODE
HIGHshap/plots/_image.py360 {uuid}_heatmap_flat_state = null;CODE
HIGHshap/plots/_image.py389 if (selected_id == null) {{CODE
HIGHshap/plots/_image.py402 if ({uuid}_heatmap_flat_state !== null ) {{CODE
HIGHshap/plots/_image.py453 dragStart = null;CODE
HIGHshap/plots/_image.py495 savedTransforms.push(xform.translate(0, 0));CODE
Unused Imports133 hits · 130 pts
SeverityFileLineSnippetContext
LOWshap/datasets.py1CODE
LOWshap/__init__.py3CODE
LOWshap/__init__.py3CODE
LOWshap/__init__.py6CODE
LOWshap/__init__.py7CODE
LOWshap/__init__.py8CODE
LOWshap/__init__.py9CODE
LOWshap/__init__.py10CODE
LOWshap/__init__.py11CODE
LOWshap/__init__.py12CODE
LOWshap/__init__.py13CODE
LOWshap/__init__.py14CODE
LOWshap/__init__.py15CODE
LOWshap/__init__.py16CODE
LOWshap/__init__.py17CODE
LOWshap/__init__.py18CODE
LOWshap/__init__.py19CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py95CODE
LOWshap/__init__.py96CODE
LOWshap/__init__.py97CODE
LOWshap/__init__.py97CODE
LOWshap/__init__.py100CODE
LOWshap/__init__.py46CODE
LOWshap/links.py1CODE
LOWshap/_explanation.py1CODE
LOWshap/benchmark/__init__.py1CODE
LOWshap/benchmark/__init__.py2CODE
LOWshap/benchmark/__init__.py3CODE
LOWshap/benchmark/__init__.py4CODE
LOWshap/maskers/_fixed.py1CODE
LOWshap/maskers/_masker.py1CODE
LOWshap/maskers/__init__.py1CODE
LOWshap/maskers/__init__.py2CODE
LOWshap/maskers/__init__.py3CODE
LOWshap/maskers/__init__.py4CODE
LOWshap/maskers/__init__.py5CODE
LOWshap/maskers/__init__.py6CODE
LOWshap/maskers/__init__.py7CODE
LOWshap/maskers/__init__.py7CODE
LOWshap/maskers/__init__.py7CODE
LOWshap/maskers/__init__.py8CODE
LOWshap/maskers/_composite.py1CODE
LOWshap/utils/_types.py1CODE
LOWshap/utils/_clustering.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py1CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
LOWshap/utils/__init__.py8CODE
73 more matches not shown…
Over-Commented Block93 hits · 92 pts
SeverityFileLineSnippetContext
LOWpyproject.toml141# NOTE: numpy.typing.mypy_plugin is deprecated in NumPy 2.3+ and will be removed in a future releaseCOMMENT
LOWshap/benchmark/plots.py21COMMENT
LOWshap/benchmark/plots.py41 # "keep_negative_mask": {COMMENT
LOWshap/benchmark/plots.py61 # "xlabel": "Max fraction of features removed",COMMENT
LOWshap/benchmark/plots.py81 # "sort_order": 9COMMENT
LOWshap/benchmark/plots.py101 # "keep_absolute_resample__roc_auc": {COMMENT
LOWshap/benchmark/plots.py121 # "xlabel": "Max fraction of features removed",COMMENT
LOWshap/benchmark/plots.py141 # "sort_order": 12COMMENT
LOWshap/benchmark/plots.py161 # "batch_keep_absolute__r2": {COMMENT
LOWshap/benchmark/plots.py181 # },COMMENT
LOWshap/benchmark/plots.py201 # "title": "Saabas"COMMENT
LOWshap/benchmark/plots.py541 "<div style='float: left; font-weight: regular; font-size: 24px; color: #000;'>SHAP Benchmark <span style='font-COMMENT
LOWshap/benchmark/_sequential.py21COMMENT
LOWshap/benchmark/_sequential.py121 # if not hasattr(attributions[0], "__len__"):COMMENT
LOWshap/maskers/_text.py261 # assert len(clustering)+1 == MCOMMENT
LOWshap/utils/_masked_model.py181COMMENT
LOWshap/cext/gpu_treeshap.h21#include <thrust/iterator/discard_iterator.h>COMMENT
LOWshap/cext/tree_shap.h1/**COMMENT
LOWshap/explainers/_partition.py301 # f11 = fm(~m00.reshape(1,-1))[0]COMMENT
LOWshap/explainers/_partition.py441 silent: bool,COMMENT
LOWshap/explainers/_partition.py601 # #masks = np.zeros(2*len(inds)+1, dtype=int)COMMENT
LOWshap/explainers/_partition.py621COMMENT
LOWshap/explainers/_partition.py641COMMENT
LOWshap/explainers/_partition.py661COMMENT
LOWshap/explainers/_partition.py681 # continueCOMMENT
LOWshap/explainers/_partition.py701 # eval_count += len(batch_masks)COMMENT
LOWshap/explainers/_partition.py721 # elif fixed_context == 0:COMMENT
LOWshap/explainers/_gradient.py401 # regression model with priors of the coefficients equal to the estimated variances for eachCOMMENT
LOWshap/explainers/_kernel.py741 etmp = np.transpose(np.transpose(self.maskMatrix[:, nonzero_inds[:-1]]) - self.maskMatrix[:, nonzero_inds[-1]])COMMENT
LOWshap/explainers/_additive.py161# data : numpy.array, pandas.DataFrameCOMMENT
LOWshap/explainers/_additive.py181# self.data = dataCOMMENT
LOWshap/explainers/_additive.py201# X : numpy.array, pandas.DataFrame or scipy.csr_matrixCOMMENT
LOWshap/explainers/_additive.py221# X = X.valuesCOMMENT
LOWshap/explainers/pytree.py21# self.model_type = "xgboost"COMMENT
LOWshap/explainers/pytree.py41COMMENT
LOWshap/explainers/pytree.py61# return phi[:, 0]COMMENT
LOWshap/explainers/pytree.py81# if self.model_type == "xgboost":COMMENT
LOWshap/explainers/pytree.py101# def __init__(self, children_left, children_right, children_default, feature, threshold, value, node_sample_weight)COMMENT
LOWshap/explainers/pytree.py121# if hasattr(tree, "missing_go_to_left"):COMMENT
LOWshap/explainers/pytree.py321COMMENT
LOWshap/explainers/other/_ubjson.py81# [d][67.0]COMMENT
LOWshap/plots/_beeswarm.py141 # out_names = shap_exp.output_namesCOMMENT
LOWshap/plots/_beeswarm.py221 raise ValueError(emsg)COMMENT
LOWshap/plots/_beeswarm.py241 # return beeswarm(COMMENT
LOWshap/plots/_beeswarm.py261 # slow = -vCOMMENT
LOWshap/plots/_beeswarm.py281 # plt.subplot(1, max_display, i + 1)COMMENT
LOWshap/plots/colors/_colors.py121# blue_rgba = np.array([30, 136, 229, 255]) / 255COMMENT
LOWshap/plots/colors/_colorconv.py1### ------------ vendored from skimage.color.colorconv -------------COMMENT
LOWshap/plots/colors/_colorconv.py21# may be used to endorse or promote products derived from this softwareCOMMENT
LOWtests/explainers/test_tree.py1501COMMENT
LOWtests/explainers/test_tree.py1761 # # train lightgbm ranker modelCOMMENT
LOWtests/plots/test_decision.py121# import lightgbm as lgbCOMMENT
LOWtests/plots/test_decision.py141# "max_bin": 512,COMMENT
LOWtests/plots/test_decision.py161# shap_interaction_values = explainer.shap_interaction_values(features)COMMENT
LOWtests/plots/test_decision.py181# shap.decision_plot(base_value, shap_values[0, :])COMMENT
LOWtests/plots/test_decision.py201# # Now with feature names in the features argument as numpy.COMMENT
LOWtests/plots/test_decision.py221# highlight = y_label != (expit(predictions) > 0.5)COMMENT
LOWtests/plots/test_decision.py241# shap.decision_plot(alpha=0.2, **args1)COMMENT
LOWtests/plots/test_decision.py261# shap.decision_plot(**args2) # to compare with previous plotCOMMENT
LOWtests/plots/test_decision.py281#COMMENT
33 more matches not shown…
Deep Nesting91 hits · 90 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py966CODE
LOWshap/_explanation.py108CODE
LOWshap/_explanation.py317CODE
LOWshap/_serializable.py70CODE
LOWshap/benchmark/_explanation_error.py92CODE
LOWshap/benchmark/plots.py386CODE
LOWshap/benchmark/plots.py446CODE
LOWshap/benchmark/experiments.py266CODE
LOWshap/benchmark/_sequential.py88CODE
LOWshap/benchmark/_sequential.py216CODE
LOWshap/maskers/_text.py111CODE
LOWshap/maskers/_text.py177CODE
LOWshap/maskers/_tabular.py19CODE
LOWshap/maskers/_image.py175CODE
LOWshap/maskers/_image.py75CODE
LOWshap/utils/transformers.py28CODE
LOWshap/utils/_clustering.py78CODE
LOWshap/utils/_clustering.py223CODE
LOWshap/utils/_masked_model.py377CODE
LOWshap/utils/_masked_model.py69CODE
LOWshap/utils/_general.py45CODE
LOWshap/utils/_general.py73CODE
LOWshap/utils/_general.py121CODE
LOWshap/models/_topk_lm.py203CODE
LOWshap/models/_text_generation.py123CODE
LOWshap/models/_teacher_forcing.py266CODE
LOWshap/models/_teacher_forcing.py349CODE
LOWshap/actions/_optimizer.py12CODE
LOWshap/actions/_optimizer.py31CODE
LOWshap/explainers/_coalition.py332CODE
LOWshap/explainers/_coalition.py481CODE
LOWshap/explainers/_coalition.py207CODE
LOWshap/explainers/_explainer.py37CODE
LOWshap/explainers/_partition.py754CODE
LOWshap/explainers/_partition.py282CODE
LOWshap/explainers/_gradient.py268CODE
LOWshap/explainers/_gradient.py311CODE
LOWshap/explainers/_gradient.py575CODE
LOWshap/explainers/_sampling.py79CODE
LOWshap/explainers/_linear.py495CODE
LOWshap/explainers/_linear.py105CODE
LOWshap/explainers/_linear.py330CODE
LOWshap/explainers/_linear.py428CODE
LOWshap/explainers/_permutation.py132CODE
LOWshap/explainers/_kernel.py229CODE
LOWshap/explainers/_kernel.py348CODE
LOWshap/explainers/_kernel.py557CODE
LOWshap/explainers/_kernel.py636CODE
LOWshap/explainers/_kernel.py690CODE
LOWshap/explainers/_exact.py245CODE
LOWshap/explainers/_exact.py378CODE
LOWshap/explainers/_exact.py399CODE
LOWshap/explainers/_exact.py121CODE
LOWshap/explainers/_tree.py139CODE
LOWshap/explainers/_tree.py515CODE
LOWshap/explainers/_tree.py975CODE
LOWshap/explainers/_tree.py1636CODE
LOWshap/explainers/_tree.py1818CODE
LOWshap/explainers/_tree.py2493CODE
LOWshap/explainers/pytree.py143CODE
31 more matches not shown…
Cross-File Repetition11 hits · 55 pts
SeverityFileLineSnippetContext
HIGHshap/explainers/_explainer.py0determines if this explainer can handle the given model. this is an abstract static method meant to be implemented by eaSTRING
HIGHshap/explainers/_additive.py0determines if this explainer can handle the given model. this is an abstract static method meant to be implemented by eaSTRING
HIGHshap/explainers/_tree.py0determines if this explainer can handle the given model. this is an abstract static method meant to be implemented by eaSTRING
HIGHshap/explainers/_partition.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_linear.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_permutation.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_additive.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHshap/explainers/_exact.py0explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).STRING
HIGHtests/plots/test_beeswarm.py0checks that valueerror is raised if the features data matrix has an incompatible shape with the shap_values matrix.STRING
HIGHtests/plots/test_violin.py0checks that valueerror is raised if the features data matrix has an incompatible shape with the shap_values matrix.STRING
HIGHtests/plots/test_summary.py0checks that valueerror is raised if the features data matrix has an incompatible shape with the shap_values matrix.STRING
Self-Referential Comments11 hits · 37 pts
SeverityFileLineSnippetContext
MEDIUMshap/explainers/_coalition.py331# This function is to encode the dictionary to our specific structureCOMMENT
MEDIUMshap/explainers/pytree.py1"""This module is a pure python implementation of Tree SHAP.STRING
MEDIUMtests/maskers/test_output_composite.py128 # Create a custom masker that takes 2 argumentsCOMMENT
MEDIUMtests/maskers/test_output_composite.py159 # Create a minimal masker without all optional attributesCOMMENT
MEDIUMtests/explainers/test_tree.py883 # Define an objective function for skopt to optimise.COMMENT
MEDIUMtests/explainers/test_tree.py2026 # Create a SHAP TreeExplainerCOMMENT
MEDIUMtests/plots/test_force_js.py48 # Create a simple modelCOMMENT
MEDIUMtests/plots/test_force_js.py53 # Create the explainerCOMMENT
MEDIUMtests/plots/test_force_js.py63 # Create a simple modelCOMMENT
MEDIUMtests/plots/test_force_js.py68 # Create the explainerCOMMENT
MEDIUMdocs/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
AI Slop Vocabulary15 hits · 34 pts
SeverityFileLineSnippetContext
LOWshap/explainers/_linear.py247 # if we still have some multi-collinearity present then we just add regularization...COMMENT
LOWshap/explainers/_exact.py142 # if nothing varies then we can just return the expected value as the output and be done with itCOMMENT
LOWshap/plots/_violin.py326 # to ignore it, just set it to the previous y-values (so the area between them will be zero). Not ysCOMMENT
LOWshap/plots/_beeswarm.py1037 # to ignore it, just set it to the previous y-values (so the area between them will be zero). Not ysCOMMENT
MEDIUMshap/plots/resources/bundle.js2(()=>{var e,t,n={543(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__",l="_CODE
MEDIUMshap/plots/resources/bundle.js2(()=>{var e,t,n={543(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__",l="_CODE
MEDIUMdocs/artwork/california_dataset.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUMdocs/artwork/california_dataset.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUMdocs/artwork/california_instance.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUMdocs/artwork/california_instance.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
MEDIUM…iner/Keras LSTM for IMDB Sentiment Classification.html12004function r(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var a=CODE
LOW…iner/Keras LSTM for IMDB Sentiment Classification.html12004function r(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var a=CODE
MEDIUM…iner/Keras LSTM for IMDB Sentiment Classification.html12004function r(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var a=CODE
LOW…Intermediate Layer of VGG16 on ImageNet (PyTorch).html11886<h2 id="Explain-with-local-smoothing">Explain with local smoothing<a class="anchor-link" href="#Explain-with-local-smootCODE
MEDIUMjavascript/package-lock.json8528 "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",CODE
Excessive Try-Catch Wrapping31 hits · 32 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py524 except Exception:CODE
LOWshap/benchmark/metrics.py13except Exception:CODE
LOWshap/benchmark/metrics.py18except Exception:CODE
LOWshap/maskers/_text.py53 except Exception:CODE
LOWshap/utils/_legacy.py143 except Exception:CODE
LOWshap/explainers/_explainer.py344 except Exception:CODE
LOWshap/explainers/_gradient.py80 except Exception:CODE
LOWshap/explainers/_gradient.py86 except Exception:CODE
LOWshap/explainers/_gradient.py217 except Exception:CODE
LOWshap/explainers/_linear.py362 except Exception:CODE
LOWshap/explainers/tf_utils.py32 except Exception:CODE
LOWshap/explainers/_tree.py936 except Exception:CODE
LOWshap/explainers/_tree.py1391 except Exception:CODE
LOWshap/explainers/_tree.py1404 except Exception:CODE
LOWshap/explainers/_tree.py1417 except Exception:CODE
LOWshap/explainers/_tree.py1431 except Exception:CODE
LOWshap/explainers/_tree.py1444 except Exception:CODE
LOWshap/explainers/_tree.py1459 except Exception:CODE
LOWshap/explainers/_tree.py1469 except Exception:CODE
LOWshap/explainers/_deep/__init__.py77 except Exception:CODE
LOWshap/explainers/_deep/__init__.py83 except Exception:CODE
LOWshap/plots/_beeswarm.py393 except Exception:CODE
LOWshap/plots/_beeswarm.py805 except Exception:CODE
LOWshap/plots/_bar.py322 except Exception:CODE
LOWtests/datasets_to_cache.py66 except Exception as e:CODE
LOWtests/datasets_to_cache.py77 except Exception as e:CODE
LOWtests/explainers/test_tree.py233 except Exception:CODE
LOWtests/explainers/test_tree.py289 except Exception:CODE
LOWtests/explainers/test_deep.py215 except Exception:CODE
LOWtests/plots/test_force_js.py35 except Exception:CODE
LOWtests/plots/test_force_js.py38 except Exception:CODE
Hallucination Indicators3 hits · 30 pts
SeverityFileLineSnippetContext
CRITICALshap/explainers/tf_utils.py31 session = tf.compat.v1.keras.backend.get_session()CODE
CRITICALtests/explainers/test_deep.py235 sess = tf.compat.v1.keras.backend.get_session()CODE
CRITICAL…/user_studies/sickness_scores/static/lib/jquery-min.js5}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.CODE
Decorative Section Separators8 hits · 24 pts
SeverityFileLineSnippetContext
MEDIUMCMakeLists.txt28# ==============================================================================COMMENT
MEDIUMCMakeLists.txt30# ==============================================================================COMMENT
MEDIUMCMakeLists.txt73# ==============================================================================COMMENT
MEDIUMCMakeLists.txt75# ==============================================================================COMMENT
MEDIUMCMakeLists.txt105# ==============================================================================COMMENT
MEDIUMCMakeLists.txt108# ==============================================================================COMMENT
MEDIUMshap/explainers/_additive.py157# ----------COMMENT
MEDIUMshap/explainers/_additive.py200# ----------COMMENT
AI Structural Patterns15 hits · 15 pts
SeverityFileLineSnippetContext
LOWshap/_explanation.py108CODE
LOWshap/models/_model.py29CODE
LOWshap/explainers/_deep/deep_tf.py395CODE
LOWshap/plots/_heatmap.py11CODE
LOWshap/plots/_partial_dependence.py31CODE
LOWshap/plots/_violin.py25CODE
LOWshap/plots/_decision.py212CODE
LOWshap/plots/_force.py30CODE
LOWshap/plots/_force.py384CODE
LOWshap/plots/_group_difference.py7CODE
LOWshap/plots/_beeswarm.py40CODE
LOWshap/plots/_beeswarm.py521CODE
LOWshap/plots/_image.py27CODE
LOWshap/plots/_scatter.py23CODE
LOWshap/plots/_scatter.py517CODE
Modern Structural Boilerplate12 hits · 12 pts
SeverityFileLineSnippetContext
LOWshap/__init__.py103__all__ = [CODE
LOWshap/benchmark/__init__.py9__all__ = ["ComputeTime", "ExplanationError", "BenchmarkResult", "SequentialMasker"]CODE
LOWshap/maskers/__init__.py10__all__ = [CODE
LOWshap/utils/__init__.py25__all__ = [CODE
LOWshap/models/__init__.py7__all__ = [CODE
LOWshap/actions/__init__.py3__all__ = ["Action"]CODE
LOWshap/explainers/__init__.py28__all__ = [CODE
LOWshap/explainers/other/__init__.py7__all__ = [CODE
LOWshap/plots/_style.py96def set_style(_style: StyleConfig | None = None, /, **options: Unpack[StyleOptions]) -> None:CODE
LOWshap/plots/__init__.py24__all__ = [CODE
LOWshap/plots/colors/__init__.py17__all__ = [CODE
LOWtests/plots/test_image.py8def set_reproducible_mpl_rcparams() -> None:CODE
Verbosity Indicators5 hits · 9 pts
SeverityFileLineSnippetContext
LOWshap/explainers/_coalition.py242 # Step 1: build the hierarchyCOMMENT
LOWshap/explainers/_coalition.py259 # Step 2: Compute model results for all unique masksCOMMENT
LOWshap/explainers/_coalition.py270 # Step 3: Compute marginals for permutationsCOMMENT
LOWshap/explainers/_coalition.py277 # Step 4: Implement Owen values weightingCOMMENT
LOWshap/explainers/_coalition.py298 # Step 5: Return resultsCOMMENT
Structural Annotation Overuse5 hits · 9 pts
SeverityFileLineSnippetContext
LOWshap/explainers/_coalition.py242 # Step 1: build the hierarchyCOMMENT
LOWshap/explainers/_coalition.py259 # Step 2: Compute model results for all unique masksCOMMENT
LOWshap/explainers/_coalition.py270 # Step 3: Compute marginals for permutationsCOMMENT
LOWshap/explainers/_coalition.py277 # Step 4: Implement Owen values weightingCOMMENT
LOWshap/explainers/_coalition.py298 # Step 5: Return resultsCOMMENT
Fake / Example Data6 hits · 8 pts
SeverityFileLineSnippetContext
LOWshap/plots/resources/bundle.js2(()=>{var e,t,n={543(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__",l="_CODE
LOWdocs/artwork/california_dataset.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
LOWdocs/artwork/california_instance.html3(()=>{var e={486:function(e,t,n){var r;e=n.nmd(e),function(){var a,i="Expected a function",o="__lodash_hash_undefined__"CODE
LOW…notebooks/Census income classification with Keras.html11831"ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"TCODE
LOW…s/notebooks/Iris classification with scikit-learn.html11837"ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"TCODE
LOW…iner/Keras LSTM for IMDB Sentiment Classification.html11990var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=fCODE
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWshap/utils/image.py39 # Check if empty or notCOMMENT
LOW.github/workflows/run_tests.yml113 # Set DYLD_LIBRARY_PATH to avoid OpenMP conflicts, see https://github.com/unit8co/darts/pull/3050COMMENT
LOW.github/workflows/build_wheels.yml73 # Set DYLD_LIBRARY_PATH to avoid OpenMP conflicts, see https://github.com/unit8co/darts/pull/3050COMMENT
LOW.github/workflows/test_js.yml32 # Check if the built bundle matches the committed bundle (ignoring whitespace)COMMENT