0 votes
in Python Flask by
Build a random forest model from scratch.

1 Answer

0 votes
by

The model should have these conditions:

The model takes as input a dataframe df and an array new_point with a length equal to the number of fields in the df.

All values of both df and new_point are 0 or 1, i.e., all fields are dummy variables, and there are only two classes.

Rather than randomly deciding what subspace of the data each tree in the forest will use like usual, make your forest out of decision trees that go through every permutation of the value columns of the data frame and split the data according to the value seen in new_point for that column.

Return the majority vote on the class of new_point.

You may use pandas and NumPy but NOT scikit-learn.

Related questions

0 votes
asked Mar 20 in Cassandra by rajeshsharma
+1 vote
asked Apr 3, 2023 in QuickBase by Robin
...