<jupyter_start><jupyter_text>ÖN İŞLEME ADIMLARINA BURDA BAŞLADIK<jupyter_code>df
from sklearn.preprocessing import LabelEncoder
df.salary=df.salary.fillna(df.salary.mean())

colums=["gender","ssc_b","hsc_b","hsc_s","degree_t","workex","specialisation","status"]

for i in colums:
    df[i]=LabelEncoder().fit_transform(df[i])
df
y = df.status
x = df.drop(["status"],axis=1)

from sklearn.model_selection import train_test_split
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size = 0.40, random_state = 0)
from sklearn.preprocessing import StandardScaler
sc_X = StandardScaler()
x_train = sc_X.fit_transform(x_train)
x_test = sc_X.transform(x_test)
from sklearn.linear_model import LogisticRegression
classifier = LogisticRegression(random_state = 0)
classifier.fit(x_train, y_train)
y_pred = classifier.predict(x_test)

from sklearn.metrics import confusion_matrix
cm = confusion_matrix(y_test, y_pred)
print(cm)
fig, ax = plt.subplots(figsize=(7.5, 7.5))
ax.matshow(cm, cmap=plt.cm.Blues, alpha=0.3)
for i in range(cm.shape[0]):
    for j in range(cm.shape[1]):
        ax.text(x=j, y=i,s=cm[i, j], va='center', ha='center', size='xx-large')
 
plt.xlabel('Predictions', fontsize=18)
plt.ylabel('Actuals', fontsize=18)
plt.title('Confusion Matrix', fontsize=18)
plt.show()
prediction = classifier.predict(x_test)
from sklearn.metrics import classification_report
print(classification_report(y_test, prediction))
from sklearn.ensemble import RandomForestClassifier
rfc = RandomForestClassifier(max_depth=2, random_state=0)
rfc.fit(x_train, y_train)
pred = classifier.predict(x_test)
print(classification_report(y_test, pred))<jupyter_output>precision    recall  f1-score   support

           0       0.78      0.67      0.72        27
           1       0.86      0.92      0.89        59

    accuracy                           0.84        86
   macro avg       0.82      0.79      0.80        86
weighted avg       0.83      0.84      0.83        86
{'fraction_non_alphanumeric': 0.1209349593495935, 'fraction_numerical': 0.037601626016260166, 'mean_word_length': 3.99746192893401, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '105690', 'license': 'MIT', 'n_tokens_mistral': 761, 'n_tokens_neox': 720, 'n_words': 142, 'path': 'campus_recruitment2.ipynb', 'repo_name': 'ulasturan4/ChiSquareAnalysis_LogisticRegression_Random-Forest-DataMining_-final-assignment-', 'size': '1968'}