Learn practical skills, build real-world projects, and advance your career

Precision and recall curve

from sklearn.datasets import load_breast_cancer
import pandas as pd
from sklearn.metrics import precision_recall_curve, plot_precision_recall_curve
from sklearn.ensemble import RandomForestClassifier
import seaborn as sns
from sklearn import metrics
df_dict = load_breast_cancer()
clf = RandomForestClassifier(max_depth=2, random_state=0)
df = pd.DataFrame(df_dict.data, columns = df_dict.feature_names)
df["target"] = df_dict.target
we'll proceed to make the data frame particularly imbalanced