def sign_error_inv(prediction, nc, significance, norm=None, beta=None):
	norm = np.array([1] * prediction.shape[0]) if norm is None else norm
	beta = 0 if beta is None else beta

	nc = np.sort(nc)[::-1]
	upper = int(np.floor((significance / 2) * (nc.size + 1)))
	lower = int(np.floor((1 - significance / 2) * (nc.size + 1)))
	# TODO: should probably warn against too few calibration examples
	upper = min(max(upper, 0), nc.size - 1)
	lower = max(min(lower, nc.size - 1), 0)
	return np.vstack([prediction + (nc[lower] * (norm + beta)),
	                  prediction + (nc[upper] * (norm + beta))]).T


# -----------------------------------------------------------------------------
# Base nonconformity scorer
# -----------------------------------------------------------------------------
Calculates a prediction from a signed-error nonconformity function.
dataset/ETHPy150Open donlnz/nonconformist/nonconformist/nc.py/sign_error_inv