After Standard(), how can we standard() again in service

def standard(train, test):
    mean = train.mean(axis=0)
    train -= mean
    std = train.std(axis=0)

    train /= std
    test -= mean
    test /= std

standard(tf_train_x, tf_test_x)  

  1. Make data smaller for standardization.
  2. Make model, compile and validation check
  3. Final save model data for serving

after that we use model using load_model() in web or etc.

In case, how do we know the standard() values?

@jplee

  1. Calculate the mean of each feature in the training set.
  2. Subtract the mean from each feature in both the training and test sets.
  3. Calculate the standard deviation of each feature in the training set.
  4. Divide each feature in both the training and test sets by the standard deviation.

To obtain the mean and standard deviation values for each feature, you can modify your standard function like this:

def standard(train, test):
    mean = train.mean(axis=0)
    train -= mean
    std = train.std(axis=0)

    train /= std
    test -= mean
    test /= std

    return mean, std

# Apply standardization and get the mean and std values
mean_values, std_values = standard(tf_train_x, tf_test_x)

# Print or store the mean and std values for later use
print("Mean values:", mean_values)
print("Standard deviation values:", std_values)