Package: neuro-mf
neuro-ml is a open source library designed to avoid writing duplicate code.You can use new model of scikit learn without writing any code.
Model training can be control by configuration file.neuro_mf.ModelFactoryclass neuro_mf.ModelFactory(model_config_path:str)sourceParameters:model_config_path: location of model.yaml file

How to generate configuration file
It is very simple.
We will export sample model config file in config directory
You can use below python to export sample configuration file.

```python
from neuro_mf.config import get_sample_model_config_yaml_file

if __name__ == "__main__":
    export_file_path=get_sample_model_config_yaml_file(export_dir="config")Check your config folder
You will find a file name as "model.yaml"content of model.yamlgrid_search:class:GridSearchCVmodule:sklearn.model_selectionparams:cv:3verbose:1model_selection:module_0:class:ModelClassNamemodule:module_of_modelparams:param_name1:value1param_name2:value2search_param_grid:param_name:-param_value_1-param_value_2Now update the content of model.yaml file with below content for testing.grid_search:
  class: GridSearchCV
  module: sklearn.model_selection
  params:
    cv: 3
    verbose: 1
model_selection:
  module_0:
    class: RandomForestRegressor
    module: sklearn.ensemble
    params:
      n_estimators: 200
      criterion: squared_error
    search_param_grid:
      n_estimators:
      - 150
      - 200
      - 250
      max_depth:
      - 2
      - 5
      - 6
  module_1:
    class: SVR
    module: sklearn.svm
    params:
      kernel: rbf
    search_param_grid:
      kernel:
      - poly
      - rbfAttributes:config: dict  model.yaml file will be available as dict in this attributegrid_search_cv_module: str  Module of grid search cv from sklearn lib sklearn.model_selectiongrid_search_class_name: strgrid_search_property_data:dictmodels_initialization_config: dictinitialized_model_list: All model instance will be available in this attribute once get_initialized_model_list has been invoked on model factory objectgrid_searched_best_model_list Once grid search has been done for all model then every model with their tuned paramter will be available in this attributeFew of the function return type can be inferred using
below named tupleInitializedModelDetail = namedtuple("InitializedModelDetail",
                                    ["model_serial_number", "model", "param_grid_search", "model_name"])

GridSearchedBestModel = namedtuple("GridSearchedBestModel", ["model_serial_number",
                                                             "model",
                                                             "best_model",
                                                             "best_parameters",
                                                             "best_score",
                                                             ])

BestModel = namedtuple("BestModel", ["model_serial_number",
                                     "model",
                                     "best_model",
                                     "best_parameters",
                                     "best_score", ])Methods:class_for_name(module_name, class_name)execute_grid_search_operation(self, initialized_model: InitializedModelDetail, input_feature,
                                      output_feature)get_best_model(self, X, y, base_accuracy=0.6) -> BestModelget_best_model_from_grid_searched_best_model_list(grid_searched_best_model_list: List[GridSearchedBestModel],
                                                          base_accuracy=0.6
                                                          ) -> BestModelget_initialized_model_list(self) -> List[InitializedModelDetail]initiate_best_parameter_search_for_initialized_model(self, initialized_model: InitializedModelDetail,
                                                             input_feature,
                                                             output_feature) -> GridSearchedBestModelinitiate_best_parameter_search_for_initialized_models(self,
                                                              initialized_model_list: List[InitializedModelDetail],
                                                              input_feature,
                                                              output_feature) -> List[GridSearchedBestModel]read_paramsupdate_property_of_classHow to generate configuration file
It is very simple.
We will export sample model config file in config directory
You can use below python to export sample configuration file.fromneuro_mf.configimportget_sample_model_config_yaml_fileif__name__=="__main__":export_file_path=get_sample_model_config_yaml_file(export_dir="config")Check your config folder
You will find a file name as "model.yaml"content of model.yamlgrid_search:class:GridSearchCVmodule:sklearn.model_selectionparams:cv:3verbose:1model_selection:module_0:class:ModelClassNamemodule:module_of_modelparams:param_name1:value1param_name2:value2search_param_grid:param_name:-param_value_1-param_value_2Now update the content of model.yaml file with below content for testing.grid_search:class:GridSearchCVmodule:sklearn.model_selectionparams:cv:3verbose:1model_selection:module_0:class:RandomForestRegressormodule:sklearn.ensembleparams:n_estimators:200criterion:squared_errorsearch_param_grid:n_estimators:-150-200-250max_depth:-2-5-6module_1:class:SVRmodule:sklearn.svmparams:kernel:rbfsearch_param_grid:kernel:-poly-rbfAbove configuration file contains information about two model Random Forest and Support Vectorget_best_model_function will return best model after comparisonNow Let's try to train a RandomForestRegressorimportosfromneuro_mf.configimportget_sample_model_config_yaml_filefromneuro_mfimportModelFactoryif__name__=="__main__":# export_dir=get_sample_model_config_yaml_file(export_dir="config")export_file_path=os.path.join("config","model.yaml")model_factory=ModelFactory(model_config_path=export_file_path)x=None# input featurey=None# target featurebest_model=model_factory.get_best_model(x,y,base_accuracy=0.9)print(best_model.best_model)print(f"best score:{best_model.best_score}")