class_docstr: DP version of `tf.compat.v1.estimator.LinearClassifier`.
docstr: See `tf.compat.v1.estimator.LinearClassifier`.
docstr_tok: ["See","`","tf.compat.v1.estimator.LinearClassifier","`","."]
code: def __init__(
      self,
      feature_columns,
      model_dir=None,
      n_classes=2,
      weight_column=None,
      label_vocabulary=None,
      optimizer="Ftrl",
      config=None,
      partitioner=None,
      warm_start_from=None,
      loss_reduction=tf.compat.v1.losses.Reduction.SUM,  # For scalar summary.
      sparse_combiner="sum",
  ):
      """See `tf.compat.v1.estimator.LinearClassifier`."""
      linear._validate_linear_sdca_optimizer_for_linear_classifier(  # pylint: disable=protected-access
          feature_columns=feature_columns,
          n_classes=n_classes,
          optimizer=optimizer,
          sparse_combiner=sparse_combiner,
      )
      estimator._canned_estimator_api_gauge.get_cell("Classifier").set(
          "Linear"
      )  # pylint: disable=protected-access
  
      head = head_lib._binary_logistic_or_multi_class_head(  # pylint: disable=protected-access
          n_classes, weight_column, label_vocabulary, loss_reduction
      )
  
      def _model_fn(features, labels, mode, config):
          """Call the defined shared _linear_model_fn."""
          return linear._linear_model_fn(  # pylint: disable=protected-access
              features=features,
              labels=labels,
              mode=mode,
              head=head,
              feature_columns=tuple(feature_columns or []),
              optimizer=optimizer,
              partitioner=partitioner,
              config=config,
              sparse_combiner=sparse_combiner,
          )
  
      super(LinearClassifier, self).__init__(
          model_fn=_model_fn,
          model_dir=model_dir,
          config=config,
          warm_start_from=warm_start_from,
      )
  
imports: import tensorflow
  from tensorflow_privacy.privacy.estimators.v1 import head
  from tensorflow_estimator.python.estimator import estimator
  from tensorflow_estimator.python.estimator.canned import linear
label_desc: Use image node_id 1 to create a new LinearClassifier object from inherited base classes: estimator with example: obj = LinearClassifier(feature_columns, model_dir, n_classes, weight_column, label_vocabulary, optimizer, config, partitioner, warm_start_from, loss_reduction, sparse_combiner)