I have developed a machine learning model which has been trained on a preprocessed data by scaling and centering using h2o package of R. I am able to use this model for prediction of new datasets with a blueprint of the preprocessing methods. But if I make an API of my model and want someone to use it to predict outcome of his own single subject, (for example predict one of his patient's outcome), how is it possible to imply this on a single subject(according to not possbile scaling and centering).

  • $\begingroup$ Why is it not possible to include scaling and centring in the API? You (presumably) have the parameters used to do these from the pre-processing of your training data. $\endgroup$
    – Lynn
    May 16, 2022 at 8:44
  • $\begingroup$ Because only on subject I want to predict its outcome. Is it possible to use mean and SD of training set variables? Because for test data we use mean and SD of its own(mean of test) and not train. $\endgroup$ May 17, 2022 at 6:42
  • 1
    $\begingroup$ It's not only possible, it's generally what you would want to do - i.e. apply the same transformation to the test data that you applied to the training data. If you re-compute your mean and SD from the test data, you will (almost always) end up applying a different transformation to your test data. $\endgroup$
    – Lynn
    May 17, 2022 at 8:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.