This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model=Sequential() | |
model.add(Dense(64,input_dim=train_x.shape[1])) | |
model.add(Dense(64)) | |
model.add(Dense(64)) | |
model.add(Dense(64)) | |
model.add(Dense(64,)) | |
model.add(Dense(1,activation='sigmoid')) | |
model.compile(loss='binary_crossentropy',optimizer='adam',metrics=['acc']) | |
model.summary() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rfc=RandomForestClassifier(n_estimators=100000,max_depth=3,n_jobs=-1) | |
rfc.fit(train_x,train_y) | |
predict=rfc.predict(test_x) | |
print('Recall Score --> ',recall_score(test_y,predict)) | |
print("Classification Report\n",classification_report(test_y,predict)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smote=SMOTE() | |
train_x,test_x,train_y,test_y=train_test_split(data[cols],data['Outcome'],test_size=0.3,random_state=101) | |
print(train_x.shape,train_y.shape,test_x.shape,test_y.shape) | |
train_x,train_y=smote.fit_resample(train_x,train_y) | |
print(train_x.shape,train_y.shape,test_x.shape,test_y.shape) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sns.heatmap(data.corr(),annot=True,fmt='.2f') | |
x=data.corr() | |
cols=x[(x.values>0.2)&(x.index=='Outcome')]['Outcome'][:-1].index | |
print(cols) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sns.countplot(data=data,x='Outcome') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Number of unique values --> ',data['Age'].nunique()) | |
sns.displot(data['Age']) | |
sns.boxplot(data=data,y='Age') | |
sns.boxplot(data=data,x='Outcome',y='Age') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Number of unique of values --> ',data['DiabetesPedigreeFunction'].nunique()) | |
sns.displot(data['DiabetesPedigreeFunction']) | |
sns.boxplot(data=data,y='DiabetesPedigreeFunction') | |
sns.boxplot(data=data,x='Outcome',y='BMI') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Number of unique values --> ',data['BMI'].nunique()) | |
sns.displot(data['BMI']) | |
sns.boxplot(data=data,y='BMI') | |
sns.boxplot(data=data,x='Outcome',y='BMI') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Number of unique values --> ',data['Insulin'].nunique()) | |
sns.displot(data['Insulin']) | |
sns.boxplot(data=data,y='Insulin') | |
sns.boxplot(data=data,x='Outcome',y='Insulin') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('Number of unique values --> ',data['SkinThickness'].nunique()) | |
sns.displot(data['SkinThickness']) | |
sns.boxplot(data=data,y='SkinThickness') | |
sns.boxplot(data=data,x='Outcome',y='SkinThickness') |
NewerOlder