- Trains a model specified in config file
- Saves classifier and best checkpoints
- Saves logs for tensorboard
OPTION 1 - using preprocessed files(from PREPROCESSING STEP)
Example: example_config_files/train_dense_net_example.yml In the train config you can choose model, dataset, trainer, metrics, dataloader configs, features see the example
special_inputs: input_dim: 53 n_outputs: 2
a. The results will be pickle file of classifier saved in classifiers
b. If training torch model the epoch loss and other metrics specified in the model itself will be logged for tensorboard in train_results
a. Logistic Regression config example_config_files/train_logistic_regression_example.yml
1. Trainer changed to sklearn_trainer
2. model.name, model.tag changed
3. special inputs are accords with inputs of sklearn.linear_model.LogisticRegression class
4. dataset.Dataloader was removed as it's not needed
b. Logistic Regression config example_config_files/train_xgboost_example.yml
If trained torch model the epoch wise and additional metrics are saved in train_results in tensorboard format
- You must be in G42 network to access this dataset
- Download dataset of x y coordinates of players in NBA games
- Unzip it and put in data folder
- Original dataset and code reference
The torch.Dataset for this specific example is already inserted For reference see path_to_project/modules/datasets/basket_dataset.py
Use example example_config_files/train_dagnet_example.yml
1. Take a look at one of the models already created in modules/models folder. You already can use them or any of sklearn models. In addition, you can create your own by inheriting BaseModel or DefaultModel. Just override the abstract methods.
2. Don't forget to register it line other models(put "@registry.register_model('my_custom_model')" above your model class declaration). In this case my_custom_model will be the name of your model that you specify in your train and prediction config files.
3. You have to specify tag of your model in config file(see examples). This way models of the same type(for example: 2 xgboosts) will be distinguished. They will be named with model class name and tag name in underscore style.
python run_train --config-yml configs/train_<something>.yml
- For binary classification torch models use n_outputs: 1
- For all classification torch models beware you need to specify self.output_function (last layer activation) and self.prediction_function (used during the prediction step, usually nn.Softmax) yourself in your model class.