title: AWS SageMaker training script: how to pass custom user parameters
body: <p>I am training a classifier using Scikit-learn with the SageMaker Python SDK.<br>
  The overall process involves three sequential phases:  </p>
  
  <ol>
  <li>hyper-parameters tuning job using training and validation data sets   </li>
  <li>training job with the best hyper-parameters founded in 1. and the
  whole data set (training + validation from 1.)  </li>
  <li>training a calibrated model with the provided the "prefit" model from 2. and an additional data set for calibration.</li>
  </ol>
  
  <p>The reason I need to split the process is to save the un-calibrated model created at step 2.</p>
  
  <p>For each of this step I prepare a training script as explained in: <a href="https://sagemaker.readthedocs.io/en/stable/using_sklearn.html#prepare-a-scikit-learn-training-script" rel="nofollow noreferrer">https://sagemaker.readthedocs.io/en/stable/using_sklearn.html#prepare-a-scikit-learn-training-script</a></p>
  
  <p>The three scripts are very similar and to avoid code redundancy I would like to use a single script with additional logic inside for the three situation. More precisely, I would like to pass additional custom parameters to the <code>.fit</code> methods of the <code>sagemaker.tuner.HyperparameterTuner</code> and <code>sagemaker.sklearn.estimator.SKLearn</code> objects in order to be able to action the logic in the script depending on the usage (phase 1. ,2. or 3.).   </p>
  
  <p>I already tried by hacking the <code>SM_CHANNEL_XXX</code><br>
  <code>parser.add_argument('--myparam', type=str, default=os.environ.get('SM_CHANNEL_MYPRAM'))</code>
  while invoking <code>.fit(inputs={'train': ..., 'test': ..., 'myparam': myvalue})</code> but it expect a valid s3 URI.</p>
  
  <p>Any idea on how to pass extra custom parameters to the training scripts? </p>