def create_calibrated_linear(feature_columns, config, quantiles_dir): feature_names = [fc.name for fc in feature_columns] hparams = tfl.CalibratedLinearHParams(feature_names=feature_names, num_keypoints=200, learning_rate=lr) hparams.set_feature_param("feature1", "monotonicity", 1) return tfl.calibrated_linear_regressor(feature_columns=feature_columns, model_dir=config.model_dir, config=config, hparams=hparams, quantiles_dir=quantiles_dir)
def create_calibrated_linear(feature_columns, config, quantiles_dir): feature_names = [fc.name for fc in feature_columns] hparams = tfl.CalibratedLinearHParams(feature_names=feature_names, num_keypoints=200, learning_rate=1e-4) hparams.parse(FLAGS.hparams) hparams.set_feature_param("capital_gain", "calibration_l2_laplacian_reg", 4.0e-3) _pprint_hparams(hparams) return tfl.calibrated_linear_classifier(feature_columns=feature_columns, model_dir=config.model_dir, config=config, hparams=hparams, quantiles_dir=quantiles_dir)