docstr: Trains passive aggressive classifier
  
                  
docstr_tok: ["Trains","passive","aggressive","classifier"]
code: def passive_aggressive_train(self):
      """Trains passive aggressive classifier"""
      self._clf = PassiveAggressiveClassifier(
          n_iter=50, C=0.2, n_jobs=-1, random_state=0
      )
      self._clf.fit(self._term_doc_matrix._X, self._term_doc_matrix._y)
      y_dist = self._clf.decision_function(self._term_doc_matrix._X)
      pos_ecdf = ECDF(y_dist[y_dist >= 0])
      neg_ecdf = ECDF(y_dist[y_dist <= 0])
  
      def proba_function(distance_from_hyperplane):
          if distance_from_hyperplane > 0:
              return pos_ecdf(distance_from_hyperplane) / 2.0 + 0.5
          elif distance_from_hyperplane < 0:
              return pos_ecdf(distance_from_hyperplane) / 2.0
          return 0.5
  
      self._proba = proba_function
      return self
  
file_path: scattertext/scattertext/DeployedClassifier.py
imports: from sklearn.linear_model import PassiveAggressiveClassifier
  from statsmodels.distributions import ECDF
label_desc: Use image node_id 2 for calling the DeployedClassifierFactory obj's underlying member method code with example usage: obj.passive_aggressive_train() and returns: self, int, unknown, unknown