From 8944f785d5aa3ae6b5e6b2930000d8a1e68fbdc9 Mon Sep 17 00:00:00 2001 From: Kobi Felton Date: Sat, 11 May 2024 12:09:41 -0400 Subject: [PATCH] Fix LHS and random categorical bug commit-id:ac904df3 --- summit/strategies/random.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/summit/strategies/random.py b/summit/strategies/random.py index f03e7321..ef08d672 100644 --- a/summit/strategies/random.py +++ b/summit/strategies/random.py @@ -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): @@ -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 @@ -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