def get_refs(self, base_model, datapoints, scaler=None, conv_1d=False, conv_2d=False, cache_data=True):
    try:
        if (not cache_data):
            raise DontCacheRef()
        return (self.__datapoints, self.__refs)
    except (DontCacheRef, AttributeError) as e:
        if (conv_1d and conv_2d):
            print('ERROR: conv_1d and conv_2d are mutually exclusive')
            return None
        refs = []
        flattened = []
        for point in datapoints:
            spoint = point
            if (scaler and (not conv_2d)):
                spoint = scaler.transform([point])
            prob = 0.0
            if conv_1d:
                prob = base_model.predict_proba(np.expand_dims(np.expand_dims(spoint, axis=2), axis=0))[0][0]
            elif conv_2d:
                prob = base_model.predict_proba(np.expand_dims(spoint, axis=0))
            else:
                prob = base_model.predict_proba(spoint.reshape(1, (- 1)))[0][0]
            refs.append(prob)
            flattened.append(spoint.flatten().tolist())
        self.__datapoints = np.asarray(flattened)
        self.__refs = np.asarray(refs)
        return (self.__datapoints, self.__refs)
def get_refs(self, base_model, datapoints, scaler=None, conv_1d=False, conv_2d=False, cache_data=True):
    try:
        if (not cache_data):
            raise DontCacheRef()
        return (self.__datapoints, self.__refs)
    except (DontCacheRef, AttributeError) as e:
        if (conv_1d and conv_2d):
            print('ERROR: conv_1d and conv_2d are mutually exclusive')
            return None
        refs = []
        flattened = []
        for point in datapoints:
            spoint = point
            if (scaler and (not conv_2d)):
                spoint = scaler.transform([point])
            prob = 0.0
            if conv_1d:
                prob = base_model.predict_proba(np.expand_dims(np.expand_dims(spoint, axis=2), axis=0))[0][0]
            elif conv_2d:
                prob = base_model.predict_proba(np.expand_dims(spoint, axis=0))
            else:
                prob = base_model.predict_proba(spoint.reshape(1, (- 1)))[0][0]
            refs.append(prob)
            flattened.append(spoint.flatten().tolist())
        self.__datapoints = np.asarray(flattened)
        self.__refs = np.asarray(refs)
        return (self.__datapoints, self.__refs)