나이브 베이즈 분류 예제 소스 코드


나이브 베이즈 분류 예제 소스 코드

sklearn 라이브러리를 이용해 특정 문서가 스팸 메일인지 아닌지를 분류하는 것입니다. from sklearn.feature_extraction.text import CountVectorizer from sklearn.naive_bayes import MultinomialNB # 학습 데이터 준비 spam_text = [ 'buy one get one free', 'new product launch', 'call now for free consultation', 'urgent offer', 'limited time offer' ] ham_text = [ 'hello, how are you', 'check out my new post', 'let us meet tomorrow', 'just wanted to say hi' ] corpus = spam_text + ham_text labels = ['spam'] * len(spam_text) + ['ham'] * len(ham_text...


#naive #나이브베이즈 #파이썬

원문링크 : 나이브 베이즈 분류 예제 소스 코드