When you develop a Python script, there are often instances where you want to alter the script’s behaviour without having to rewrite the code. This is where arguments come in handy. Arguments allow you to pass values to a script when it is executed, and these values can then be used to control the script’s behaviour. For instance, let’s consider a script that trains a Support Vector Machine (SVM) model. Arguments can be used to pass the values of the hyper-parameters to your script as command-line arguments. This enables you to easily modify the values of the hyper-parameters without having to modify your code. Here’s an example of how to use argparse to pass hyper-parameters to a Python script that trains an SVM model:Documentation Index
Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
Use this file to discover all available pages before exploring further.
Configuring a Job with Params
To set up Params, follow these steps:- Setup the params in job form. Here, you’ll provide details regarding the arguments you want to make params. You’ll need to provide the name, description, and default value for each parameter.
- In the command you specify while configuring the Job, you need to specify a command template. It will be like the following:
python train.py --C {{c_val}} --kernel {{kernel}}.