<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
from sklearn.svm import SVC
import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm, datasets
train = pd.read_csv('/content/drive/MyDrive/Muiba_project/Training.csv')
test = pd.read_csv("/content/drive/MyDrive/Muiba_project/Test data.csv")
#check null percentage in each feature column through heatmap
#Age and Cabin features have null values, 
sns.heatmap(train.isnull(),yticklabels=False,cbar=False,cmap='viridis')

# train data and labels
train_data = train.drop('Label',axis=1)
train_data

train_label = train['Label']
train_label[train_label > 0.8] = 1
train_label[train_label < 0.2] = 0
train_label

# test data and labels
test_data = test.drop('Label',axis=1)

test_label = test['Label']
test_label[test_label > 0.8] = 1
test_label[test_label < 0.2] = 0
test_label
# shapes of each dataframe 
print("train data ->",train_data.shape," train label ->",train_label.shape,"test data ->",test_data.shape,"test label ->",test_label.shape)
from sklearn.linear_model import LogisticRegression
logmodel = LogisticRegression()
logmodel.fit(train_data,train_label)
predictions = logmodel.predict(test_data)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11179173047473201, 'fraction_numerical': 0.010719754977029096, 'mean_word_length': 6.598837209302325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '301148', 'license': 'MIT', 'n_tokens_mistral': 457, 'n_tokens_neox': 442, 'n_words': 111, 'path': 'Muniba.ipynb', 'repo_name': 'Noman-Nosher/Data-Science-Tasks', 'size': '1306'}