forked from MLSA-MUET-SZAB-Club-Khairpur-Mir-s/Learn-to-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisease Detection with python
More file actions
31 lines (31 loc) · 907 Bytes
/
Copy pathDisease Detection with python
File metadata and controls
31 lines (31 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv("haberman.csv")
df.head()
df.columns =["age", "operation_year","axillary_lymph_node","survival_status"]
df.head()
df.shape
print(df.info())
df['survival_status'] = df['survival_status'].map({1:"yes", 2:"no"})
df.head()
df.describe()
df['survival_status'].value_counts()
status_yes = df[df['survival_status']=='yes']
status_yes.describe()
status_no = df[df['survival_status']=='no']
status_no.describe()
# 1. Univariant Analysis - Histogram
fm = sns.FacetGrid(df, hue='survival_status', height=5)
fm.map(sns.histplot,'age')
fm.add_legend()
plt.show()
fm = sns.FacetGrid(df,hue='survival_status',height=5)
fm.map(sns.distplot,'operation_year')
fm.add_legend()
plt.show()
fm = sns.FacetGrid(df,hue= 'survival_status', height=5)
fm.map(sns.distplot, 'axillary_lymph_node')
fm.add_legend()
plt.show()