फ्रॉड पर टॉपिक मॉडलिंग

Python में Fraud Detection

Charlotte Werger

Data Scientist

टॉपिक मॉडलिंग: टेक्स्ट डेटा में छिपे पैटर्न खोजें

  1. टेक्स्ट डेटा में टॉपिक ढूँढना
  2. "टेक्स्ट किस बारे में है"
  3. अवधारणात्मक रूप से क्लस्टरिंग जैसा
  4. फ्रॉड बनाम नॉन-फ्रॉड केसों के टॉपिक तुलना करें और फीचर/फ्लैग की तरह उपयोग करें
  5. या... क्या डेटा में कोई ऐसा खास टॉपिक है जो फ्रॉड की ओर इशारा करता है?
Python में Fraud Detection

Latent Dirichlet Allocation (LDA)

LDA से आपको मिलता है:

  1. "प्रति टेक्स्ट आइटम टॉपिक" मॉडल (यानी probabilities)
  2. "प्रति टॉपिक शब्द" मॉडल

अपना टॉपिक मॉडल बनाएँ:

  1. अपना डेटा साफ करें
  2. dictionary और corpus से bag of words बनाएँ
  3. dictionary और corpus को LDA मॉडल में दें
Python में Fraud Detection

Latent Dirichlet Allocation (LDA)

Python में Fraud Detection

Bag of words: dictionary और corpus

from gensim import corpora
# Create dictionary number of times a word appears
dictionary = corpora.Dictionary(cleaned_emails)
# Filter out (non)frequent words 
dictionary.filter_extremes(no_below=5, keep_n=50000)
# Create corpus
corpus = [dictionary.doc2bow(text) for text in cleaned_emails]
Python में Fraud Detection

gensim के साथ Latent Dirichlet Allocation (LDA)

import gensim
# Define the LDA model
ldamodel = gensim.models.ldamodel.LdaModel(corpus, num_topics = 3, 
id2word=dictionary, passes=15)
# Print the three topics from the model with top words
topics = ldamodel.print_topics(num_words=4)
for topic in topics:
    print(topic)
(0, 0.029*"email" + 0.016*"send" + 0.016*"results" + 0.016*"invoice")
(1, 0.026*"price" + 0.026*"work" + 0.026*"management" + 0.026*"sell")
(2, 0.029*"distribute" + 0.029*"contact" + 0.016*"supply" + 0.016*"fast")
Python में Fraud Detection

अभ्यास करते हैं!

Python में Fraud Detection

Preparing Video For Download...