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
      74 of 130

      Fix the last one’s mistakes

      A team of tiny models guesses the prices of eight houses. Each is a stump: one split by size, one guess on each side, the average of whatever it is told to learn there. Each round a new stump learns a target and is added to the team. Write next_target(prices, team_prediction): what the next stump should learn, one number per house, so that every round brings the team closer to the prices.

      Eight houses by size, each price a bold tick, and a team of stumps whose guesses are the bars. Round 1: a stump learns the prices, one guess each side of a split, and becomes the team. If the next stump learns the prices too, the team doubles, then triples. The goal is a team that gets closer every round, like the bars it ends on. Your next_target() says what each new stump learns.

      Eight houses, smallest first. The bold ticks are what each one sold for.the team’s guesses$0$100k$200k$300k$400k50m²65m²80m²95m²110m²130m²150m²175m²each round: what the new stump learnsoff by, each round0123456round$304k
      Your functionnext_target(prices, team_prediction)
      priceswhat each house sold for, in $1000s, smallest house first (a numpy array)e.g. [150, 210, 190, 260, 330, 300, 410, 450]
      team_predictionwhat the team so far guesses for each house (a numpy array; all 0 before round 1)e.g. [0, 0, 0, 0, 0, 0, 0, 0]
      returnswhat the next stump should learn: one number per house
      solution.pyLoading Python
      Sign in for an AI hint
      ← Ask 25 bad judgesHow wrong is the forecast? →