Fit LogisticRegression
Logistic Regression (aka logit, MaxEnt) classifier. In the multiclass case, the training algorithm uses the one-vs-rest (OvR) scheme if the ‘multi_class’ option is set to ‘ovr’, and uses the cross-entropy loss if the ‘multi_class’ option is set to ‘multinomial’.
Logistic Regression models the probability of a binary or multi-class outcome by applying a logistic function to a linear combination of input features. It tries to minimize the difference between predicted probabilities and actual labels through optimization.
Usage:
Start the algorithm from the Processing Toolbox panel.
Select a training dataset or create one by clicking the processing algorithm icon, then click run.
Parameters
- Classifier [string]
Scikit-learn python code. See LogisticRegression for information on different parameters. Default:
from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler from sklearn.pipeline import make_pipeline logisticRegression = LogisticRegression\(\) classifier = make_pipeline\(StandardScaler\(\), logisticRegression\)
- Training dataset [file]
Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLogisticregression
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
logisticRegression = LogisticRegression()
classifier = make_pipeline(StandardScaler(), logisticRegression)
Argument type: string
Acceptable values:
- String value
- field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
- expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier