<jupyter_start><jupyter_text>Explore The Data<jupyter_code>df.describe()
#summary of all the numeric columns
len(df.columns)
#correlation plot
corr=df.corr()
corr
corr.shape
plt.figure(figsize=(8,8))
sns.heatmap(corr);
df.head()
df['diagnosis']=df['diagnosis'].map({'M':1,'B':0})
df.head()
df['diagnosis'].unique()
X=df.drop('diagnosis',axis=1)
X.head()
y=df['diagnosis']
y.head()
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.3)
df.shape
X_train.shape
X_test.shape
y_train.shape
y_test.shape
X_train.head(1)
from sklearn.preprocessing import StandardScaler
ss = StandardScaler()
X_train = ss.fit_transform(X_train)
X_test = ss.transform(X_test)
X_train<jupyter_output><empty_output><jupyter_text>Machine Learning Models  Logistic Regression<jupyter_code>from sklearn.linear_model import LogisticRegression
lr = LogisticRegression()
lr.fit(X_train, y_train)
y_pred=lr.predict(X_test)
y_pred
y_test
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test, y_pred))
lr_acc = accuracy_score(y_test, y_pred)
print(lr_acc)
results=pd.DataFrame()
results
tempResults = pd.DataFrame({'Algorithm':['Logistic Regression Method'], 'Accuracy':[lr_acc]})
results = pd.concat( [results, tempResults] )
results = results[['Algorithm','Accuracy']]
results<jupyter_output><empty_output><jupyter_text>Decision Tree Classifier<jupyter_code>from sklearn.tree import DecisionTreeClassifier
dtc = DecisionTreeClassifier()
dtc.fit(X_train, y_train)
y_pred=dtc.predict(X_test)
y_pred
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test, y_pred))
dtc_acc = accuracy_score(y_test, y_pred)
print(dtc_acc)
tempResults = pd.DataFrame({'Algorithm':['Decision tree Classifier Method'], 'Accuracy':[dtc_acc]})
results = pd.concat( [results, tempResults] )
results = results[['Algorithm','Accuracy']]
results<jupyter_output><empty_output><jupyter_text>Random Forest Classifier<jupyter_code>from sklearn.ensemble import RandomForestClassifier
rfc = RandomForestClassifier()
rfc.fit(X_train, y_train)
y_pred = rfc.predict(X_test)
y_pred
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test, y_pred))
rfc_acc = accuracy_score(y_test, y_pred)
print(rfc_acc)
tempResults = pd.DataFrame({'Algorithm':['Random Forest Classifier Method'], 'Accuracy':[rfc_acc]})
results = pd.concat( [results, tempResults] )
results = results[['Algorithm','Accuracy']]
results<jupyter_output><empty_output><jupyter_text>Support Vector Classifier<jupyter_code>from sklearn import svm
svc = svm.SVC()
svc.fit(X_train,y_train)
y_pred = svc.predict(X_test)
y_pred
from sklearn.metrics import accuracy_score
print(accuracy_score(y_test, y_pred))
svc_acc = accuracy_score(y_test, y_pred)
print(svc_acc)
tempResults = pd.DataFrame({'Algorithm':['Support Vector Classifier Method'], 'Accuracy':[svc_acc]})
results = pd.concat( [results, tempResults] )
results = results[['Algorithm','Accuracy']]
results<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13177257525083613, 'fraction_numerical': 0.0026755852842809363, 'mean_word_length': 10.202247191011235, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '236511', 'license': 'Apache-2.0', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1090, 'n_words': 188, 'path': 'ML-Breast Cancer Prediction (3).ipynb', 'repo_name': 'gkumarashish213/LetsUpgrade-AIML-Project', 'size': '2990'}