Builds a logistic regression Estimator for binary classification.
tf.contrib.learn.LogisticRegressor( model_fn, thresholds=None, model_dir=None, config=None, feature_engineering_fn=None )
THIS CLASS IS DEPRECATED. See contrib/learn/README.md for general migration instructions.
This method provides a basic Estimator with some additional metrics for custom binary classification models, including AUC, precision/recall and accuracy.
# See tf.contrib.learn.Estimator(...) for details on model_fn structure def my_model_fn(...): pass estimator = LogisticRegressor(model_fn=my_model_fn) # Input builders def input_fn_train: pass estimator.fit(input_fn=input_fn_train) estimator.predict(x=x)
model_fn: Model function with the signature:
(features, labels, mode) -> (predictions, loss, train_op). Expects the returned predictions to be probabilities in [0.0, 1.0].
thresholds: List of floating point thresholds to use for accuracy, precision, and recall metrics. If
None, defaults to
model_dir: Directory to save model parameters, graphs, etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.
config: A RunConfig configuration object.
feature_engineering_fn: Feature engineering function. Takes features and labels which are the output of
input_fnand returns features and labels which will be fed into the model.