GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 1 · fciasth/pythonMLAction@874c6bb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • 04
    • bayes.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎04/bayes.py‎

Copy file name to clipboardExpand all lines: 04/bayes.py
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ def setOfWords2Vec(vocabList,inputSet):#输入参数为词汇表及某个文档
4242
# print(createVocabList(dataSet))
4343
listOPosts,listClasses = loadDataSet()
4444
myVocabList = createVocabList(listOPosts)
45-
print (myVocabList) #在输出的这个此表中,不会出现重复的词
46-
print ("\n")
45+
# print (myVocabList) #在输出的这个此表中,不会出现重复的词
46+
# print ("\n")
47+
#
48+
# Vec = setOfWords2Vec(myVocabList, listOPosts[5])
49+
# print (Vec)
4750

48-
Vec = setOfWords2Vec(myVocabList, listOPosts[5])
49-
print (Vec)
51+
# 条件概率的计算
52+
def trainNB0(trainMatrix,trainCategory): #输入参数为文档矩阵trainMatrix,文档类别所构成的向量trainCategory
53+
#
54+
numTrainDocs = len()

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.