diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-02-07 17:57:10 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-02-07 17:57:10 +0100 |
commit | c74ad5b4670d1490135ec5c376559287d9990764 (patch) | |
tree | 13951b93dbca30796619c02cf50bb618a5a4743d /lib/dfatool.py | |
parent | f88bfef03765e1c47b04e01864143717bed022dc (diff) |
WiP
Diffstat (limited to 'lib/dfatool.py')
-rwxr-xr-x | lib/dfatool.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py index b1ab69c..42adfc7 100755 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -244,12 +244,21 @@ def _xv_partitions_montecarlo(length, num_slices): pairs.append((training, validation)) return pairs -class CrossValidation: +class CrossValidator: - def __init__(self, em, num_partitions): - self._em = em - self._num_partitions = num_partitions - x = PTAModel.from_model(em.by_name, em._parameter_names) + def __init__(self, by_name, by_param, parameters): + """Create a new AnalyticModel and compute parameter statistics.""" + self.by_name = np.array(by_name) + self.by_param = np.array(by_param) + self.names = sorted(by_name.keys()) + self.parameters = sorted(parameters) + + def montecarlo(self, count = 200): + for pair in _xv_partitions_montecarlo(count): + by_name_training = dict() + by_name_validation = dict() + by_param_training = dict() + by_param_validation = dict() def _preprocess_measurement(measurement): |