# Active Learning for Metamodels

**URL:** <https://uqworld.org/t/active-learning-for-metamodels/1656>\
**Category:** Community Q&A and How To\
**Created:** [July 5, 2022, 12:08pm UTC](https://uqworld.org/t/active-learning-for-metamodels/1656 "2022-07-05T12:08:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cedric](https://uqworld.org/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@Cedric](https://uqworld.org/u/Cedric)\
**Post date:** [July 5, 2022, 12:08pm UTC](https://uqworld.org/t/active-learning-for-metamodels/1656/1 "2022-07-05T12:08:50Z")

</div>

Hello,

I noticed that Active Learning is available as part of RBDO and as part of Reliability Analysis. Is there any way to do Active Learning independent of those? I’d like to refine the metamodels to use them in my custom frameworks. Basically I’m looking for something like:

myModel = refine(myModel, N\_samples, ‘LearningFunction’, ‘U’)

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![bsudret](https://uqworld.org/user_avatar/uqworld.org/bsudret/32/224_2.png) [@bsudret](https://uqworld.org/u/bsudret)\
**Post date:** [July 6, 2022, 2:02pm UTC](https://uqworld.org/t/active-learning-for-metamodels/1656/2 "2022-07-06T14:02:57Z")

</div>

Dear Cedric

Thanks for your question. There isn’t any such function in UQLab for now because active learning in general works with specific goals. Meaning, you enrich an experimental design in a certain way to improve the accuracy of a surrogate model _in a certain domain for a certain usage_. For instance, for reliability analysis, it would be “around the limit state surface g(\textbf{x}) = 0”.

However, as all ingredients are available in UQLab, you can easily write your own active learning algorithm using a loop that goes through the following steps:

- Fit a surrogate to the _current_ data set (a.k.a. experimental design)
- Use the surrogate for its purpose (e.g., compute a probability of failure p\_f, a minimum, etc.)
- Check if this process has converged (e.g., p\_f or current minimum is stable over last iterations)
- If `notConverged`, evaluate your learning function on a set of candidate points, find the best point(s) to add to ED, and go back to step 1.

Good luck!  
Bruno
