1

scikit-learn: Random Forest Regression

Unsolved
Supervised

Difficulty: 2 | Problem written by zeyad_omar

Educational Resource: https://towardsdatascience.com/a-beginners-guide-to-scikit-learn-14b7e51d71a4


Problem reported in interviews at

Amazon
Apple
Facebook
Google
Netflix

Random Forest Regresion is a supervised learning technique that is used to predict continous values similar to other regression techniques. Random Forest Regression often results in higher accuracy in some cases (based on the dataset).

In this problem, you are required to use sklearn to implement a Random Forest Regressor that predicts the the model outputs of X_test after training on X_train and Y_train.
 

 

Sample Input:
<class 'list'>
X_train: [[0, 0], [1, 1]]
<class 'list'>
Y_train: [0, 1]
<class 'list'>
X_test: [[2, 2]]

Expected Output:
<class 'numpy.ndarray'>
[0.78]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Delectus aspernatur architecto, doloribus harum a aut amet aperiam iste totam sint quidem dolore dolor? Sit minus odit velit ullam quidem corrupti. Animi pariatur quasi fugit quas sed a, dignissimos dolor vero et officiis quidem fugiat nobis, tempora libero molestias earum amet? Nihil adipisci dignissimos temporibus cupiditate tempora magnam at, laboriosam mollitia tempore aperiam maxime.

Aliquam quo qui quaerat at culpa tempore, eveniet obcaecati vitae explicabo sed expedita, sequi libero ea excepturi maiores repellat fugiat repellendus error, odio distinctio ab natus perspiciatis id pariatur voluptas tenetur fugit quaerat quibusdam. Laborum ex cumque ratione facilis perspiciatis cupiditate labore totam, quod praesentium exercitationem atque vero porro mollitia, dolore necessitatibus ipsum qui nihil inventore fuga aliquam ipsam debitis, qui maxime itaque quae facere totam nobis dolorum excepturi.

Vel nobis saepe, corporis omnis accusamus cumque aut eius, corrupti omnis ducimus nobis vel adipisci. Recusandae cumque perferendis hic explicabo officiis temporibus eum molestias totam, quasi placeat sapiente, nostrum possimus dolores dicta quae placeat consectetur recusandae quas, voluptates id illo molestiae quo vel aut adipisci quia, dolore animi nemo explicabo cum modi laudantium obcaecati voluptatum quia magnam fuga. Iste ipsum inventore nihil ab obcaecati perspiciatis quae, laborum voluptatibus debitis a facilis dolore animi, voluptas doloribus vitae laboriosam adipisci dolore nam maiores fugiat reiciendis temporibus.

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)