Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • W Web-BAMT
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • itmo-sai-code
  • Web-BAMT
  • Wiki
  • Examples

Examples · Changes

Page history
Updated Examples (markdown) authored Sep 15, 2022 by jrzkaminski's avatar jrzkaminski
Show whitespace changes
Inline Side-by-side
Examples.md
View page @ 9a31a4dc
...@@ -71,9 +71,11 @@ sample = bn.sample(5000, parall_count=5) ...@@ -71,9 +71,11 @@ sample = bn.sample(5000, parall_count=5)
### Sampling with K2 + GMM + logit nodes example ### Sampling with K2 + GMM + logit nodes example
To sample using K2 with GMM and logit nodes the following code can be used:
~~~python ~~~python
train, validation = train_test_split(data, test_size=0.1) train, validation = train_test_split(data, test_size=0.1)
bn = Nets.HybridBN(has_logit=True, use_mixture=False) bn = Nets.HybridBN(has_logit=True, use_mixture=True)
bn.add_nodes(info) bn.add_nodes(info)
bn.add_edges(discretized_data, scoring_function=('K2',K2Score)) bn.add_edges(discretized_data, scoring_function=('K2',K2Score))
bn.fit_parameters(train) bn.fit_parameters(train)
...@@ -89,6 +91,23 @@ sample = bn.sample(5000, parall_count=5) ...@@ -89,6 +91,23 @@ sample = bn.sample(5000, parall_count=5)
### K2 with initial structure sampling ### K2 with initial structure sampling
To sample using K2 and initial structure the following code can be used:
~~~python
params = {'init_nodes': ['Tectonic regime', 'Period', 'Lithology', 'Structural setting', 'Gross','Netpay', 'Porosity','Permeability', 'Depth'],
'init_edges':[('Period', 'Permeability'), ('Structural setting', 'Netpay'), ('Gross', 'Permeability')],}
train, validation = train_test_split(data, test_size=0.1)
bn = Nets.HybridBN(has_logit=True, use_mixture=True)
bn.add_nodes(info)
bn.add_edges(discretized_data, scoring_function=('K2',K2Score), params=params)
bn.fit_parameters(train)
# prediction
val_pred = bn.predict(validation.iloc[:,:8], 5)
# sampling
sample = bn.sample(5000, parall_count=5)
~~~
<img width="489" alt="K2 + initial geo" src="https://user-images.githubusercontent.com/86363785/188191568-7d3d6ea5-3e41-458b-b472-321575080c93.png"> <img width="489" alt="K2 + initial geo" src="https://user-images.githubusercontent.com/86363785/188191568-7d3d6ea5-3e41-458b-b472-321575080c93.png">
![geo_k2_expert](https://user-images.githubusercontent.com/86363785/188129863-b8777153-eb31-4e8f-b8bf-b87e7c959035.png) ![geo_k2_expert](https://user-images.githubusercontent.com/86363785/188129863-b8777153-eb31-4e8f-b8bf-b87e7c959035.png)
......
Clone repository
  • About BAMT algorithms
  • Examples
  • Home
  • Local Setup
  • Project structure
  • User Manual