<jupyter_start><jupyter_text>Jake's Method for doing LPPMy inspiration for coding up this method.<jupyter_code># jakes algorithm
from lpproj import LocalityPreservingProjection
lpp = LocalityPreservingProjection(n_components=50)

t0 = time()
X_proj_train = lpp.fit_transform(X_train)
X_proj_test = lpp.transform(X_test)
t1=time()
print('My LPP class: {t:.2g} secs'.format(t=t1-t0))
# classification using LDA
from sklearn.lda import LDA

lda_model = LDA()
lda_model.fit(X_proj_train,y_train)
y_pred = lda_model.predict(X_proj_test)

# classification report
from sklearn.metrics import classification_report, confusion_matrix

cm = confusion_matrix(y_test, y_pred)
cr = classification_report(y_test, y_pred)


print(cr)

plt.figure(figsize=(15,15))
plt.matshow(cm,aspect='auto')
plt.title('Confusion matrix')
plt.colorbar()
plt.ylabel('True label')
plt.xlabel('Predicted label')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11546840958605664, 'fraction_numerical': 0.011982570806100218, 'mean_word_length': 8.099009900990099, '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': '593732', 'license': 'MIT', 'n_tokens_mistral': 361, 'n_tokens_neox': 341, 'n_words': 67, 'path': 'src/python/lpp_hsi_demo.ipynb', 'repo_name': 'Lamzigit/manifold_learning', 'size': '918'}