A unified framework is proposed for approximating transfer operators in machine learning research.The framework leverages Monte Carlo sampling to approximate the operator on a finite-dimensional space.Convergence of the approximating operator and its spectrum is proven under non-restrictive conditions.The study also establishes the convergence relationship between continuous optimization and its discrete counterpart.