def min_max_scaler(img_ndarray, final_range=(0, 1)):
    """
    Scale and transform feature values to given range.

    Parameters
    ----------
    img_ndarray: 2D numpy ndarray, shape=(28, 28)
        Image to scale and transform
    final_range: tuple (min, max), default=(0, 1)
        Desired range of transformed data
    Returns
    -------
    Scaled and transformed image as 2D numpy ndarray
    """
    px_min = final_range[0]
    px_max = final_range[1]

    # Hard code pixel value range
    img_std = img_ndarray / 255
    return img_std * (px_max - px_min) + px_min