Does anyone know why scikit-learn is (pervasively) designed to raise exceptions whenever anything is a little unusual in a way that could maybe cause problems down the line, even if it’s not causing problems now?
Like, it has all these checks for things like whether data has the right type(s), or the right number or dimensions, or the right range of values in it, or whatever – where “right” usually means “necessary for doing something that is commonly done with this value at some point.” But instead of applying these checks only when it’s about to do something that requires those properties, it applies them continually, again and again, inside every tiny moving part, even parts that have no reason of their own to care about the properties. And instead of raising warnings, it raises exceptions, i.e. it just stops and refuses to continue.
This requires some pretty ridiculous workarounds if you want to do a lot of things that would be straightforward in other big Python libraries or just Python itself. Is there some secret good reason it’s built this way?
