RubixML / ML

A high-level machine learning and deep learning library for the PHP language.
https://rubixml.com
MIT License
2.03k stars 182 forks source link

Don't check for donors when fitting MissingDataImputer (use the strategy to check) #338

Closed 27pchrisl closed 3 months ago

27pchrisl commented 4 months ago

Hi,

During the fit stage of MissingDataImputer, it checks if there are donors: "Dataset must contain at least 1 donor per feature column.".

This is true for every strategy except the Constant strategy, where you don't need donors. I checked, and every other strategy does its own check, throwing the right Exception if the provided array is empty.

This PR removes the check within MissingDataImputer so it's possible to use the Constant strategy with a dataset that has no donors.

andrewdalpino commented 3 months ago

Looks good to me, thank you for the great work @27pchrisl!