Commit d22def42 authored by nsoler's avatar nsoler
Browse files

predictsign1

parent b73057aa
Pipeline #2366 failed with stages
in 1 minute and 57 seconds
......@@ -468,7 +468,7 @@ class ChemicalChecker():
from chemicalchecker.core.diagnostics import Diagnosis
return Diagnosis(self, sign, **kwargs)
def import_model(self,sign,version='2020_01'):
def import_models_for_prediction(self,sign,version='2020_01'):
"""
Nico: copy the models files we store in chemicalchecker.utils.models into sign.model_path
in order to use the predict functions
......@@ -477,12 +477,12 @@ class ChemicalChecker():
version (str) : ex: 2020_01
"""
sign2=sign
signObj=sign
if sign.molset != 'reference':
sign2= self.get_signature(sign.cctype, 'reference', sign.dataset)
signObj= self.get_signature(sign.cctype, 'reference', sign.dataset)
import_models(sign2, version=version)
import_models(signObj, version=version)
def import_h5(self):
......
......@@ -271,6 +271,22 @@ class Aspaces_prop_calculator(object):
def predictSign1(self):
# Import the prediction models for sign1
dictSpaces= self.cc.report_available()
if "reference" in dictSpaces:
dictSpaces=dictSpaces['reference']
self.cc.import_models_for_prediction(sign1) # Import models A1 to A5
else:
print("No sign0 available in your cc repo")
return
for space in dictSpaces.keys():
if space in ('A1', 'A2', 'A3', 'A4', 'A5'):
sign1 = self.cc.get_signature('sign1', 'full',space) # will get converted to reference by the next fct
sign0= self.cc.get_signature('sign0', 'full',space)
print("\nPredicting sign1 for space",space)
sign1.predict(sign0)
return self.cc
def predictSign2(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment