self.attr_index = data.domain.index(self.variable)
if isinstance(data, Instance):
return self.transform(np.array([float(data[self.attr_index])]))[0]
elif isinstance(data, Table):
return self.transform(data.get_column_view(self.attr_index)[0])
else:
raise TypeError("{} is not an Instance or a Table.".format(data))
def transform(self, c):
Return the transformed value of the argument `c`, which can be a number
After Change
data = np.array([float(data[self.attr_index])])
else:
data = data.get_column_view(self.attr_index)[0]
transformed = self.transform(data)
if inst and isinstance(transformed, np.ndarray):
transformed = transformed[0]
return transformed