Update README.md

This commit is contained in:
André Almeida 2019-05-09 07:43:20 -07:00
parent 3295a743ef
commit 93be638d07

View File

@ -4,12 +4,11 @@ This repository have two different exercises in erlang:
1. Decision tree that maximizes the optimal point and consequently provides decision support based on the assumptions provided.
* The probability of making a medication/treatment 1 and use is OK of 42%;
* One possibility of making a medication/treatment 1 and of the user staying KO is 22.5%;
* The probability of making a medication/treatment 1 and is not conclusive is 35.6%;
* The probability of making a medication/treatment 2 and staying OK is 62%;
* The probability of making a medication/treatment 2 and getting KO is 38%.
* The probability of making a medication/treatment 1 and use is OK of 42%;
* One possibility of making a medication/treatment 1 and of the user staying KO is 22.5%;
* The probability of making a medication/treatment 1 and is not conclusive is 35.6%;
* The probability of making a medication/treatment 2 and staying OK is 62%;
* The probability of making a medication/treatment 2 and getting KO is 38%.
![alt text](https://i.postimg.cc/5207cpvs/Captura-de-ecr-2019-04-09-s-13-06-01.png)
@ -17,6 +16,7 @@ This repository have two different exercises in erlang:
2. There are ways to get the probabilities knowing certain parameters (they do not indicate the optimal point, but calculate a probability of success depending on the existing resources) - using the baysian networks.
What is the probability of giving the patient M2 and is OK, knowing that:
* The probability of administering M1 and the patient is OK is 20%;
* The probability of administering M2 knowing that I administered M1 and the patient being OK is 70%;
* The probability of administering M2 knowing that I did not administer M1 and the patient is OK of 20%.
@ -31,17 +31,20 @@ Basic knowledge of erlang, algorithm and statistics.
### Install or use Docker
If you prefer install the erlang compiler, please search for the appropriate installation for your OS.
If you prefer you can use Docker to test this solution.
If you prefer you can use Docker to test this solution.
Get a docker container like https://hub.docker.com/r/bitwalker/alpine-erlang and start the container:
* docker run --rm -it --user=root bitwalker/alpine-erlang
`docker run --rm -it --user=root bitwalker/alpine-erlang`
### Run the solution
1. For the first exercise (Decision Tree):
```
c(engine).
engine:doAll().
```
and the best solution is:
@ -50,12 +53,15 @@ and the best solution is:
2. For the second exercise (Baysian Networks):
```
c(engine2).
engine2:getp({m2, ok}).
```
![alt text](httpshttps://i.postimg.cc/QxBm0Vrz/Captura-de-ecr-2019-04-09-s-15-57-38.png)
There is a 16% chance that the patient will be OK administering the drug M2.
**There is a 16% chance that the patient will be OK administering the drug M2.**
## Built With