Answer the question
In order to leave comments, you need to log in
How to understand machine learning in python?
Greetings.
I want to try machine learning - where do I start?
Preferably in python and preferably for text analysis)
Maybe there are some books on this topic or where is it better to look right away?
Answer the question
In order to leave comments, you need to log in
In short:
1. db corpus of texts with labels (for example, positive tweet, negative tweet)
2. Remove punctuation marks
3. Remove stop words (prepositions, etc. that have no semantic load)
4. Do stemming
5. From each tweet you make a set of n-grams
6. From n-grams you make a TF-IDF dictionary
7. You split the resulting dictionary into data for training and data for tests
8. You put all this into your favorite algorithm for ML, for example, like this:
clf = RandomForestClassifier(n_jobs=-1)
clf.fit(X_train, y_train)
predict = clf.predict(tfidf_predict.toarray())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question