Machine learning is the field of study that gives computers the ability to learn without being explicitly programmed.
For Instance: Weather Prediction
Features:
For Instance: Weather Prediction
Labels:
There is no "Label".
Clustering Data and Clustering Analysis
for post in pol:
pol_x += f.features(post)
X = np.array([non_pol_x, pol_x])
y = np.array([0, 1])
#Multinomial Naive Bayes
from sklearn.naive_bayes import MultinomialNB
clf = MultinomialNB()
clf.fit(X, y)
print("Testing")
test = ["民進黨", "哈哈交大哈哈"]#第一篇是政治文,第二篇不是政治文
for i in test:
print(clf.predict([f.features(i)]))
Example: Classify the post whether it is about politics or not
Supervised Learning
Bayes Algorithm
Text
Code, a bridge connecting between the carbon-based and silicon-based