<jupyter_start><jupyter_text><jupyter_code>from google.colab import files
files.upload()

from sklearn.datasets import load_breast_cancer
breast_cancer_data = load_breast_cancer()
import pandas as pd
bc = pd.DataFrame(breast_cancer_data.data)
bc.columns = breast_cancer_data.feature_names
bc['class'] = breast_cancer_data.target
pd.value_counts(bc['class'])
bc.describe().transpose()
import matplotlib.pyplot as plt
x = range(len(bc['mean radius']))
y = bc['mean radius']
plt.scatter(x,y,c=bc['class'])
plt.xlabel('sample')
plt.ylabel('mean radius')
plt.show()
X = bc.iloc[:,:-1]
y = bc['class']
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2,random_state=327)

print('Training data size: (%i,%i)' % X_train.shape)
print('Testing data size: (%i,%i)' % X_test.shape)
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
X_train = scaler.fit_transform(X_train)
X_test = scaler.transform(X_test)
print('Training set mean by feature:')
print(X_train.mean(axis=0))
print('Training set standard deviation by feature:')
print(X_train.std(axis=0))
from sklearn.linear_model import LogisticRegression

regression_model = LogisticRegression()
regression_model.fit(X_train,y_train)
intercept = regression_model.intercept_
coef = pd.DataFrame(regression_model.coef_.transpose(),
                    index=breast_cancer_data.feature_names,
                    columns=['Coefficients'])
print('Intercept = %f\n' % intercept)
print(coef)
from sklearn.metrics import accuracy_score

y_pred = regression_model.predict(X_test)
test_acc = accuracy_score(y_test,y_pred)*100

print('The test set accuracy is %4.2f%%' % test_acc)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12853025936599424, 'fraction_numerical': 0.007492795389048991, 'mean_word_length': 6.855203619909502, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '499111', 'license': 'MIT', 'n_tokens_mistral': 632, 'n_tokens_neox': 603, 'n_words': 116, 'path': 'classification.ipynb', 'repo_name': 'nair-jishnu/Data-Analysis', 'size': '1735'}