apps script prediction functions