<jupyter_start><jupyter_text>Importing Data<jupyter_code>data=pd.read_csv('Wine.csv')
data.head()
data.isnull().sum()<jupyter_output><empty_output><jupyter_text>Splitting Data<jupyter_code>from sklearn.model_selection import train_test_split
x=data.iloc[:,:-1].values
y=data.iloc[:,-1].values.reshape(-1,1)
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=0)<jupyter_output><empty_output><jupyter_text>Principle Component Analysis<jupyter_code>from sklearn.decomposition import PCA
pca=PCA(n_components=2)
x_train=pca.fit_transform(x_train,y_train)
x_test=pca.transform(x_test)
x_train.shape<jupyter_output><empty_output><jupyter_text>Logistic Regression<jupyter_code>from sklearn.linear_model import LogisticRegression 
lr=LogisticRegression()
lr.fit(x_train,y_train)
y_pred=lr.predict(x_test)
from sklearn.metrics import accuracy_score,confusion_matrix
print(confusion_matrix(y_test,y_pred))
accuracy_score(y_test,y_pred)<jupyter_output>[[13  0  1]
 [ 0 13  3]
 [ 0  4  2]]
{'fraction_non_alphanumeric': 0.12749003984063745, 'fraction_numerical': 0.018924302788844622, 'mean_word_length': 12.58108108108108, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '284035', 'license': 'MIT', 'n_tokens_mistral': 423, 'n_tokens_neox': 412, 'n_words': 41, 'path': 'PCA.ipynb', 'repo_name': 'Legolas1086/Demensionality_Reduction', 'size': '1004'}