python - Loading the saved model with different inputs but the result does not change -
i using dnnregressor()
predict completed orders. however, when used following code save model , reload different inputs, ended getting same prediction, not make sense @ all. not see why case, code has no error. please me issue?
train_set, test_set = train_test_split(train_x, test_size=0.2, random_state = random.randint(20, 200)) num_epochs = 1000 steps = 200000 batch_size = 80 feature_column1 = learn.infer_real_valued_columns_from_input(train_x) regressor = learn.dnnregressor(feature_columns = feature_column1, hidden_units= [100,4,100], model_dir = './output3') regressor.fit(train_x, train_y, max_steps= steps, batch_size= batch_size) ypred = regressor.predict_scores(test_x, as_iterable=true) ypred = np.asarray(list(ypred)) rmse = np.sqrt(((ypred - test_y) ** 2).mean(axis=0)) print("root mean square error: %.3f" %rmse) x = np.array([13, 15, 0, 0, 0, 1, 0, 0,0]) feature_column1 = learn.infer_real_valued_columns_from_input(x) y = np.array([[14, 2080, 0, 0, 1, 0, 0, 0,0]]) new_regressor = learn.dnnregressor(feature_columns = feature_column1, hidden_units= [100,4,100], , model_dir = './output3') new_regressor.predict_scores(y, as_iterable = false)
Comments
Post a Comment