class_docstr: Intent classifier which uses a Logistic Regression underneath
class_docstr_tok: ["Intent","classifier","which","uses","a","Logistic","Regression","underneath"]
docstr: Loads a :class:`LogRegIntentClassifier` instance from a path
  
  The data at the given path must have been generated using
  :func:`~LogRegIntentClassifier.persist`
docstr_tok: ["Loads","a",":","class",":","`","LogRegIntentClassifier","`","instance","from","a","path","The","data","at","the","given","path","must","have","been","generated","using",":","func",":","`","~LogRegIntentClassifier.persist","`"]
code: def from_path(cls, path, **shared):
      """Loads a :class:`LogRegIntentClassifier` instance from a path
  
      The data at the given path must have been generated using
      :func:`~LogRegIntentClassifier.persist`
      """
      import numpy as np
      from sklearn.linear_model import SGDClassifier
  
      path = Path(path)
      model_path = path / "intent_classifier.json"
      if not model_path.exists():
          raise LoadingError(
              "Missing intent classifier model file: %s"
              % model_path.name
          )
  
      with model_path.open(encoding="utf8") as f:
          model_dict = json.load(f)
  
      # Create the classifier
      config = LogRegIntentClassifierConfig.from_dict(
          model_dict["config"]
      )
      intent_classifier = cls(config=config, **shared)
      intent_classifier.intent_list = model_dict["intent_list"]
  
      # Create the underlying SGD classifier
      sgd_classifier = None
      coeffs = model_dict["coeffs"]
      intercept = model_dict["intercept"]
      t_ = model_dict["t_"]
      if coeffs is not None and intercept is not None:
          sgd_classifier = SGDClassifier(**LOG_REG_ARGS)
          sgd_classifier.coef_ = np.array(coeffs)
          sgd_classifier.intercept_ = np.array(intercept)
          sgd_classifier.t_ = t_
      intent_classifier.classifier = sgd_classifier
  
      # Add the featurizer
      featurizer = model_dict["featurizer"]
      if featurizer is not None:
          featurizer_path = path / featurizer
          intent_classifier.featurizer = Featurizer.from_path(
              featurizer_path, **shared
          )
  
      return intent_classifier
  
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 9 for calling the LogRegIntentClassifier obj's underlying member method code with example usage: obj.from_path(cls, path) and returns: intent_classifier