We present results on a data-driven framework for the optimal regulation of nonlinear systems. The framework relies on linear operator theoretical approach for the data-driven modeling and control of a nonlinear system. We discover sample complexity results for the identification of nonlinear control system. The linear nature of the framework is exploited to show that the approximation error for the bilinear representation of control dynamical system in the function space decreases as v1T of the data length T . Explicit error bounds provided by sample complexity results are utilized to provide a robust optimization-based formulation for the optimal regulation of nonlinear system in Koopman eigenfunction coordinates. The results will help understand minimum data requirement that balances the trade-offs between detailed modeling and fidelity of model necessary for control.