Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FOIL #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2017
Merged

FOIL #625

merged 3 commits into from
Aug 24, 2017

Conversation

Chipe1
Copy link
Contributor

@Chipe1 Chipe1 commented Aug 17, 2017

Added a basic implementation of FOIL.
The original algo, being intended for use in Prolog, is not directly compatible with python. So I've used FolKB to store and process the knowledge. This works for easy examples like the network given in the original paper and the family tree example.
The removing of positive examples is not recursive, and this is leading to technically correct but long and overfitted clauses. Any help in fixing that would be appreciated.

@@ -231,6 +234,117 @@ def consistent_det(A, E):
# ______________________________________________________________________________


class FOIL_container(FolKB):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be called FOILKB.

else:
return list(set(symbol for arg in x.args for symbol in prop_symbols(arg)))
return {symbol for arg in x.args for symbol in prop_symbols(arg)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, or could be
return set().union(map(prop_symbols, x.args))

else:
return list({symbol for arg in x.args for symbol in constant_symbols(arg)})
return {symbol for arg in x.args for symbol in constant_symbols(arg)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar here as for prop_symbols

@norvig norvig merged commit 718224a into aimacode:master Aug 24, 2017
@Chipe1 Chipe1 deleted the foiled branch August 24, 2017 11:58
@Chipe1 Chipe1 mentioned this pull request Aug 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants