Machine learning code PSD