Machine learning techniques have been proposed in the literature for the modeling of photonic devices. These techniques can be used to speed up the design process. The data samples needed to build machine learning models are collected from electromagnetic simulations. Electromagnetic solvers can result computationally expensive and therefore minimizing the computational effort needed to collect these data samples is an important aspect. Using frequency-domain electromagnetic solvers to collect data samples requires a suitable sampling of the wavelength variable to avoid undersampling and oversampling phenomena. An adaptive frequency-domain sampling approach for nanophotonic applications is illustrated in this work.