Skip to content

Commit

Permalink
Fix LHS and random categorical bug
Browse files Browse the repository at this point in the history
commit-id:ac904df3
  • Loading branch information
marcosfelt committed May 11, 2024
1 parent 8313588 commit 8944f78
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions summit/strategies/random.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from .base import Strategy, Design, Transform
from summit.domain import *
from summit.utils.dataset import DataSet
from typing import Tuple

import numpy as np
import pandas as pd
from typing import Tuple

from summit.domain import *
from summit.utils.dataset import DataSet

from .base import Design, Strategy, Transform


class Random(Strategy):
Expand Down Expand Up @@ -170,11 +173,9 @@ def __init__(
domain: Domain,
transform: Transform = None,
random_state: np.random.RandomState = None,
categorical_method: str = None,
):
super().__init__(domain, transform)
self._rstate = random_state if random_state else np.random.RandomState()
self.categorical_method = categorical_method

def suggest_experiments(
self, num_experiments, criterion="center", exclude=[], **kwargs
Expand Down Expand Up @@ -283,9 +284,7 @@ def suggest_experiments(
# design.add_variable(variable.name, values, indices=indices)
design = DataSet.from_df(design)
design[("strategy", "METADATA")] = "LHS"
return self.transform.un_transform(
design, categorical_method=self.categorical_method
)
return self.transform.un_transform(design, categorical_method=None)

def reset(self):
pass
Expand Down

0 comments on commit 8944f78

Please sign in to comment.