# Ocena polityki off-policy (OPE)

EN: **Off-policy evaluation (OPE)** · id `ope` · aliases: off-policy evaluation, OPE, off-policy value evaluation, ocena off-policy, importance sampling estimators, doubly robust estimator, estymator podwójnie odporny

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Uczenie ze wzmocnieniem i decyzje](https://aiatlasgraph.com/t/decisions.md) › [Offline RL i eksploracja](https://aiatlasgraph.com/t/offline.md) › Ocena polityki off-policy (OPE)

## Description

- PL: Szacowanie, jak dobra byłaby nowa polityka, wyłącznie z danych zebranych przez inną politykę, bez jej uruchamiania. Często krytyczny krok przed wdrożeniem RL w realnych systemach.
- EN: Estimating how good a new policy would be using only data collected by a different policy, without running it. Often a critical step before deploying RL in real systems.

## In one sentence

- PL: To sprawdzanie, jak sprawdziłby się nowy sposób działania, na podstawie starych zapisów, zanim go uruchomisz.
- EN: This checks how a new way of acting would perform, using old records, before you switch it on.

## Problem it solves

- PL: Uruchomienie niesprawdzonej strategii na prawdziwych ludziach lub pieniądzach jest ryzykowne, a dane masz tylko z obecnego sposobu działania.
- EN: Running an untested strategy on real people or money is risky, and you only have data from how things are done today.

## What it does

- PL: Jak ocena nowej trasy autobusu z danych o dotychczasowych przejazdach: przeważasz kursy podobne do nowej trasy, zamiast od razu zmieniać rozkład.
- EN: Like judging a new bus route from records of past trips: you give more weight to journeys resembling the new route instead of changing the timetable straight away.

## Everyday example

- PL: Sklep internetowy ma zapis, jakie rabaty pokazywał klientom; zanim wprowadzi nowy sposób ich doboru, szacuje jego wynik z tych zapisów.
- EN: An online shop has records of which discounts it showed customers; before introducing a new way to choose them, it estimates the result from those records.

## This concerns you if you…

- PL: masz dużo danych z obecnego systemu, ale nie możesz łatwo testować nowych
- PL: musisz uzasadnić zmianę strategii przed jej wdrożeniem
- PL: pracujesz z rekomendacjami, medycyną lub finansami, gdzie błędy kosztują
- EN: have lots of data from the current system but cannot easily test new ones
- EN: must justify a strategy change before rolling it out
- EN: work with recommendations, medicine or finance, where mistakes are costly

## Keywords

importance sampling · doubly robust estimator · fitted Q evaluation · weighted importance sampling · per-decision importance sampling · counterfactual evaluation · safe policy improvement · logged bandit feedback

## How it works

- PL: Estymatory z próbkowaniem ważonym przeważają zwroty w danych ilorazem prawdopodobieństw akcji nowej i starej polityki – są nieobciążone, ale mają dużą wariancję. Metody oparte na modelu uczą funkcji wartości lub dynamiki i mają mniejszą wariancję, ale obciążenie. Estymator podwójnie odporny łączy oba podejścia: pozostaje nieobciążony i może mieć znacznie mniejszą wariancję.
- EN: Importance-sampling estimators reweight returns in the data by the ratio of action probabilities under the new and old policy – unbiased but high-variance. Model-based methods learn a value function or dynamics and have lower variance but bias. The doubly robust estimator combines both: it stays unbiased and can have much lower variance.

## Limits

- PL: Gdy nowa polityka wybiera działania rzadko lub nigdy niewidziane w danych, żaden estymator nie da wiarygodnej oceny. Wariancja próbkowania ważonego rośnie wykładniczo z długością horyzontu; potrzebne są też zapisane prawdopodobieństwa starej polityki.
- EN: When the new policy picks actions rarely or never seen in the data, no estimator gives a reliable answer. Importance-sampling variance grows exponentially with horizon length, and the old policy's action probabilities must be logged.

## Key terms

- PL: **polityka zbierająca**: Polityka, która wygenerowała zapisane dane.
- PL: **próbkowanie ważone**: Przeważanie wyników ilorazem prawdopodobieństw działań dwóch polityk.
- PL: **estymator podwójnie odporny**: Połączenie modelu wartości z próbkowaniem ważonym, poprawne, gdy jedno z nich jest dobre.
- EN: **behaviour policy**: The policy that generated the logged data.
- EN: **importance sampling**: Reweighting outcomes by the ratio of two policies' action probabilities.
- EN: **doubly robust estimator**: Combining a value model with importance sampling, correct if either is good.

## Know first

- [Funkcje wartości i równanie Bellmana (Value functions and the Bellman equation)](https://aiatlasgraph.com/t/bellman.md)
- [Wielorękie bandyty: eksploracja kontra eksploatacja (Multi-armed and contextual bandits)](https://aiatlasgraph.com/t/bandits.md)

## Examples

- PL: próbkowanie ważone · estymator podwójnie odporny · dopasowana ocena Q
- EN: importance sampling · doubly robust estimator · fitted Q evaluation

## Related topics

Untyped, symmetric "see also" links.

- [Konserwatywne offline RL (CQL, IQL) (Conservative offline RL)](https://aiatlasgraph.com/t/conservativeoffline.md)
- [Testy A/B funkcji AI (A/B testing AI features)](https://aiatlasgraph.com/t/abtesting.md)

## Sources

- [Doubly Robust Off-policy Value Evaluation for Reinforcement Learning](<https://arxiv.org/abs/1511.03722>) `doubly-robust-ope-2015` · by Nan Jiang, Lihong Li

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/ope · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
