recall classification
import numpy as np from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.metrics import recall_score #Split the data into training and testing sets X_train, X_test, y_train, y_test = train_test_split(df, y, test_size=0.2, random_state=42) #Train a logistic regression model model = LogisticRegression(max_iter=1000) model.fit(X_train, y_train) #Make predictions y_pred = model.predict(X_test) # Metric recall = recall_score(y_test, y_pred,average='micro') print(recall)