Algorithm · Goldman Sachs · Medium
You receive a partially implemented code skeleton and need to fill in the missing functions with correct, reasonably efficient logic. Part A — Binary decision-tree split Implement two functions for a binary decision tree classifier operating on numeric tabular data. gini(y) returns the Gini impurity of a label vector y, where every entry is either 0 or 1. best_split(X, y) returns the best split as (feature_index, threshold). X is an n x d numeric feature matrix. y is a…
Checking your access…