week4/shopping/shopping.py
def train_model(evidence, labels):
    """
    Given a list of evidence lists and a list of labels, return a
    fitted k-nearest neighbor model (k=1) trained on the data.
    """

    neigh = KNeighborsClassifier(n_neighbors=1)
    neigh.fit(evidence, labels)
    return neigh

    Given a list of evidence lists and a list of labels, return a
    fitted k-nearest neighbor model (k=1) trained on the data.
    
Given a list of evidence lists and a list of labels, return a
fitted k-nearest neighbor model (k=1) trained on the data.
Given a list of evidence lists and a list of labels return a fitted k - nearest neighbor model ( k = 1 ) trained on the data .
def train_model(evidence, labels):
    neigh = KNeighborsClassifier(n_neighbors=1)
    neigh.fit(evidence, labels)
    return neigh
def train_model ( evidence , labels ) : neigh = KNeighborsClassifier ( n_neighbors = 1 ) neigh . fit ( evidence , labels ) return neigh
Given a list of evidence lists and a list of labels, return a
fitted k-nearest neighbor model (k=1) trained on the data.
Given a list of evidence lists and a list of labels return a fitted k - nearest neighbor model ( k = 1 ) trained on the data .
"""
    Given a list of evidence lists and a list of labels, return a
    fitted k-nearest neighbor model (k=1) trained on the data.
    """
evidence
labels