SEBASTIAN MANTEY
  • Home
  • Theory
  • Code
  • Blog

Coding a Random Forest from Scratch (Python) p.3 - Creating the Forest and making Predictions

2/17/2020

2 Comments

 

This post is part of a series:
  • Part 1: Introduction
  • Part 2: Bootstrapping and Random Subspace Method
  • Part 3: Creating the Forest and making Predictions
Links:
  • GitHub repo
  • Random Forest Algorithm explained

2 Comments
Fiona Luhrmann
12/1/2021 08:22:09 pm

There seems to be a bug in the code on the keys returned? It throws the error:

<ipython-input-4-2ade2396697d> in predict_example(example, tree)
216 def predict_example(example, tree):
217 question = list(tree.keys())[0]
--> 218 feature_name, comparison_operator, value = question.split(" ")
219
220 # ask question

ValueError: too many values to unpack (expected 3)

Reply
Fiona Luhrmann
12/1/2021 09:19:36 pm

Using the mushroom data set

Reply



Leave a Reply.

    Author

    Just someone trying to code some projects

    Archives

    November 2020
    March 2020
    February 2020
    January 2020

    Categories

    All
    Data Analysis
    ML From Scratch

    RSS Feed

Picture
  • Home
  • Theory
  • Code
  • Blog