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
      53 of 102

      How wrong is the forecast?

      Write wrongness(forecast, actual): one number for how wrong a temperature forecast was. 0 means perfect; bigger means more wrong.

      A four-day temperature forecast against what really happened. Some days it ran hot, some cold, one was spot on. Your function scores how wrong it was overall.

      forecast against actual, Mon to Thuactualforecastmiss16°22°27°Mon20°Tue20°Wed21°Thu24°wrongness?
      Your functionwrongness(forecast, actual)
      forecasttemperatures, one per daye.g. [20, 22, 19]
      actualtemperatures, one per daye.g. [20, 22, 19]
      returnshow wrong the forecast was (0 = perfect)
      solution.pyLoading Python
      Sign in for an AI hint
      ← At least one rightWalk downhill →