-
Notifications
You must be signed in to change notification settings - Fork 7
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
Request branch2 #22
Open
efekhari27
wants to merge
6
commits into
openturns:master
Choose a base branch
from
efekhari27:request_branch2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Request branch2 #22
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9fb41b6
request class linted
efekhari27 97fb6db
BBRCDistribution class from the csv table
efekhari27 c438f64
Adding Beta table
efekhari27 d8469db
Import distribution and beta table with numpy
efekhari27 9be744f
Tests added for BBRC request classes
efekhari27 4ce8dd1
Merge branch 'master' into request_branch2
mbaudin47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# RequestedBBRCProblem class use case\n", | ||
"\n", | ||
"This example presents a simple use of the RequestedBBRCProblem class." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import openturns as ot\n", | ||
"import otbenchmark as otb" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": "RP8\n" | ||
} | ||
], | ||
"source": [ | ||
"problem = otb.RequestedBBRCProblem(\"testuser\", \"testpass\", -1, 1)\n", | ||
"print(problem.name)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"event = problem.getEvent()\n", | ||
"g = event.getFunction()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "execute_result", | ||
"data": { | ||
"text/plain": "0.0007888456943755395" | ||
}, | ||
"metadata": {}, | ||
"execution_count": 4 | ||
} | ||
], | ||
"source": [ | ||
"problem.getProbability()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Create the Monte-Carlo algorithm\n", | ||
"algoProb = ot.ProbabilitySimulationAlgorithm(event)\n", | ||
"# MaximumOuterSampling set to a very low value to make a fast example.\n", | ||
"# More realistic parameter value (e.g. 1000).\n", | ||
"algoProb.setMaximumOuterSampling(10)\n", | ||
"algoProb.setMaximumCoefficientOfVariation(0.01)\n", | ||
"algoProb.run()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": "Number of function calls = 10\nFailure Probability = 0.0000\n" | ||
} | ||
], | ||
"source": [ | ||
"# Get the results\n", | ||
"resultAlgo = algoProb.getResult()\n", | ||
"neval = g.getEvaluationCallsNumber()\n", | ||
"print(\"Number of function calls = %d\" % (neval))\n", | ||
"# Because of the low value of the maximumOuterSampling, the estimate is not very accurate.\n", | ||
"pf = resultAlgo.getProbabilityEstimate()\n", | ||
"print(\"Failure Probability = %.4f\" % (pf))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.3-final" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
set_id,problem_id,reliability_problem_id,beta | ||
-1,1,8,3.16 | ||
-1,2,22,2.64 | ||
1,1,14,2.42 | ||
1,2,24,2.76 | ||
1,3,28,5.11 | ||
1,4,31,3.58 | ||
1,5,38,2.48 | ||
1,6,53,1.86 | ||
1,7,54,3.09 | ||
1,8,63,3.36 | ||
1,9,75,2.33 | ||
1,10,107,5.0 | ||
1,11,111,4.81 | ||
1,12,201,3.7 | ||
1,13,203,4.92 | ||
1,14,213,3.45 | ||
1,15,300,3.88 | ||
1,16,301,3.81 | ||
2,1,25,4.36 | ||
2,2,33,2.80 | ||
2,3,35,2.70 | ||
2,4,55,-0.15 | ||
2,5,57,1.91 | ||
2,6,60,1.70 | ||
2,7,77,5.0 | ||
2,8,89,2.55 | ||
2,9,91,3.19 | ||
2,10,110,4.0 | ||
2,11,202,3.43 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please insert a comment that explains that your intent in selecting a low value of the maximumOuterSampling : it is chosen to make a fast example, but a more realistic parameter value (e.g. 1000) should be chosen in practice. This will clarify your motivations in the example. Please insert the code to print the estimated probability, because it is the concrete goal of the example but add a comment that explains that, because of the low value of the maximumOuterSampling, the estimate is not very accurate.