Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LHS and random categorical bug #268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading