def feature_selection(documents=[], top=None, method=CHISQUARED, threshold=0.0):
    a = []
    for i, d in enumerate(documents):
        if not isinstance(d, Document):
            d = Document(d[0], type=d[1], stopwords=True)
        a.append(d)
    m = Model(a, weight=None)
    p = m.posterior_probability
    c = m.classes
    for w, f in m.feature_selection(top, method, threshold, weighted=True):
        # For each feature, retrieve the class with the maximum probabilty.
        yield f, w, max([(p(f, type), type) for type in c])
Returns an iterator of (feature, weight, (probability, class))-tuples,
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/feature_selection