Move external keyword arguments to a dedicated field in config file
We discussed this topic during 2022-06-07 weekly.
Currently, the keyword arguments to be passed to scikit learn are at the same level as other iota2 parameters (ex in documentation: https://docs.iota2.net/develop/use_scikit_learn.html#scikit-learn-parameters-table).
This is confusing and leads to the warning message "unknown parameter *** unable to check type".
In the code, this is currently managed by removing the known parameters
self.sk_model_name = self.sk_model_parameters['model_type']
del self.sk_model_parameters['model_type']
del self.sk_model_parameters['standardization']
del self.sk_model_parameters['cross_validation_grouped']
del self.sk_model_parameters['cross_validation_folds']
del self.sk_model_parameters['cross_validation_parameters']
in order to pass the remaining as keyword arguments:
task_params = {
'f': learn_scikitlearn_model,
"samples_file": vector_file,
"output_model": output_model,
"data_field": self.data_field,
"sk_model_name": self.sk_model_name,
"apply_standardization": self.apply_standardization,
"cross_valid_params": self.cross_valid_params,
"cross_val_grouped": self.cross_val_grouped,
"folds_number": self.folds_number,
"available_ram": self.available_ram,
"sk_model_params": self.sk_model_parameters # <--- here
}
I suggest that we move these kind of parameters to a specific field on which Iota2 performs no check since they will be managed by scikit learn model / pytorch model...
Edited by Hugo Trentesaux