Skip to content

Instantly share code, notes, and snippets.

@eugeneyan
Created February 21, 2021 19:05
Show Gist options
  • Save eugeneyan/89aef2bcac45def376daabc3cfe48cd2 to your computer and use it in GitHub Desktop.
Save eugeneyan/89aef2bcac45def376daabc3cfe48cd2 to your computer and use it in GitHub Desktop.
Test output
def test_dt_output_shape(dummy_titanic):
X_train, y_train, X_test, y_test = dummy_titanic
dt = DecisionTree()
dt.fit(X_train, y_train)
pred_train = dt.predict(X_train)
pred_test = dt.predict(X_test)
assert pred_train.shape == (X_train.shape[0],), 'DecisionTree output should be same as training labels.'
assert pred_test.shape == (X_test.shape[0],), 'DecisionTree output should be same as testing labels.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment