1672b5a9a47b081aa3e61c9f2ca76fae26ed8730,cheml/wrappers/cheml_cml/cheml_wrapper.py,DistanceMatrix,fit,#DistanceMatrix#,221
Before Change
def fit(self):
from cheml.chem import DistanceMatrix
// check inputs
if isinstance(self.legal_inputs["df"], type(None)):
msg = "@Task //%i(%s): input data frame is required"%(self.iblock,self.SuperFunction)
raise IOError(msg)
try:
model = DistanceMatrix(**self.parameters)
except Exception as err:
msg = "@Task //%i(%s): " % (self.iblock + 1, self.SuperFunction) + type(err).__name__ + ": " + err.message
raise TypeError(msg)
order = [edge[1] for edge in self.Base.graph if edge[0] == self.iblock]
for token in set(order):
if token == "df":
val = pd.DataFrame(model.transform(self.legal_inputs["df"][0].values))
self.Base.send[(self.iblock, token)] = [val, order.count(token)]
else:
msg = "@Task //%i(%s): asked to send a non valid output token "%s"" % (
self.iblock + 1, self.SuperFunction, token)
After Change
if token not in self.outputs:
msg = "@Task //%i(%s): not a valid output token "%s"" % (self.iblock + 1, self.Task, token)
raise NameError(msg)
elif token == "df":
ar = self.inputs["df"].value
df = pd.DataFrame(model.transform(ar))
self.set_value(token, df)
self.outputs[token].count = order.count(token)
self.Base.send[(self.iblock, token)] = self.outputs[token]
del self.inputs
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: hachmannlab/chemml
Commit Name: 1672b5a9a47b081aa3e61c9f2ca76fae26ed8730
Time: 2017-11-12
Author: mojtabah@buffalo.edu
File Name: cheml/wrappers/cheml_cml/cheml_wrapper.py
Class Name: DistanceMatrix
Method Name: fit
Project Name: hachmannlab/chemml
Commit Name: 1672b5a9a47b081aa3e61c9f2ca76fae26ed8730
Time: 2017-11-12
Author: mojtabah@buffalo.edu
File Name: cheml/wrappers/cheml_cml/cheml_wrapper.py
Class Name: RDKitFingerprint
Method Name: fit
Project Name: keras-team/keras
Commit Name: 365f621b24631a03f995e3b30e1800d327e42fc1
Time: 2017-04-24
Author: joshuarchin@gmail.com
File Name: keras/layers/recurrent.py
Class Name: Recurrent
Method Name: reset_states