A method for evaluating a hydrocarbon so as to determine a desired parameter of the hydrocarbon includes the steps of providing a hydrocarbon to be evaluated, obtaining a near-infrared signal from the hydrocarbon, codifying the near-infrared signal so as to reduce the signal to a number of points, providing a neural network trained for correlating the number of points to the desired parameter and processing the number of points with the neural network so as to determine the desired parameter.