<jupyter_start><jupyter_text>Poisonous = 1Edible = 0<jupyter_code>X.hist(bins=20, figsize=(20,15))
save_fig("attribute_histogram_plots")
plt.show()
from sklearn.linear_model import LinearRegression
lr = LinearRegression()
lr.fit(X,y)
print(lr.intercept_, lr.coef_)
X=pd.get_dummies(X,columns=X.columns,drop_first=True)
X.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, random_state=1, stratify =y)
from sklearn.preprocessing import StandardScaler
sc = StandardScaler()
sc.fit(X_train)
X_train = sc.transform(X_train)
X_test = sc.transform(X_test)
X_train.shape, X_test.shape
from sklearn.linear_model import LogisticRegression
logreg = LogisticRegression(penalty = 'none', random_state=1)
logreg.fit(X_train, y_train)
score = logreg.score(X,y)
score
predictions = logreg.predict(X)
from sklearn import metrics

cm = metrics.confusion_matrix(y, predictions)
plt.figure(figsize=(9,9))
sns.heatmap(cm, annot=True, fmt=".3f", linewidths=.5, square = True, cmap = 'Pastel1');
plt.ylabel('Actual label');
plt.xlabel('Predicted label');
all_sample_title = 'Accuracy Score: {0}'.format(score)
plt.title(all_sample_title, size = 15);
plt.savefig('toy_Digits_ConfusionSeabornCodementor.png')
plt.show()
sns.relplot(x="odor", y="gill-color",
               col="class", aspect=1,
               kind="scatter", data=df)

plt.tight_layout()
sns.relplot(x="odor", y="cap-color",
               col="class", aspect=.7,
               kind="scatter", data=df)

plt.tight_layout()
sns.relplot(x="gill-color", y="cap-color",
               col="class", aspect=.7,
               kind="scatter", data=df)

plt.tight_layout()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1493317838466008, 'fraction_numerical': 0.01336432306798373, 'mean_word_length': 5.5227272727272725, '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': '497304', 'license': 'MIT', 'n_tokens_mistral': 677, 'n_tokens_neox': 641, 'n_words': 109, 'path': 'Technical Notebook/Mid_Term_Mushroom_Hist_LogReg.ipynb', 'repo_name': 'tvanwer1/Mid_Term_Project', 'size': '1721'}