We systematically investigated the effect of film-forming polyvinyl alcohol and crosslinkers, glyoxal and ammonium zirconium carbonate, on the optical and surface properties of films produced from TEMPO-oxidized cellulose nanofibers (TOCNFs). In this regard, UV-light transmittance, surface roughness and wetting behavior of the films were assessed. Optimization was carried out as a function of film composition following the "random forest" machine learning algorithm for regression analysis. As a result, the design of tailor-made TOCNF-based films can be achieved with reduced experimental expenditure. We envision this approach to be useful in facilitating adoption of TOCNF for the design of emerging flexible electronics, and related platforms.