Skip to content

Commit

Permalink
Adapted to new interface from probabilistic models.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsch420 committed Dec 6, 2023
1 parent 2b3cb25 commit 1d35c83
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 172 deletions.
72 changes: 36 additions & 36 deletions example/distributions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 18,
"id": "initial_id",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.667488383Z",
"start_time": "2023-11-02T15:14:41.636990366Z"
"end_time": "2023-12-06T12:08:07.453850144Z",
"start_time": "2023-12-06T12:08:07.428326539Z"
}
},
"outputs": [
{
"data": {
"text/plain": "(Symbolic(name='animal'), Symbolic(name='color'), Integer(name='weight'))"
"text/plain": "(Symbolic(animal), Symbolic(color), Integer(weight))"
},
"execution_count": 9,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -55,13 +55,13 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 19,
"outputs": [
{
"data": {
"text/plain": "((Symbolic(name='animal'), Symbolic(name='color'), Integer(name='weight')),\n (3, 4, 25))"
"text/plain": "((Symbolic(animal), Symbolic(color), Integer(weight)), (3, 4, 25))"
},
"execution_count": 10,
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -77,8 +77,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.669845591Z",
"start_time": "2023-11-02T15:14:41.641591695Z"
"end_time": "2023-12-06T12:08:07.455358353Z",
"start_time": "2023-12-06T12:08:07.431559191Z"
}
},
"id": "b4658690bcc40b12"
Expand All @@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 20,
"outputs": [],
"source": [
"from random_events.events import Event\n",
Expand All @@ -109,8 +109,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.728917032Z",
"start_time": "2023-11-02T15:14:41.699385761Z"
"end_time": "2023-12-06T12:08:07.481397647Z",
"start_time": "2023-12-06T12:08:07.440570786Z"
}
},
"id": "dffc7d500e84b520"
Expand All @@ -127,13 +127,13 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 21,
"outputs": [
{
"data": {
"text/plain": "0.37218590717704436"
},
"execution_count": 12,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -144,8 +144,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.731048688Z",
"start_time": "2023-11-02T15:14:41.699511383Z"
"end_time": "2023-12-06T12:08:07.482987436Z",
"start_time": "2023-12-06T12:08:07.444435556Z"
}
},
"id": "ee2f2d63802ad2d2"
Expand All @@ -162,13 +162,13 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 22,
"outputs": [
{
"data": {
"text/plain": "([{Symbolic(name='animal'): ('Cat',), Symbolic(name='color'): ('brown',), Integer(name='weight'): (5,)}],\n 0.006809245726270245)"
"text/plain": "([{Symbolic(animal): ('Cat',), Symbolic(color): ('brown',), Integer(weight): (5,)}],\n 0.006809245726270245)"
},
"execution_count": 13,
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -179,8 +179,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.731457742Z",
"start_time": "2023-11-02T15:14:41.699600957Z"
"end_time": "2023-12-06T12:08:07.500720800Z",
"start_time": "2023-12-06T12:08:07.451077955Z"
}
},
"id": "e2994d27e8474c54"
Expand All @@ -197,13 +197,13 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 23,
"outputs": [
{
"data": {
"text/plain": "((Symbolic(name='animal'), Symbolic(name='color')), (3, 4))"
"text/plain": "((Symbolic(animal), Symbolic(color)), (3, 4))"
},
"execution_count": 14,
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -215,8 +215,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.731646143Z",
"start_time": "2023-11-02T15:14:41.699682618Z"
"end_time": "2023-12-06T12:08:07.501022406Z",
"start_time": "2023-12-06T12:08:07.491780538Z"
}
},
"id": "d5c35229158ee9c2"
Expand All @@ -243,26 +243,26 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 24,
"outputs": [
{
"data": {
"text/plain": "0.37218590717704436"
},
"execution_count": 15,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"conditional = distribution.conditional(event)\n",
"conditional.probability(event)"
"conditional, probability = distribution.conditional(event)\n",
"probability"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.731791084Z",
"start_time": "2023-11-02T15:14:41.699766715Z"
"end_time": "2023-12-06T12:08:07.501267015Z",
"start_time": "2023-12-06T12:08:07.492079689Z"
}
},
"id": "5f036dc30b5cf18d"
Expand All @@ -289,7 +289,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 25,
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -331,8 +331,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:14:41.731995643Z",
"start_time": "2023-11-02T15:14:41.699946388Z"
"end_time": "2023-12-06T12:08:07.501511837Z",
"start_time": "2023-12-06T12:08:07.492235984Z"
}
},
"id": "dcc9ca9e0f922e53"
Expand Down
16 changes: 8 additions & 8 deletions example/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:13:40.814428028Z",
"start_time": "2023-11-02T15:13:40.754451007Z"
"end_time": "2023-12-06T12:07:52.022289981Z",
"start_time": "2023-12-06T12:07:52.017452534Z"
}
},
"id": "b857b83f5ae8482c"
Expand Down Expand Up @@ -63,8 +63,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:13:40.926252491Z",
"start_time": "2023-11-02T15:13:40.815684343Z"
"end_time": "2023-12-06T12:07:52.127695085Z",
"start_time": "2023-12-06T12:07:52.024695184Z"
}
},
"id": "97e60dbee16c1dbd"
Expand Down Expand Up @@ -99,8 +99,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:13:41.194177397Z",
"start_time": "2023-11-02T15:13:40.926542391Z"
"end_time": "2023-12-06T12:07:52.414076356Z",
"start_time": "2023-12-06T12:07:52.126868633Z"
}
},
"id": "bc41f2e657f4f715"
Expand Down Expand Up @@ -174,8 +174,8 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-11-02T15:13:41.195205356Z",
"start_time": "2023-11-02T15:13:41.185785904Z"
"end_time": "2023-12-06T12:07:52.414471921Z",
"start_time": "2023-12-06T12:07:52.403649920Z"
}
},
"id": "47a7412bada04433"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
networkx>=3.0
numpy>=1.24.4
random_events>=1.1.3
random_events>=1.2.5
tabulate>=0.9.0
probabilistic-model>=1.1.0
probabilistic-model>=1.4.13
2 changes: 1 addition & 1 deletion src/fglib2/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.3'
__version__ = '1.1.4'
Loading

0 comments on commit 1d35c83

Please sign in to comment.