Exact Analysis Of Inverse Problems In High Dimensions With Applications To Machine Learning