notice

This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).

Version: Main/Unreleased

rasa.nlu.classifiers.logistic_regression_classifier

LogisticRegressionClassifier Objects

@DefaultV1Recipe.register(
DefaultV1Recipe.ComponentType.INTENT_CLASSIFIER, is_trainable=True
)
class LogisticRegressionClassifier(IntentClassifier, GraphComponent)

Intent classifier using the Logistic Regression.

required_components

@classmethod
def required_components(cls) -> List[Type]

Components that should be included in the pipeline before this component.

required_packages

@staticmethod
def required_packages() -> List[Text]

Any extra python dependencies required for this component to run.

get_default_config

@staticmethod
def get_default_config() -> Dict[Text, Any]

The component's default config (see parent class for full docstring).

__init__

def __init__(config: Dict[Text, Any], name: Text, model_storage: ModelStorage,
resource: Resource) -> None

Construct a new classifier.

train

def train(training_data: TrainingData) -> Resource

Train the intent classifier on a data set.

create

@classmethod
def create(
cls, config: Dict[Text, Any], model_storage: ModelStorage,
resource: Resource,
execution_context: ExecutionContext) -> "LogisticRegressionClassifier"

Creates a new untrained component (see parent class for full docstring).

process

def process(messages: List[Message]) -> List[Message]

Return the most likely intent and its probability for a message.

persist

def persist() -> None

Persist this model into the passed directory.

load

@classmethod
def load(cls, config: Dict[Text, Any], model_storage: ModelStorage,
resource: Resource, execution_context: ExecutionContext,
**kwargs: Any) -> "LogisticRegressionClassifier"

Loads trained component (see parent class for full docstring).

process_training_data

def process_training_data(training_data: TrainingData) -> TrainingData

Process the training data.

validate_config

@classmethod
def validate_config(cls, config: Dict[Text, Any]) -> None

Validates that the component is configured properly.