-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExpDesign: Add LHS space-filling algorithm
Also add parameters for random. Example: --exp-design lhs(42,100) Will sample 100 points using maxmin design, and the seed 42 Very usefull to quickly get the influence of the factors
- Loading branch information
Showing
5 changed files
with
54 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from random import shuffle | ||
|
||
import random | ||
from npf.expdesign.fullexp import FullVariableExpander | ||
|
||
|
||
class RandomVariableExpander(FullVariableExpander): | ||
"""Same as BruteVariableExpander but shuffle the series to test""" | ||
|
||
def __init__(self, vlist, overriden): | ||
def __init__(self, vlist, overriden, seed, n_iter): | ||
super().__init__(vlist, overriden) | ||
shuffle(self.expanded) | ||
|
||
random.seed(seed) | ||
random.shuffle(self.expanded) | ||
if n_iter > 0: | ||
self.expanded = self.expanded[:n_iter] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters