Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type checking of input data #40

Open
TobyBoyne opened this issue Jul 2, 2024 · 1 comment
Open

Type checking of input data #40

TobyBoyne opened this issue Jul 2, 2024 · 1 comment

Comments

@TobyBoyne
Copy link
Collaborator

Input data, X, is either a list object or an ndarray object. We should ensure that the handling of these objects is consistent and predictable. For example, the type hint below: encode expects a list, but we type hint this as an ndarray.

def fit(self, X: np.ndarray, y: np.ndarray) -> None:
"""
Performs the training of you tree model using training data and labels
"""
# encode categorical features
X = self._problem_config.encode(X)

@TobyBoyne
Copy link
Collaborator Author

Similarly, the encode/decode methods return an empty list if the data is empty, otherwise an ndarray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant