Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docsrc/source/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The API follows a hierarchy of interacting components, allowing designers to con
from lnn import World

formulae = [
Smoking_causes_Cancer
Smoking_causes_Cancer,
Smokers_befriend_Smokers
]
model.add_knowledge(*formulae, world=World.AXIOM)
Expand Down Expand Up @@ -132,7 +132,8 @@ The API follows a hierarchy of interacting components, allowing designers to con
3. Tables of Data <a name="data"></a>
```python
from lnn import Fact

# NOTE: Using .name returns a string, but add_data() expects a Formula object.
# This causes: TypeError: formula expected of type Formula, received str
# add data to the model
model.add_data({
Friends: {
Expand All @@ -143,12 +144,12 @@ The API follows a hierarchy of interacting components, allowing designers to con
('Anna', 'Frank'): Fact.TRUE,
('Frank', 'Anna'): Fact.TRUE,
('Bob', 'Chris'): Fact.TRUE},
Smokes.name: {
Smokes: {
'Anna': Fact.TRUE,
'Edward': Fact.TRUE,
'Frank': Fact.TRUE,
'Gary': Fact.TRUE},
Cancer.name: {
Cancer: {
'Anna': Fact.TRUE,
'Edward': Fact.TRUE}
})
Expand Down