On account of the high dimension and band overlapping features of the ultraviolet spectrum of complex wastewater, the relevance vector machine (RVM) algorithm combined with contiguous ultraviolet spectrum technology was applied in nitrate modeling to realize the rapid and accurate prediction of nitrate-nitrogen. At first the algorithm principle of RVM was introduced, and then based on the ultraviolet spectra of collected pharmacy effluent samples, ultraviolet absorption data between 230 and 245 nm were selected for modeling. Multivariate linear regression, partial least squares, classical support vector machines (SVM) and RVM methods were applied in nitrate modeling respectively and model performances were compared. Experimental result indicates that RVM method has advantages of higher prediction accuracy, sparser model than other compared methods and faster operation speed than SVM method. The relative full-range error is less than 4.5% F. S. Finally, it can be concluded that the LS-SVM method is effective in rapid and accurate detection of nitrate in practical wastewater with complicated composition.