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

      Better than guessing the average?

      A model predicts a lemonade stand’s daily sales. Write fit_score(actual, predicted): one score for the predictions. 1 means perfect; 0 means no better than always guessing the average of actual. Misses are measured as squared errors, as in “How wrong is the forecast?”.

      A lemonade stand’s sales, Monday to Thursday, and a model’s forecast for each day. Every miss becomes a square on the model’s pile. Then the laziest forecaster, who just says the average every day, gets a pile too.

      A lemonade stand sold 2, 4, 6, 8 cups, Mon to Thu.2Mon4Tue6Wed8Thucups soldthe modellazy: 5the modelmisses, squared3always the average, 5misses, squared20score for the model, 0 = no better than lazy, 1 = perfect:?
      Your functionfit_score(actual, predicted)
      actualone number per daye.g. [3, 5, 9, 11]
      predictedone number per daye.g. [3, 5, 9, 11]
      returns1 for perfect, 0 for no better than always guessing the average
      solution.pyLoading Python
      Sign in for an AI hint
      ← Twenty jelly beansGrade a spam filter →