StackGP 0.0.11__tar.gz → 0.0.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stackgp-0.0.11 → stackgp-0.0.13}/PKG-INFO +1 -1
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP/StackGP.py +18 -5
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP.egg-info/PKG-INFO +1 -1
- {stackgp-0.0.11 → stackgp-0.0.13}/pyproject.toml +1 -1
- {stackgp-0.0.11 → stackgp-0.0.13}/LICENSE +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/README.md +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP/__init__.py +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP.egg-info/SOURCES.txt +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP.egg-info/dependency_links.txt +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP.egg-info/requires.txt +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/StackGP.egg-info/top_level.txt +0 -0
- {stackgp-0.0.11 → stackgp-0.0.13}/setup.cfg +0 -0
|
@@ -576,16 +576,18 @@ removeIndeterminateModels.__doc__ = "removeIndeterminateModels(models) removes m
|
|
|
576
576
|
def sortModels(models):
|
|
577
577
|
return sorted(models, key=lambda m:m[2])
|
|
578
578
|
sortModels.__doc__ = "sortModels(models) sorts a model population by the models' accuracies"
|
|
579
|
-
def selectModels(models, selectionSize=0.5):
|
|
579
|
+
def selectModels(models, selectionSize=0.5, thresholds=None):
|
|
580
580
|
tMods=copy.deepcopy(models)
|
|
581
581
|
[modelToListForm(mod) for mod in tMods]
|
|
582
|
+
if thresholds is not None:
|
|
583
|
+
tMods=[mod for mod in tMods if all([mod[2][i]<=thresholds[i] for i in range(len(thresholds))])]
|
|
582
584
|
paretoModels=[]
|
|
583
585
|
if selectionSize<=1:
|
|
584
586
|
selection=selectionSize*len(models)
|
|
585
587
|
else:
|
|
586
588
|
selection=selectionSize
|
|
587
589
|
|
|
588
|
-
while len(paretoModels)<selection:
|
|
590
|
+
while len(paretoModels)<selection and len(tMods)>0:
|
|
589
591
|
front=paretoTournament(tMods)
|
|
590
592
|
paretoModels=paretoModels+front
|
|
591
593
|
for i in front:
|
|
@@ -812,8 +814,19 @@ def uncertainty(data,trim=0.3):
|
|
|
812
814
|
return h
|
|
813
815
|
else:
|
|
814
816
|
return 0
|
|
815
|
-
|
|
817
|
+
|
|
816
818
|
def evaluateModelEnsemble(ensemble, inputData):
|
|
819
|
+
responses=[evaluateGPModel(mod, inputData) for mod in ensemble]
|
|
820
|
+
if type(responses[0])==np.ndarray:
|
|
821
|
+
responses=np.transpose(responses)
|
|
822
|
+
predictions=[np.median(res) for res in responses]
|
|
823
|
+
else:
|
|
824
|
+
|
|
825
|
+
predictions=[np.median(responses)]
|
|
826
|
+
|
|
827
|
+
return predictions
|
|
828
|
+
|
|
829
|
+
def evaluateModelEnsembleUncertainty(ensemble, inputData):
|
|
817
830
|
responses=[evaluateGPModel(mod, inputData) for mod in ensemble]
|
|
818
831
|
if type(responses[0])==np.ndarray:
|
|
819
832
|
responses=np.transpose(responses)
|
|
@@ -821,10 +834,10 @@ def evaluateModelEnsemble(ensemble, inputData):
|
|
|
821
834
|
else:
|
|
822
835
|
|
|
823
836
|
uncertainties=[uncertainty(responses,0)]
|
|
824
|
-
|
|
825
837
|
return uncertainties
|
|
838
|
+
|
|
826
839
|
def relativeEnsembleUncertainty(ensemble,inputData):
|
|
827
|
-
output=
|
|
840
|
+
output=evaluateModelEnsembleUncertainty(ensemble,inputData)
|
|
828
841
|
return np.array(output)
|
|
829
842
|
|
|
830
843
|
def createUncertaintyFunc(ensemble):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|