Many machine learning applications in bioinformatics currently rely on gene identities extracted from input gene signatures, and fail to take advantage of preexisting knowledge about gene functions. We developed the Functional Representation of Gene Signatures (FRoGS) approach by training a deep learning model. FRoGS represents gene signatures projected onto their biological functions, instead of their identities, similar to how the word2vec technique works in natural language processing. We demonstrated that its application to L1000 datasets resulted in more effective compound-target predictions than models based on gene identities alone. Through further integration of additional pharmacological activity data sources, FRoGS significantly contributed to a large number of high-quality compound-target predictions, which were supported by in silico and/or experimental evidence. These results underscore the general utility of FRoGS in machine learning-based bioinformatics applications. Prediction networks pre-equipped with the knowledge of gene functions may help more readily uncover relationships among gene signatures acquired by large-scale OMICs studies on compounds, cell types, disease models, and patient cohorts.