Assignment 2 - Decision Trees and Random Forests

Ask questions related to the assignment on this thread, submissions can be made on the link given above.

:zap: In this assignment, you’ll apply and practice the following concepts

  • Prepare a real-world dataset for training
  • Train decision tree and random forest
  • Tune hyperparameters and regularize

:ledger: Assignment Notebook

Use the starter notebook(s) to get started with the assignment. Read the problem statement, follow the instructions, add your solutions, and make a submission.


:computer: Join the Jovian Discord Server to interact with the course team, share resources and attend the study hours :point_right: Jovian Discord Server

1 Like

I am getting RMSE value as

Train RMSE: 0.0, Validation RMSE: 37802.872039112044

Can any tell me if it is correct or not

1 Like

There is a typo error : It is should be the below one,

print('Train RMSE: {}, Validation RMSE: {}'.format(rf2_train_rmse, rf2_val_rmse))
2 Likes

Yes this is correct, as you are not limiting any hyperparameter, the model is overfitting on the training data so you are getting 0 Train RMSE.

I’m getting this type error when I’m trying to find rsme for random forest:

*** Expected sequence or array-like, got <class ‘sklearn.ensemble._forest.RandomForestRegressor’>**

Please help?

Can you share snippets of your code?

Hi my fellow mates,
I am getting this attribute error. Can anyone please advise me on the correct steps to be taken?

I see that you have a typo with the method you are using here. It is misspelled. Go to the “methods” section of

https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html

Correct the spelling and try again. That should solve this AttributeError.

Assignment 2 has not been evaluated yet?

The evaluations take a week or two …

Is the RMSE score good or should I still tune the model.

1 Like

Assignment 2 of zero to GBMS has not been evaluated till now as i submitted a week ago ??
If it’s any problem in my notebook solution ??

Evaluations may take 2 weeks

@kutkin54
model.predict() is the correct way. Check your spelling. You’ve misspelled the word ‘predict’, You’ve written ‘predit’ where the letter ‘c’ is missing.
Your model is rf1, so it’d be 'rf1.predict()
.predict is the right attribute.

Now Its almost 3 weeks i submit my assignment and till date it is not evaluated.
Please somebody help me

@birajde
@hemanth

Please help this student

1 Like

I apologize for your inconvenience, your assignment will be evaluated by today.

I am getting error in:

QUESTION 3 : Visualize the decision tree (graphically and textually) and display feature importances as a graph. Limit the maximum depth of graphical visualization to 3 levels.

In assignment 2 of Machine Learning with Python: Zero to GBMs
Can any one tell me the error in my code.

Hey…
Can you send the picture of full error message as it is not clear from this image…
Moreover the code seems fine to me…So maybe try running the notebook from top to bottom and see if there is problem somewhere else…

This is complete error message…

Please see.

1 Like