I am used to calculating the time complexity of algorithms and data structures to understand how my code will perform in a production environment. However, when using machine learning (ML) and AI-based solutions, it becomes challenging to determine the asymptotic time complexity because the instructions are not explicitly written by me but instead learned from data. These learned models are often treated as a "black box," making it harder to analyze their computational requirements.
I want to focus specifically on the time complexity for prediction (inference), not training. For instance:
- How can I determine the prediction time complexity of models such as k-Nearest Neighbors (k-NN)?
- How can I evaluate the prediction time complexity for binary classification models based on deep learning (e.g., a simple feedforward neural network)?
Any detailed explanation or references to methodologies for analyzing the time complexity of ML models during prediction would be greatly appreciated.