1
$\begingroup$

I am working on Haberman's cancer survival data set.

I tried to visualize the pair plot with features as AGE, Op_Year, axil_nodes_det and target variable as Surv_status. I expect 12 plots but getting 16 including plots with Surv_stautus which is my target variable here is my code:

sns.set_style("whitegrid");
sns.pairplot(patients, hue="Surv_status", size=3);
$\endgroup$
1
  • $\begingroup$ Have you Dropped that column temporarily? $\endgroup$
    – Aditya
    Oct 1, 2018 at 10:36

1 Answer 1

0
$\begingroup$

maybe because Surv_status is number. there are two solution:

  1. define variables:

    sns.set_style("whitegrid"); sns.pairplot(patients, hue="Surv_status",vars=["AGE", "Op_Year", "axil_nodes_det"], size=3);
    
  2. change target value to a string:

    patients['Surv_status'] = patients['Surv_status'].astype(str)
    

or

    patients['Surv_status'] = patients['Surv_status'].str
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.