During natural evolution, viral proteins can mutate to gain new properties that help them survive within and spread to different hosts. Owing to the massive surveillance data on viral sequences that cause infectious diseases, we can learn from natural selection by mapping viral genomic sequences to protein functions using machine learning. Using influenza virus as an example, I demonstrated a novel machine learning classifier capable of predicting key viral protein functions, trained solely on naturally occurring (positive-only) influenza sequences. The accuracy of this model was first verified using site-directed mutagenesis data from the literature and it achieved superior performance compared to state-of-the-art approaches from the one-class classification (OCC) and positive-unlabeled (PU) learning literature. I further demonstrated experimentally that de novo protein sequences predicted by the our model exhibited influenza viral functions of interests. By integrating machine learning with domain-specific biochemistry knowledge of protein evolution, our work shows great promise in predicting viral variants of concern for disease surveillance and in assisting protein design for disease prevention and therapeutics.