FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Invalid call to function [extra arguments] in learning.py · Issue #830 · aimacode/aima-python · GitHub

Repository navigation

Invalid call to function [extra arguments] in learning.py #830

Description

function train_and_test has prototype:

def train_and_test(dataset, start, end):

but it is passed 4 arguments in the below function in learning.py.

def learningcurve(learner, dataset, trials=10, sizes=None):
    if sizes is None:
        sizes = list(range(2, len(dataset.examples) - 10, 2))

    def score(learner, size):
        random.shuffle(dataset.examples)
        return train_and_test(learner, dataset, 0, size)
    return [(size, mean([score(learner, size) for t in range(trials)]))
            for size in sizes]

I think learner should not be passed, but then it is the only use of learner parameter in train_and_test.
How should this be resolved?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL