fixed prediction functions and added derived metrics function