Repository Analysis

optuna/optuna

A hyperparameter optimization framework

28.2 Moderate AI signal View on GitHub
28.2
Adjusted Score
28.2
Raw Score
100%
Time Factor
2026-05-28
Last Push
14,268
Stars
Python
Language
70,185
Lines of Code
412
Files
1647
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 43MEDIUM 73LOW 1531

Pattern Findings

1647 matches across 14 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers901 hits · 890 pts
SeverityFileLineSnippet
LOWtutorial/20_recipes/005_user_defined_sampler.py96 def infer_relative_search_space(self, study, trial):
LOWtests/test_transform.py28def test_search_space_transform_shapes_dtypes(param: Any, distribution: BaseDistribution) -> None:
LOWtests/test_transform.py44def test_search_space_transform_encoding() -> None:
LOWtests/test_transform.py92def test_search_space_transform_numerical(
LOWtests/test_transform.py146def test_search_space_transform_values_categorical(
LOWtests/test_transform.py161def test_search_space_transform_untransform_params() -> None:
LOWtests/test_transform.py208def test_transform_untransform_params_at_bounds(
LOWtests/test_imports.py6def test_try_import_is_successful() -> None:
LOWtests/test_imports.py13def test_try_import_is_successful_other_error() -> None:
LOWtests/test_imports.py21def test_try_import_not_successful() -> None:
LOWtests/test_convert_positional_args.py24def test_convert_positional_args_decorator() -> None:
LOWtests/test_convert_positional_args.py36def test_convert_positional_args_future_warning_for_methods() -> None:
LOWtests/test_convert_positional_args.py49def test_convert_positional_args_future_warning() -> None:
LOWtests/test_convert_positional_args.py70def test_convert_positional_args_mypy_type_inference() -> None:
LOWtests/test_convert_positional_args.py104def test_convert_positional_args_invalid_previous_positional_arg_names(
LOWtests/test_convert_positional_args.py125def test_convert_positional_args_invalid_positional_args() -> None:
LOWtests/test_deprecated.py36def test_deprecation_raises_error_for_invalid_version(
LOWtests/test_deprecated.py46def test_deprecation_decorator() -> None:
LOWtests/test_deprecated.py65def test_deprecation_instance_method_decorator() -> None:
LOWtests/test_deprecated.py79def test_deprecation_class_decorator() -> None:
LOWtests/test_deprecated.py96def test_deprecation_class_decorator_name() -> None:
LOWtests/test_deprecated.py108def test_deprecation_decorator_name() -> None:
LOWtests/test_deprecated.py124def test_deprecation_text_specified(text: str | None) -> None:
LOWtests/test_deprecated.py152def test_deprecation_class_text_specified(text: str | None) -> None:
LOWtests/test_deprecated.py182def test_deprecation_decorator_default_removed_version() -> None:
LOWtests/test_distributions.py74def test_json_to_distribution() -> None:
LOWtests/test_distributions.py83def test_abbreviated_json_to_distribution() -> None:
LOWtests/test_distributions.py525def test_categorical_init_error() -> None:
LOWtests/test_distributions.py530def test_categorical_distribution_different_sequence_types() -> None:
LOWtests/test_distributions.py538def test_convert_old_distribution_to_new_distribution() -> None:
LOWtests/test_distributions.py108def test_distribution_to_json() -> None:
LOWtests/test_distributions.py119def test_check_distribution_compatibility() -> None:
LOWtests/test_distributions.py200def test_int_internal_representation(value: Any) -> None:
LOWtests/test_distributions.py224def test_int_internal_representation_error(value: Any, kwargs: dict[str, Any]) -> None:
LOWtests/test_distributions.py234def test_float_internal_representation(value: Any) -> None:
LOWtests/test_distributions.py258def test_float_internal_representation_error(value: Any, kwargs: dict[str, Any]) -> None:
LOWtests/test_distributions.py264def test_categorical_internal_representation() -> None:
LOWtests/test_distributions.py330def test_categorical_contains() -> None:
LOWtests/test_distributions.py339def test_empty_range_contains() -> None:
LOWtests/test_distributions.py419def test_invalid_distribution() -> None:
LOWtests/test_distributions.py459def test_int_distribution_asdict(key: str, low: int, high: int, log: bool, step: int) -> None:
LOWtests/test_distributions.py472def test_float_distribution_asdict(
LOWtests/test_distributions.py570def test_convert_old_distribution_to_new_distribution_noop() -> None:
LOWtests/test_multi_objective.py24def assert_is_output_equal_to_ans(
LOWtests/test_multi_objective.py46def test_get_pareto_front_trials(
LOWtests/test_multi_objective.py73def test_get_pareto_front_trials_with_constraint(
LOWtests/test_cli.py139def test_create_study_command_with_study_name() -> None:
LOWtests/test_cli.py154def test_create_study_command_without_storage_url() -> None:
LOWtests/test_cli.py164def test_create_study_command_with_storage_env() -> None:
LOWtests/test_cli.py48def objective_func_branched_search_space(trial: Trial) -> float:
LOWtests/test_cli.py59def objective_func_multi_objective(trial: Trial) -> tuple[float, float]:
LOWtests/test_cli.py121def test_create_study_command() -> None:
LOWtests/test_cli.py183def test_create_study_command_with_direction() -> None:
LOWtests/test_cli.py205def test_create_study_command_with_multiple_directions() -> None:
LOWtests/test_cli.py257def test_delete_study_command() -> None:
LOWtests/test_cli.py274def test_delete_study_command_without_storage_url() -> None:
LOWtests/test_cli.py282def test_study_set_user_attr_command() -> None:
LOWtests/test_cli.py366def test_study_names_command_without_storage_url() -> None:
LOWtests/test_cli.py442def test_studies_command_flatten(output_format: str | None) -> None:
LOWtests/test_cli.py611def test_trials_command_flatten(
841 more matches not shown…
Unused Imports485 hits · 476 pts
SeverityFileLineSnippet
LOWtutorial/20_recipes/012_artifact_tutorial.py252
LOWtutorial/10_key_features/002_configurations.py17
LOWtests/test_convert_positional_args.py1
LOWtests/test_deprecated.py1
LOWtests/test_distributions.py1
LOWtests/test_multi_objective.py1
LOWtests/test_cli.py1
LOWtests/trial_tests/test_frozen.py1
LOWtests/trial_tests/test_trials.py1
LOWtests/trial_tests/test_trial.py1
LOWtests/trial_tests/test_fixed.py1
LOWtests/pruners_tests/test_percentile.py1
LOWtests/pruners_tests/test_median.py1
LOWtests/pruners_tests/test_patient.py1
LOWtests/pruners_tests/test_wilcoxon.py1
LOWtests/pruners_tests/test_successive_halving.py1
LOWtests/pruners_tests/test_hyperband.py1
LOWtests/study_tests/test_optimize.py1
LOWtests/study_tests/test_study.py1
LOWtests/study_tests/test_multi_objective.py1
LOWtests/study_tests/test_dataframe.py1
LOWtests/hypervolume_tests/test_hssp.py1
LOWtests/hypervolume_tests/test_box_decomposition.py1
LOWtests/importance_tests/test_importance_evaluators.py1
LOWtests/importance_tests/test_init.py1
LOWtests/importance_tests/fanova_tests/test_tree.py1
LOWtests/importance_tests/pedanova_tests/test_evaluator.py1
LOW…ce_tests/pedanova_tests/test_scott_parzen_estimator.py1
LOWtests/artifacts_tests/test_upload_artifact.py1
LOWtests/artifacts_tests/test_boto3.py1
LOWtests/artifacts_tests/test_download_artifact.py1
LOWtests/artifacts_tests/test_gcs.py1
LOWtests/artifacts_tests/stubs.py1
LOWtests/artifacts_tests/test_list_artifact_meta.py1
LOWtests/storages_tests/test_grpc.py1
LOWtests/storages_tests/test_heartbeat.py1
LOWtests/storages_tests/test_cached_storage.py1
LOWtests/storages_tests/test_storages.py1
LOWtests/storages_tests/test_with_server.py1
LOWtests/storages_tests/rdb_tests/test_storage.py1
LOWtests/storages_tests/rdb_tests/test_storage.py19
LOWtests/storages_tests/rdb_tests/test_models.py1
LOWtests/storages_tests/rdb_tests/create_db.py39
LOWtests/storages_tests/journal_tests/test_journal.py1
LOW…ages_tests/journal_tests/test_combination_with_grpc.py1
LOWtests/samplers_tests/test_grid.py1
LOWtests/samplers_tests/test_gp.py1
LOWtests/samplers_tests/test_cmaes.py1
LOWtests/samplers_tests/test_samplers.py1
LOWtests/samplers_tests/test_base_gasampler.py1
LOWtests/samplers_tests/test_nsgaii.py1
LOWtests/samplers_tests/test_nsgaiii.py1
LOWtests/samplers_tests/test_qmc.py1
LOWtests/samplers_tests/tpe_tests/test_parzen_estimator.py1
LOWtests/samplers_tests/tpe_tests/test_truncnorm.py1
LOW…mplers_tests/tpe_tests/test_multi_objective_sampler.py1
LOWtests/samplers_tests/tpe_tests/test_sampler.py1
LOWtests/gp_tests/test_batched_lbfgsb.py1
LOWtests/gp_tests/test_search_space.py1
LOWtests/gp_tests/test_gp.py1
425 more matches not shown…
Decorative Section Separators40 hits · 146 pts
SeverityFileLineSnippet
MEDIUMtutorial/20_recipes/003_attributes.py12# ---------------------------------
MEDIUMtutorial/20_recipes/003_attributes.py52# --------------------------------
MEDIUMtutorial/20_recipes/001_rdb.py48# ------------
MEDIUMtutorial/20_recipes/001_rdb.py78# --------------------
MEDIUMtutorial/20_recipes/009_ask_and_tell.py154# ---------------
MEDIUMtutorial/20_recipes/009_ask_and_tell.py156# ---------------
MEDIUMtutorial/20_recipes/009_ask_and_tell.py193# -------------------
MEDIUMtutorial/20_recipes/009_ask_and_tell.py195# -------------------
MEDIUMtutorial/20_recipes/010_reuse_best_trial.py87# ----------------------------------------------------------------------------------
MEDIUMtutorial/20_recipes/013_wilcoxon_pruner.py186# ---------------------------------------------------------------------------------------
MEDIUMtutorial/20_recipes/013_wilcoxon_pruner.py195# -----------------------------
MEDIUMtutorial/20_recipes/008_specify_params.py102# ----------------------------------------------------------------------
MEDIUMtutorial/20_recipes/008_specify_params.py104# ----------------------------------------------------------------------
MEDIUMtutorial/20_recipes/007_optuna_callback.py17# -------------------------------------------------------
MEDIUMtutorial/20_recipes/012_artifact_tutorial.py440# ----------
MEDIUMtutorial/20_recipes/002_multi_objective.py117# --------------------------------
MEDIUM…_key_features/003_efficient_optimization_algorithms.py67# ------------------
MEDIUM…_key_features/003_efficient_optimization_algorithms.py96# ------------------
MEDIUM…_key_features/003_efficient_optimization_algorithms.py151# ----------------------------------------
MEDIUM…_key_features/003_efficient_optimization_algorithms.py179# -------------------------------
MEDIUMtutorial/10_key_features/002_configurations.py45# -------------------------
MEDIUMtutorial/10_key_features/001_first.py72# ------------
MEDIUMtutorial/10_key_features/005_visualization.py172# --------------
MEDIUMtutorial/10_key_features/005_visualization.py228# ---------------------------
MEDIUMtutorial/10_key_features/004_distributed.py152# ----------------------------------------------
MEDIUMtutorial/10_key_features/004_distributed.py218# ---------------------------------------
MEDIUMtutorial/10_key_features/004_distributed.py278# ---------------------------------------------
MEDIUMtests/study_tests/test_multi_objective.py46 # ╔═════╤═════╤═════╤═════╤═════╗
MEDIUMtests/study_tests/test_multi_objective.py48 # ╟─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/study_tests/test_multi_objective.py50 # ╟─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/study_tests/test_multi_objective.py52 # value0 ╟─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/study_tests/test_multi_objective.py54 # ╟─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/study_tests/test_multi_objective.py56 # ╚═════╧═════╧═════╧═════╧═════╝
MEDIUMtests/samplers_tests/test_nsgaii.py299 # ╔═════╤═════╤═════╤═════╤═════╤═════╗
MEDIUMtests/samplers_tests/test_nsgaii.py301 # ╟─────┼─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/samplers_tests/test_nsgaii.py303 # ╟─────┼─feasible ─┼─────┼─────┼─────╢
MEDIUMtests/samplers_tests/test_nsgaii.py305 # c1 ╟─────┼─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/samplers_tests/test_nsgaii.py307 # ╟─────┼─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/samplers_tests/test_nsgaii.py309 # ╟─────┼─────┼─────┼─────┼─────┼─────╢
MEDIUMtests/samplers_tests/test_nsgaii.py311 # ╚═════╧═════╧═════╧═════╧═════╧═════╝
Docstring Block Structure20 hits · 100 pts
SeverityFileLineSnippet
HIGHoptuna/visualization/_timeline.py38Plot the timeline of a study. Args: study: A :class:`~optuna.study.Study` object whose trials a
HIGHoptuna/visualization/matplotlib/_timeline.py24Plot the timeline of a study. .. seealso:: Please refer to :func:`optuna.visualization.plot_timeline` for a
HIGHoptuna/storages/_base.py55Create a new study from a name. If no name is specified, the storage class generates a name. The return
HIGHoptuna/storages/_base.py135Read the ID of a study. Args: study_name: Name of the study. Returns:
HIGHoptuna/storages/_base.py152Read the study name of a study. Args: study_id: ID of the study. Returns:
HIGHoptuna/storages/_base.py169Read whether a study maximizes or minimizes an objective. Args: study_id: ID of a s
HIGHoptuna/storages/_base.py186Read the user-defined attributes of a study. Args: study_id: ID of the study.
HIGHoptuna/storages/_base.py203Read the optuna-internal attributes of a study. Args: study_id: ID of the study.
HIGHoptuna/storages/_base.py232Create and add a new trial to a study. The returned trial ID is unique among all current and deleted trials.
HIGHoptuna/storages/_base.py281Read the trial ID of a trial. Args: study_id: ID of the study. trial_nu
HIGHoptuna/storages/_base.py302Read the trial number of a trial. .. note:: The trial number is only unique within a study, and is
HIGHoptuna/storages/_base.py322Read the parameter of a trial. Args: trial_id: ID of the trial. param_n
HIGHoptuna/storages/_base.py345Update the state and values of a trial. Set return values of an objective function to values argument.
HIGHoptuna/storages/_base.py445Read a trial. Args: trial_id: ID of the trial. Returns: Trial
HIGHoptuna/storages/_base.py467Read all trials in a study. Args: study_id: ID of the study. deepcopy:
HIGHoptuna/storages/_base.py490Count the number of trials in a study. Args: study_id: ID of the study.
HIGHoptuna/storages/_base.py512Return the trial with the best value in a study. This method is valid only during single-objective optimization
HIGHoptuna/storages/_base.py551Read the parameter dictionary of a trial. Args: trial_id: ID of the trial.
HIGHoptuna/storages/_base.py568Read the user-defined attributes of a trial. Args: trial_id: ID of the trial.
HIGHoptuna/storages/_base.py584Read the optuna-internal attributes of a trial. Args: trial_id: ID of the trial.
Cross-File Repetition17 hits · 85 pts
SeverityFileLineSnippet
HIGHtests/hypervolume_tests/test_box_decomposition.py0see section 4.2 of https://arxiv.org/pdf/1510.01963
HIGHtests/hypervolume_tests/test_box_decomposition.py0see section 4.2 of https://arxiv.org/pdf/1510.01963
HIGHtests/hypervolume_tests/test_box_decomposition.py0see section 4.2 of https://arxiv.org/pdf/1510.01963
HIGH…mplers_tests/tpe_tests/test_multi_objective_sampler.py0test samples are drawn from the specified category.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0test samples are drawn from the specified category.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0test samples are drawn from the specified category.
HIGH…mplers_tests/tpe_tests/test_multi_objective_sampler.py0test sampling from int distribution returns integer.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0test sampling from int distribution returns integer.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0test sampling from int distribution returns integer.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0test sampling from int distribution returns integer.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0test sampling from int distribution returns integer.
HIGH…mplers_tests/tpe_tests/test_multi_objective_sampler.py0tests fail, running, and waiting states are equally.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0tests fail, running, and waiting states are equally.
HIGHtests/samplers_tests/tpe_tests/test_sampler.py0tests fail, running, and waiting states are equally.
HIGHoptuna/storages/_grpc/auto_generated/api_pb2_grpc.py0* optuna storage service defines apis to interact with the storage.
HIGHoptuna/storages/_grpc/auto_generated/api_pb2_grpc.py0* optuna storage service defines apis to interact with the storage.
HIGHoptuna/storages/_grpc/auto_generated/api_pb2_grpc.py0* optuna storage service defines apis to interact with the storage.
Self-Referential Comments25 hits · 78 pts
SeverityFileLineSnippet
MEDIUMtutorial/20_recipes/008_specify_params.py42# Define the objective function.
MEDIUMtutorial/10_key_features/005_visualization.py125# Define the objective function.
MEDIUMtests/test_cli.py322 # Create a study.
MEDIUMtests/study_tests/test_study.py405 # Create a new study.
MEDIUMtests/study_tests/test_study.py1150 # Create a trial to retrieve it as the `study.best_trial`.
MEDIUMtests/study_tests/test_study.py1652 # Create a study and ask for a new trial.
MEDIUMtests/storages_tests/test_callbacks.py24 # Create a trial and manually set it as failed.
MEDIUMtests/storages_tests/test_cached_storage.py134 # Create a trial via CachedStorage and update it via backend storage directly.
MEDIUMtests/storages_tests/test_with_server.py69 # Create a study
MEDIUMtests/storages_tests/test_with_server.py130 # Create a new study to confirm the study can load trial properly.
MEDIUMtests/storages_tests/rdb_tests/test_storage.py225 # Create a new study.
MEDIUMtests/storages_tests/rdb_tests/test_storage.py275 # Create a new study.
MEDIUMtests/storages_tests/rdb_tests/create_db.py85 # Create an empty study.
MEDIUMtests/storages_tests/rdb_tests/create_db.py88 # Create a study for single-objective optimization.
MEDIUMtests/storages_tests/rdb_tests/create_db.py93 # Create a study for multi-objective optimization.
MEDIUMtests/storages_tests/rdb_tests/create_db.py106 # Create a study for distributions upgrade.
MEDIUMtests/samplers_tests/test_samplers.py67# This function is used only in test_reproducible_in_other_process, but declared at top-level
MEDIUM…ion_examples/optuna.visualization.plot_pareto_front.py32# The following code snippet shows how to plot a 2-dimensional Pareto front
MEDIUMoptuna/visualization/_utils.py132 # This function is not raising when target is missing, since we're
MEDIUMoptuna/storages/journal/_file.py63 open(self._file_path, "ab").close() # Create a file if it does not exist.
MEDIUMoptuna/storages/_grpc/auto_generated/api_pb2_grpc.py398 # This class is part of an EXPERIMENTAL API.
MEDIUMoptuna/study/study.py803 # Create a dataframe from the study.
MEDIUMoptuna/pruners/_hyperband.py269 # This class is assumed to be passed to
MEDIUM…plers/_nsgaiii/_elite_population_selection_strategy.py22# Define a coefficient for scaling intervals, used in _filter_inf() to replace +-inf.
MEDIUMoptuna/samplers/_tpe/_truncnorm.py1# This file contains the codes from SciPy project.
Deep Nesting71 hits · 66 pts
SeverityFileLineSnippet
LOWtests/test_transform.py92
LOWtests/test_cli.py64
LOWtests/test_cli.py533
LOWtests/test_cli.py611
LOWtests/test_cli.py687
LOWtests/test_cli.py768
LOWtests/test_cli.py843
LOWtests/test_cli.py928
LOWtests/study_tests/test_study.py1087
LOWtests/study_tests/test_dataframe.py51
LOWtests/storages_tests/journal_tests/test_journal.py124
LOWtests/samplers_tests/test_nsgaii.py290
LOWtests/samplers_tests/test_nsgaii.py364
LOWtests/visualization_tests/test_contour.py396
LOWtests/visualization_tests/test_hypervolume_history.py25
LOWtests/visualization_tests/test_hypervolume_history.py28
LOWtests/visualization_tests/test_hypervolume_history.py29
LOWtests/visualization_tests/test_rank.py128
LOWoptuna/distributions.py565
LOWoptuna/distributions.py709
LOWoptuna/distributions.py531
LOWoptuna/cli.py82
LOWoptuna/cli.py98
LOWoptuna/cli.py244
LOWoptuna/progress_bar.py76
LOWoptuna/_transform.py175
LOWoptuna/_transform.py246
LOWoptuna/_transform.py269
LOWoptuna/visualization/_rank.py117
LOWoptuna/visualization/_rank.py308
LOWoptuna/visualization/_parallel_coordinate.py124
LOWoptuna/visualization/_optimization_history.py51
LOWoptuna/visualization/_optimization_history.py139
LOWoptuna/visualization/_slice.py183
LOWoptuna/visualization/_contour.py109
LOWoptuna/visualization/_contour.py260
LOWoptuna/visualization/matplotlib/_utils.py37
LOWoptuna/visualization/matplotlib/_contour.py81
LOWoptuna/visualization/matplotlib/_contour.py326
LOWoptuna/storages/_cached_storage.py89
LOWoptuna/storages/_in_memory.py371
LOWoptuna/storages/journal/_file.py148
LOWoptuna/storages/journal/_file.py239
LOWoptuna/storages/journal/_storage.py414
LOWoptuna/storages/journal/_storage.py578
LOWoptuna/storages/_grpc/client.py257
LOWoptuna/storages/_rdb/storage.py675
LOWoptuna/storages/_rdb/storage.py783
LOWoptuna/storages/_rdb/storage.py863
LOWoptuna/storages/_rdb/alembic/versions/v3.0.0.c.py68
LOWoptuna/storages/_rdb/alembic/versions/v3.0.0.d.py78
LOWoptuna/study/_dataframe.py22
LOWoptuna/study/_optimize.py39
LOWoptuna/study/_optimize.py186
LOWoptuna/study/_tell.py80
LOWoptuna/study/study.py1204
LOWoptuna/study/study.py1607
LOWoptuna/trial/_trial.py624
LOWoptuna/importance/_base.py115
LOWoptuna/importance/_fanova/_tree.py80
11 more matches not shown…
Over-Commented Block55 hits · 54 pts
SeverityFileLineSnippet
LOWtutorial/20_recipes/001_rdb.py61# reproducibility, you need to restore the sampler with using ``pickle`` as follows::
LOWtutorial/20_recipes/001_rdb.py81#
LOWtutorial/20_recipes/009_ask_and_tell.py81 clf.fit(X_train, y_train)
LOWtutorial/20_recipes/009_ask_and_tell.py101# from sklearn.linear_model import SGDClassifier
LOWtutorial/20_recipes/009_ask_and_tell.py121# trial = study.ask()
LOWtutorial/20_recipes/009_ask_and_tell.py141# score = clf.score(X_valid, y_valid)
LOWtutorial/20_recipes/009_ask_and_tell.py241# :class:`optuna.samplers.TPESampler` class can take a boolean parameter ``constant_liar``. It
LOWtutorial/20_recipes/010_reuse_best_trial.py81# Pass ``study.best_trial`` as the argument of ``detailed_objective``.
LOWtutorial/20_recipes/013_wilcoxon_pruner.py181
LOWtutorial/20_recipes/013_wilcoxon_pruner.py201# too often, the optimization may get stuck in a local optimum, so we must tune the threshold
LOWtutorial/20_recipes/008_specify_params.py101#
LOWtutorial/20_recipes/012_artifact_tutorial.py321# Each function is as follows.
LOWtutorial/20_recipes/012_artifact_tutorial.py421 write("best_atoms.png", best_atoms, rotation=("315x,0y,0z"))
LOWtutorial/20_recipes/012_artifact_tutorial.py441#
LOWtutorial/20_recipes/011_journal_storage.py41
LOWtutorial/20_recipes/004_cli.py41
LOWtutorial/20_recipes/004_cli.py61#
LOWtutorial/20_recipes/002_multi_objective.py121# Specifically, in this example, we want to minimize the FLOPS (we want a faster model)
LOW…_key_features/003_efficient_optimization_algorithms.py61study = optuna.create_study(sampler=optuna.samplers.CmaEsSampler())
LOW…_key_features/003_efficient_optimization_algorithms.py81#
LOW…_key_features/003_efficient_optimization_algorithms.py141optuna.logging.get_logger("optuna").addHandler(logging.StreamHandler(sys.stdout))
LOW…_key_features/003_efficient_optimization_algorithms.py161# This table is from the `Ozaki et al., Hyperparameter Optimization Methods: Overview and Characteristics, in IEICE Tran
LOW…_key_features/003_efficient_optimization_algorithms.py181#
LOWtutorial/10_key_features/002_configurations.py41
LOWtutorial/10_key_features/002_configurations.py61 if classifier_name == "SVC":
LOWtutorial/10_key_features/002_configurations.py81# layers = []
LOWtutorial/10_key_features/001_first.py41#
LOWtutorial/10_key_features/001_first.py61# We can see that the ``x`` value found by Optuna is close to the optimal value of ``2``.
LOWtutorial/10_key_features/004_distributed.py141study = optuna.create_study(
LOWtutorial/10_key_features/004_distributed.py161# it cannot be used for multi-process optimization.
LOWtutorial/10_key_features/004_distributed.py181# def run_optimization(_):
LOWtutorial/10_key_features/004_distributed.py201# Running trial trial.number=3 in process 4607
LOWtutorial/10_key_features/004_distributed.py221# it is likely to cause race conditions when accessed by multiple machines.
LOWtutorial/10_key_features/004_distributed.py241# x = trial.suggest_float("x", -10, 10)
LOWtutorial/10_key_features/004_distributed.py261# [I 2025-06-03 14:07:45,306] A new study created in RDB with name: distributed_test
LOWtutorial/10_key_features/004_distributed.py281# In that case, you can use :class:`~optuna.storages.GrpcStorageProxy`
LOWtutorial/10_key_features/004_distributed.py301#
LOWtutorial/10_key_features/004_distributed.py321#
LOWtests/study_tests/test_multi_objective.py41
LOWtests/samplers_tests/test_nsgaii.py301 # ╟─────┼─────┼─────┼─────┼─────┼─────╢
LOWtests/samplers_tests/test_brute_force.py361 # suggest new parameters, considering the possibility for trials[1] to suggest `y`.
LOWdocs/source/conf.py1# -*- coding: utf-8 -*-
LOWdocs/source/conf.py121# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
LOWdocs/source/conf.py141 #
LOWoptuna/visualization/matplotlib/_contour.py321 zmap[(xindex, yindex)] = z
LOWoptuna/storages/journal/_storage.py321 if state == TrialState.RUNNING:
LOWoptuna/storages/_rdb/alembic.ini1# A generic, single database configuration.
LOWoptuna/storages/_rdb/alembic.ini21# the 'revision' command, regardless of autogenerate
LOWoptuna/samplers/_brute_force.py41 # A node takes one of the following four states:
LOWoptuna/samplers/_tpe/_truncnorm.py1# This file contains the codes from SciPy project.
LOWoptuna/samplers/_tpe/_truncnorm.py21
LOWoptuna/samplers/_tpe/_truncnorm.py121 def mass_case_left(a: np.ndarray, b: np.ndarray) -> np.ndarray:
LOWoptuna/samplers/_tpe/_erf.py1# This code is the modified version of erf function in FreeBSD's standard C library.
LOWoptuna/_hypervolume/wfg.py81 # function simply becomes slower.
LOWoptuna/_hypervolume/wfg.py161 # NOTE(nabenabe): The result of this function does not change both by
Cross-Language Confusion6 hits · 38 pts
SeverityFileLineSnippet
HIGHtutorial/20_recipes/004_cli.py56# --search-space '{"x": {"name": "FloatDistribution", "attributes": {"step": null, "low": -10.0, "high": 10.0,
HIGHtests/test_distributions.py65 "f": '{"type": "float", "low": 1.0, "high": 2.0, "log": false, "step": null}',
HIGHtests/test_distributions.py66 "fl": '{"type": "float", "low": 0.001, "high": 100, "log": true, "step": null}',
HIGHtests/test_distributions.py16_choices_json = '[null, true, false, 0, 1, 0.0, 1.0, NaN, Infinity, -Infinity, "", "a"]'
HIGHtests/test_distributions.py47 '"attributes": {"low": 1.0, "high": 2.0, "log": false, "step": null}}',
HIGHtests/test_distributions.py49 '"attributes": {"low": 0.001, "high": 100.0, "log": true, "step": null}}',
AI Slop Vocabulary5 hits · 14 pts
SeverityFileLineSnippet
MEDIUMtutorial/20_recipes/013_wilcoxon_pruner.py205# Some samplers, including the default ``TPESampler``, currently cannot utilize the
MEDIUMtutorial/20_recipes/008_specify_params.py103# Second scenario: Have Optuna utilize already evaluated hyperparameters
LOWoptuna/_gp/gp.py300 # Note that we cannot just use the constraint because of the numerical unstability
LOWoptuna/_gp/acqf.py326 # Since all the objectives are equally important, we simply use the mean of
LOWoptuna/_gp/acqf.py392 # Since all the objectives are equally important, we simply use the mean of
Slop Phrases4 hits · 12 pts
SeverityFileLineSnippet
MEDIUMtutorial/10_key_features/002_configurations.py49# Also, you can use branches or loops depending on the parameter values.
MEDIUMtutorial/10_key_features/004_distributed.py232# Then, you can use this MySQL database as a storage backend by setting the
MEDIUMtutorial/10_key_features/004_distributed.py281# In that case, you can use :class:`~optuna.storages.GrpcStorageProxy`
MEDIUMoptuna/_hypervolume/wfg.py104 # which is guaranteed. As mentioned earlier, if all ``False`` in on_front is correct, the
Redundant / Tautological Comments8 hits · 12 pts
SeverityFileLineSnippet
LOWtests/test_cli.py149 # Check if study_name is stored in the storage.
LOWtests/test_cli.py1016 # Check if study_name is stored in the storage.
LOWtests/storages_tests/rdb_tests/test_storage.py334 # Check if Study.optimize can run on new storage.
LOWtests/samplers_tests/test_base_gasampler.py109 assert len(mock_study.mock_calls) == 2 # Check if only the two calls above were made
LOWoptuna/testing/pytest_storages.py338 # Check if trial_number starts from 0.
LOWoptuna/testing/pytest_storages.py441 # Set params to another trial.
LOWoptuna/samplers/_partial_fixed.py101 # Check if a parameter value is contained in the range of this distribution.
LOWoptuna/samplers/_tpe/sampler.py904 weights_below = np.where(is_feasible, 1.0, EPS) # Assign EPS to infeasible trials.
Excessive Try-Catch Wrapping9 hits · 10 pts
SeverityFileLineSnippet
LOWtests/visualization_tests/test_utils.py52 except Exception:
MEDIUMtests/visualization_tests/test_utils.py47def _is_plotly_available() -> bool:
LOWoptuna/progress_bar.py28 except Exception:
LOWoptuna/artifacts/_backoff.py75 except Exception as e:
LOWoptuna/artifacts/_backoff.py90 except Exception as e:
LOWoptuna/artifacts/_backoff.py104 except Exception as e:
LOWoptuna/storages/journal/_storage.py597 except Exception:
LOWoptuna/storages/_rdb/storage.py99 except Exception:
LOWoptuna/study/_optimize.py225 except Exception:
Dead Code1 hit · 2 pts
SeverityFileLineSnippet
MEDIUMtests/study_tests/test_dataframe.py131