Computer scienceData scienceInstrumentsScikit-learnTraining ML models with scikit-learnClassification in scikit-learn

Logistic regression in scikit-learn

Precision calculation

Report a typo

To obtain a more objective evaluation of our model, we can create another training and testing set and recalculate the metric.

Let's continue working with the iris flower dataset.

You need to perform the following steps:

  1. Load the iris flower dataset.
  2. Split the data into training and testing sets using the train_test_split function with the following parameters: test_size=0.35, random_state=92.
  3. Create an instance of the Logistic Regression model and fit it with the training set.
  4. Obtain the predictions for the test set and evaluate the model's quality using the precision metric with the parameter average='macro'.

Your task is to write the value of the precision metric, rounded to four digits after the decimal point.

Enter a number
___

Create a free account to access the full topic