टेक्स्ट फीचर इंजीनियरिंग

Python में Machine Learning के लिए Preprocessing

James Chapman

Curriculum Manager, DataCamp

एक्सट्रैक्शन

  • Regular expressions: पैटर्न पहचानने का कोड
import re

my_string = "temperature:75.6 F"
temp = re.search("\d+\.\d+", my_string)
print(float(temp.group(0)))
75.6
  • \d+
  • \.
  • \d+
Python में Machine Learning के लिए Preprocessing

टेक्स्ट को वेक्टराइज़ करना

TF/IDF: महत्व के आधार पर शब्दों को वेक्टराइज़ करता है

  • TF = Term Frequency
  • IDF = Inverse Document Frequency
Python में Machine Learning के लिए Preprocessing

टेक्स्ट को वेक्टराइज़ करना

from sklearn.feature_extraction.text import TfidfVectorizer
print(documents.head())
0    Building on successful events last summer and ...
1               Build a website for an Afghan business
2    Please join us and the students from Mott Hall...
3    The Oxfam Action Corps is a group of dedicated...
4    Stop 'N' Swap reduces NYC's waste by finding n...
tfidf_vec = TfidfVectorizer()
text_tfidf = tfidf_vec.fit_transform(documents)
Python में Machine Learning के लिए Preprocessing

टेक्स्ट क्लासिफिकेशन

 

$$P(A|B) = \frac{P(B|A)P(A)}{P(B)}$$

Python में Machine Learning के लिए Preprocessing

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

Python में Machine Learning के लिए Preprocessing

Preparing Video For Download...