Ejemplo n.º 1
0
    poetryFNs.append(poetryFN)

    fictionTPs.append(fictionTP)
    fictionFPs.append(fictionFP)
    fictionTNs.append(fictionTN)
    fictionFNs.append(fictionFN)

    dramaTPs.append(dramaTP)
    dramaFPs.append(dramaFP)
    dramaTNs.append(dramaTN)
    dramaFNs.append(dramaFN)

    for genre in genrestocheck:
        precision = predicted.genreaccuracy(genre, correctgenres)
        if precision <= 1:
            utils.appendtodict(genre, predicted.genrefeatures(genre),
                               genrefeatures)
            utils.appendtodict(genre, precision, genreprecisions)
            utils.appendtodict(genre, True, modeledvols)
        else:
            utils.appendtodict(genre, False, modeledvols)
            # Precision > 1 is a signal that we actually have no true or false
            # positives in the volume for this genre. In that circumstance, we're
            # not going to use the volume to train a metamodel for the genre, because
            # it won't usefully guide what we want to guide -- assessment of the
            # accuracy of our positive predictions for this genre.
            #
            # So we don't append the genre features or precision to the arrays
            # that are going to be used to create a genre-specific metamodel.
            #
            # On the other hand, there could be false negatives in the volume, and
            # we want to acknowledge that when calculating overall recall.
Ejemplo n.º 2
0
    poetryFNs.append(poetryFN)

    fictionTPs.append(fictionTP)
    fictionFPs.append(fictionFP)
    fictionTNs.append(fictionTN)
    fictionFNs.append(fictionFN)

    dramaTPs.append(dramaTP)
    dramaFPs.append(dramaFP)
    dramaTNs.append(dramaTN)
    dramaFNs.append(dramaFN)

    for genre in genrestocheck:
        precision = predicted.genreaccuracy(genre, correctgenres)
        if precision <= 1:
            utils.appendtodict(genre, predicted.genrefeatures(genre), genrefeatures)
            utils.appendtodict(genre, precision, genreprecisions)
            utils.appendtodict(genre, True, modeledvols)
        else:
            utils.appendtodict(genre, False, modeledvols)
            # Precision > 1 is a signal that we actually have no true or false
            # positives in the volume for this genre. In that circumstance, we're
            # not going to use the volume to train a metamodel for the genre, because
            # it won't usefully guide what we want to guide -- assessment of the
            # accuracy of our positive predictions for this genre.
            #
            # So we don't append the genre features or precision to the arrays
            # that are going to be used to create a genre-specific metamodel.
            #
            # On the other hand, there could be false negatives in the volume, and
            # we want to acknowledge that when calculating overall recall.