def __call__(self, *args):
x_features = self.compose_input_data(args)<EOL>try:<EOL><INDENT>predictions = self.infer_method(x_features)<EOL><DEDENT>except TypeError or ValueError:<EOL><INDENT>if issparse(x_features):<EOL><INDENT>log.info("<STR_LIT>".format(self.model_class))<EOL>predictions = self.infer_method(x_features.todense())<EOL><DEDENT>else:<EOL><INDENT>log.info("<STR_LIT>".format(self.model_class))<EOL>predictions = self.infer_method(csr_matrix(x_features))<EOL><DEDENT><DEDENT>if isinstance(predictions, list):<EOL><INDENT>predictions_ = [[predictions[j][i][<NUM_LIT:1>] for j in range(len(predictions))] for i in range(x_features.shape[<NUM_LIT:0>])]<EOL>predictions = np.array(predictions_)<EOL><DEDENT>if self.ensure_list_output and len(predictions.shape) == <NUM_LIT:1>:<EOL><INDENT>predictions = predictions.reshape(-<NUM_LIT:1>, <NUM_LIT:1>)<EOL><DEDENT>if issparse(predictions):<EOL><INDENT>return predictions<EOL><DEDENT>else:<EOL><INDENT>return predictions.tolist()<EOL><DEDENT>
Infer on the given data according to given in the config infer method, \
    e.g. ``"predict", "predict_proba", "transform"``

Args:
    *args: list of inputs

Returns:
    predictions, e.g. list of labels, array of probability distribution, sparse array of vectorized samples