def run(projectName):
    posters = ForumPosters()
    print('Num Posters: ' + str(posters.getNumPosters()))

    results = tallyPosters(posters)
    print('# courses\t\t# posters taking that many courses')
    for (numCourses, numStudents) in results:
        print(str(numCourses) + '\t\t' + str(numStudents))
def run(projectName):
    posters = ForumPosters()
    print('Num Posters: ' + str(posters.getNumPosters()))

    results = tallyPosters(posters)
    print('# courses\t\t# superposters taking that many courses')
    for (numCourses,numStudents) in results:
        print(str(numCourses) + '\t\t' + str(numStudents))
def run(projectName):
    posters = ForumPosters()
    print('Num Posters: ' + str(posters.getNumPosters()))

    results, numSamps = tallyPosters(posters)
    print(results)
    print(numSamps)

    marg = sum(results).reshape((2, 1))
    print(marg)
    approx = np.dot(marg, marg.transpose())
    print(approx)
def run(projectName):
    posters = ForumPosters()
    print('Num Posters: ' + str(posters.getNumPosters()))

    results, numSamps = tallyPosters(posters)
    print(results)
    print(numSamps)

    marg = sum(results).reshape((2,1))
    print(marg)
    approx = np.dot(marg,marg.transpose())
    print(approx)
示例#5
0
def run(projectName):
    posters = ForumPosters()
    print("Num Posters: " + str(posters.getNumPosters()))

    TCnumResponses, TCnumFirstPosts, nonTCnumResponses, nonTCnumFirstPosts = tallyPosters(posters)
    print("For top contributors:")
    print("\t# responses: " + str(int(TCnumResponses)))
    print("\t# first posts: " + str(int(TCnumFirstPosts)))
    print("\t\tratio: " + str(TCnumResponses / TCnumFirstPosts))
    print("For non top contributors:")
    print("\t# responses: " + str(int(nonTCnumResponses)))
    print("\t# first posts: " + str(int(nonTCnumFirstPosts)))
    print("\t\tratio: " + str(nonTCnumResponses / nonTCnumFirstPosts))