class_docstr: Test hyper-parameter optimization.
class_docstr_tok: ["Test","hyper-parameter","optimization","."]
docstr: Test making a study that has a specified model hyper-parameter.
code: def test_specified_model_hyperparameter(self):
      """Test making a study that has a specified model hyper-parameter."""
      target_embedding_dim = 50
      hpo_pipeline_result = hpo_pipeline(
          dataset="nations",
          model="TransE",
          model_kwargs=dict(embedding_dim=target_embedding_dim),
          training_kwargs=dict(num_epochs=5, use_tqdm=False),
          n_trials=2,
      )
      df = hpo_pipeline_result.study.trials_dataframe(multi_index=True)
      # Check a model param is NOT optimized
      self.assertNotIn(("params", "model.embedding_dim"), df.columns)
      # Check a loss param is optimized
      self.assertIn(("params", "loss.margin"), df.columns)
  
imports: import inspect
  import tempfile
  import unittest
  from typing import Collection, Type
  from unittest.mock import MagicMock, patch
  import optuna
  import pytest
  from class_resolver import get_subclasses
  from optuna.trial import TrialState
  from torch.optim import Adam
  from pykeen.datasets.nations import NATIONS_TEST_PATH, NATIONS_TRAIN_PATH, NATIONS_VALIDATE_PATH, Nations, NationsLiteral
  from pykeen.evaluation import RankBasedEvaluator
  from pykeen.hpo import hpo_pipeline
  from pykeen.hpo.hpo import ExtraKeysError, Objective, suggest_kwargs
  from pykeen.losses import Loss, MarginRankingLoss
  from pykeen.models import ERModel, FixedModel, InductiveERModel, LiteralModel, MarginalDistributionBaseline, Model, SoftInverseTripleBaseline
  from pykeen.regularizers import Regularizer
  from pykeen.sampling import NegativeSampler
  from pykeen.stoppers.stopper import NopStopper
  from pykeen.trackers import ResultTracker, tracker_resolver
  from pykeen.trackers.base import PythonResultTracker
  from pykeen.training import LCWATrainingLoop, TrainingLoop
  from pykeen.triples import TriplesFactory
label_desc: Use image node_id 3 for calling the TestHyperparameterOptimization obj's underlying member method code with example usage: obj.test_specified_model_hyperparameter() without return types