Repository Analysis

bayesian-optimization/BayesianOptimization

A Python implementation of global optimization with gaussian processes.

17.1 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of bayesian-optimization/BayesianOptimization, a Python project with 8,691 GitHub stars. SynthScan v2.0 examined 8,415 lines of code across 39 source files, recording 132 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 17.1 places this repository in the Moderate 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).

17.1
Adjusted Score
17.1
Raw Score
100%
Time Factor
2026-07-21
Last Push
8.7K
Stars
Python
Language
8.4K
Lines of Code
39
Files
132
Pattern Hits
2026-08-02
Scan Date
0.08
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

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

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 0HIGH 3MEDIUM 2LOW 127

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 132 distinct pattern matches across 9 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 Identifiers80 hits · 80 pts
SeverityFileLineSnippetContext
LOWbayes_opt/domain_reduction.py243 def _window_bounds_compatibility(self, global_bounds: NDArray[Float]) -> None:CODE
LOWbayes_opt/acquisition.py1221 def _sample_idx_from_softmax_gains(self, random_state: RandomState) -> int:CODE
LOWtests/test_parameter.py131def test_cateogrical_valid_bounds():CODE
LOWtests/test_parameter.py173def test_preconstructed_parameter():CODE
LOWtests/test_parameter.py189def test_integration_mixed_optimization():CODE
LOWtests/test_parameter.py206def test_integration_mixed_optimization_with_constraints():CODE
LOWtests/test_parameter.py249def test_combined_wrapped_kernel_fit():CODE
LOWtests/test_acquisition.py110def test_acquisition_optimization(gp, target_space):CODE
LOWtests/test_acquisition.py120def test_acquisition_optimization_only_random(gp, target_space, random_state):CODE
LOWtests/test_acquisition.py406def test_upper_confidence_bound_invalid_kappa_error(kappa: float):CODE
LOWtests/test_acquisition.py412def test_upper_confidence_bound_invalid_exploration_decay_error(exploration_decay: float):CODE
LOWtests/test_acquisition.py420def test_upper_confidence_bound_invalid_exploration_decay_delay_error(exploration_decay_delay):CODE
LOWtests/test_acquisition.py428def test_probability_of_improvement_invalid_xi_error(xi: float):CODE
LOWtests/test_acquisition.py434def test_probability_of_improvement_invalid_exploration_decay_error(exploration_decay: float):CODE
LOWtests/test_acquisition.py442def test_probability_of_improvement_invalid_exploration_decay_delay_error(exploration_decay_delay):CODE
LOWtests/test_acquisition.py450def test_expected_improvement_invalid_xi_error(xi: float):CODE
LOWtests/test_acquisition.py456def test_expected_improvement_invalid_exploration_decay_error(exploration_decay: float):CODE
LOWtests/test_acquisition.py464def test_expected_improvement_invalid_exploration_decay_delay_error(exploration_decay_delay):CODE
LOWtests/test_acquisition.py135def test_acquisition_optimization_only_l_bfgs_b(gp, target_space):CODE
LOWtests/test_acquisition.py142def test_upper_confidence_bound(gp, target_space, random_state):CODE
LOWtests/test_acquisition.py159def test_smart_minimize_fails(target_space, random_state):CODE
LOWtests/test_acquisition.py174def test_upper_confidence_bound_with_constraints(gp, constrained_target_space):CODE
LOWtests/test_acquisition.py182def test_probability_of_improvement(gp, target_space, random_state):CODE
LOWtests/test_acquisition.py203def test_probability_of_improvement_with_constraints(gp, constrained_target_space, random_state):CODE
LOWtests/test_acquisition.py220def test_expected_improvement(gp, target_space, random_state):CODE
LOWtests/test_acquisition.py241def test_expected_improvement_with_constraints(gp, constrained_target_space, random_state):CODE
LOWtests/test_acquisition.py289def test_constant_liar_invalid_strategy():CODE
LOWtests/test_acquisition.py294def test_constant_liar_with_constraints(gp, constrained_target_space, random_state):CODE
LOWtests/test_acquisition.py328def test_gphedge_update_gains(random_state):CODE
LOWtests/test_acquisition.py352def test_gphedge_softmax_sampling(random_state):CODE
LOWtests/test_acquisition.py376def test_gphedge_skips_duplicate_candidate_when_unique_candidate_exists(gp, target_space, random_state):CODE
LOWtests/test_acquisition.py519def test_integration_acquisition_functions(CODE
LOWtests/test_acquisition.py549def test_integration_constrained(target_func_x_and_y, pbounds, constraint, tmp_path):CODE
LOWtests/test_acquisition.py579def test_custom_acquisition_without_get_params():CODE
LOWtests/test_acquisition.py600def test_custom_acquisition_without_set_params():CODE
LOWtests/test_bayesian_optimization.py190def test_prime_queue_all_empty():CODE
LOWtests/test_bayesian_optimization.py200def test_prime_queue_empty_with_init():CODE
LOWtests/test_bayesian_optimization.py210def test_prime_queue_with_register():CODE
LOWtests/test_bayesian_optimization.py101def test_register_array_uses_pbounds_order_without_warning():CODE
LOWtests/test_bayesian_optimization.py112def test_probe_array_uses_pbounds_order_without_warning():CODE
LOWtests/test_bayesian_optimization.py172def test_suggest_with_one_observation():CODE
LOWtests/test_bayesian_optimization.py221def test_prime_queue_with_register_and_init():CODE
LOWtests/test_bayesian_optimization.py285def test_define_wrong_transformer():CODE
LOWtests/test_bayesian_optimization.py292def test_single_value_objective():CODE
LOWtests/test_bayesian_optimization.py371def test_save_load_w_categorical_params(tmp_path):CODE
LOWtests/test_bayesian_optimization.py402def test_suggest_point_returns_same_point(tmp_path):CODE
LOWtests/test_bayesian_optimization.py419def test_save_load_random_state(tmp_path):CODE
LOWtests/test_bayesian_optimization.py441def test_save_load_unused_optimizer(tmp_path):CODE
LOWtests/test_bayesian_optimization.py523def test_save_load_w_domain_reduction(tmp_path):CODE
LOWtests/test_bayesian_optimization.py560def test_save_load_w_custom_parameter(tmp_path):CODE
LOWtests/test_bayesian_optimization.py708def test_predict_integer_params():CODE
LOWtests/test_bayesian_optimization.py745def test_predict_categorical_params():CODE
LOWtests/test_bayesian_optimization.py775def test_predict_no_points_registered():CODE
LOWtests/test_bayesian_optimization.py795def test_predict_custom_parameter():CODE
LOWtests/test_bayesian_optimization.py829def test_predict_invalid_params_type():CODE
LOWtests/test_bayesian_optimization.py849def test_predict_return_std_and_cov_mutually_exclusive():CODE
LOWtests/test_bayesian_optimization.py864def test_predict_shape_semantics_dict_vs_list():CODE
LOWtests/test_bayesian_optimization.py885def test_predict_shape_semantics_with_std():CODE
LOWtests/test_bayesian_optimization.py913def test_predict_shape_semantics_with_cov():CODE
LOWtests/test_target_space.py21def test_keys_and_bounds_in_same_order():CODE
20 more matches not shown…
Unused Imports25 hits · 24 pts
SeverityFileLineSnippetContext
LOWbayes_opt/target_space.py3CODE
LOWbayes_opt/constraint.py3CODE
LOWbayes_opt/exception.py3CODE
LOWbayes_opt/domain_reduction.py8CODE
LOWbayes_opt/util.py3CODE
LOWbayes_opt/bayesian_optimization.py7CODE
LOWbayes_opt/__init__.py3CODE
LOWbayes_opt/__init__.py7CODE
LOWbayes_opt/__init__.py8CODE
LOWbayes_opt/__init__.py9CODE
LOWbayes_opt/__init__.py10CODE
LOWbayes_opt/__init__.py11CODE
LOWbayes_opt/__init__.py12CODE
LOWbayes_opt/logger.py3CODE
LOWbayes_opt/acquisition.py21CODE
LOWbayes_opt/parameter.py3CODE
LOWtests/test_notebooks_run.py5CODE
LOWtests/test_parameter.py1CODE
LOWtests/test_util.py1CODE
LOWtests/test_acquisition.py1CODE
LOWtests/test_bayesian_optimization.py1CODE
LOWtests/test_target_space.py1CODE
LOWtests/test_constraint.py1CODE
LOWtests/test_logger.py1CODE
LOWtests/test_seq_domain_red.py1CODE
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHREADME.md0function with unknown internals we wish to maximize. this is just serving as an example, however, for all intents and puSTRING
HIGHtests/test_seq_domain_red.py0function with unknown internals we wish to maximize. this is just serving as an example, however, for all intents and puSTRING
HIGHexamples/async_optimization.py0function with unknown internals we wish to maximize. this is just serving as an example, however, for all intents and puSTRING
Modern Structural Boilerplate14 hits · 12 pts
SeverityFileLineSnippetContext
LOWbayes_opt/target_space.py687 def set_bounds(self, new_bounds: BoundsMapping) -> None:CODE
LOWbayes_opt/exception.py5__all__ = [CODE
LOWbayes_opt/bayesian_optimization.py393 def set_bounds(self, new_bounds: BoundsMapping) -> None:STRING
LOWbayes_opt/bayesian_optimization.py403 def set_gp_params(self, **params: Any) -> None:STRING
LOWbayes_opt/__init__.py17__all__ = [CODE
LOWbayes_opt/logger.py226 def _update_tracker(self, current_max: dict[str, Any] | None) -> None:CODE
LOWbayes_opt/acquisition.py102 def set_acquisition_params(self, params: dict[str, Any]) -> None:CODE
LOWbayes_opt/acquisition.py570 def set_acquisition_params(self, params: dict[str, Any]) -> None:STRING
LOWbayes_opt/acquisition.py750 def set_acquisition_params(self, params: dict[str, Any]) -> None:STRING
LOWbayes_opt/acquisition.py939 def set_acquisition_params(self, params: dict[str, Any]) -> None:STRING
LOWbayes_opt/acquisition.py1166 def set_acquisition_params(self, params: dict[str, Any]) -> None:STRING
LOWbayes_opt/acquisition.py1238 def _update_gains(self, gp: GaussianProcessRegressor) -> None:CODE
LOWbayes_opt/acquisition.py1346 def set_acquisition_params(self, params: dict[str, Any]) -> None:CODE
LOWtests/test_acquisition.py106 def set_acquisition_params(self, params: dict) -> None:CODE
Redundant / Tautological Comments4 hits · 5 pts
SeverityFileLineSnippetContext
LOWbayes_opt/acquisition.py390 # Check if successCOMMENT
LOWbayes_opt/acquisition.py1110 # Check if any dummies have been evaluated and remove themSTRING
LOWtests/test_logger.py179 # Check if header contains expected column namesCOMMENT
LOWtests/test_logger.py185 # Check if divider line is includedCOMMENT
Self-Referential Comments2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMbayes_opt/acquisition.py1113 # Create a copy of the target spaceSTRING
MEDIUMexamples/typed_hyperparameter_tuning.py16# Define the hyperparameter spaceCOMMENT
Deep Nesting2 hits · 2 pts
SeverityFileLineSnippetContext
LOWbayes_opt/target_space.py237CODE
LOWbayes_opt/acquisition.py1058CODE
Over-Commented Block1 hit · 1 pts
SeverityFileLineSnippetContext
LOWdocsrc/conf.py1# Configuration file for the Sphinx documentation builder.COMMENT
Excessive Try-Catch Wrapping1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtests/test_bayesian_optimization.py335 except Exception as e:CODE