class_docstr: Intent classifier which uses a Logistic Regression underneath
class_docstr_tok: ["Intent","classifier","which","uses","a","Logistic","Regression","underneath"]
code: def log_best_features(self, top_n=50):
      import numpy as np
  
      if not hasattr(self.featurizer, "feature_index_to_feature_name"):
          return None
  
      log = "Top {} features weights by intent:".format(top_n)
      index_to_feature = self.featurizer.feature_index_to_feature_name
      for intent_ix in range(self.classifier.coef_.shape[0]):
          intent_name = self.intent_list[intent_ix]
          log += "\n\n\nFor intent {}\n".format(intent_name)
          top_features_idx = np.argsort(
              np.absolute(self.classifier.coef_[intent_ix])
          )[::-1][:top_n]
          for feature_ix in top_features_idx:
              feature_name = index_to_feature[feature_ix]
              feature_weight = self.classifier.coef_[
                  intent_ix, feature_ix
              ]
              log += "\n{} -> {}".format(feature_name, feature_weight)
      return log
  
imports: from __future__ import unicode_literals
  import json
  import logging
  from builtins import range, str, zip
  from pathlib import Path
  from snips_nlu.common.log_utils import DifferedLoggingMessage, log_elapsed_time
  from snips_nlu.common.utils import check_persisted_path, fitted_required, json_string
  from snips_nlu.constants import LANGUAGE, RES_PROBA
  from snips_nlu.dataset import validate_and_format_dataset
  from snips_nlu.exceptions import LoadingError, _EmptyDatasetUtterancesError
  from snips_nlu.intent_classifier.featurizer import Featurizer
  from snips_nlu.intent_classifier.intent_classifier import IntentClassifier
  from snips_nlu.intent_classifier.log_reg_classifier_utils import build_training_data, get_regularization_factor, text_to_utterance
  from snips_nlu.pipeline.configs import LogRegIntentClassifierConfig
  from snips_nlu.result import intent_classification_result
label_desc: Use image node_id 10 for calling the LogRegIntentClassifier obj's underlying member method code with example usage: obj.log_best_features(top_n) and returns: log, None