Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      43 of 102

      Score a forecaster

      A weather forecaster gives a chance of rain every day. Write penalty(chance): the forecaster gave chance to what actually happened; how much do they lose? 0 means nothing to lose; bigger means a worse forecast.

      Every day a forecaster gives rain a chance. On Monday they said 70%, on Tuesday only 20%, and it rained both days. Your function says how much each forecast loses.

      Monrain 70%it rainedthey lose?

      how much should Tuesday’s 20% cost? that’s for you to decide

      Your functionpenalty(chance)
      chancewhat the forecaster gave to what actually happened (0 to 1)e.g. 1
      returnshow much they lose (0 = perfect)
      solution.pyLoading Python
      Sign in for an AI hint
      ← Planning for the wrong worldToo small to store →