Let's say we have a parameter $r$ and a binary event $A$ repeatedly happens. The event is binary, so the outcome is either $0$ or $1$. We have collected a lot of data of the form $\{\{r_1,A_1\},\{r_2,A_2\},\cdots,\{r_n,A_n\}\}$ where $r_i\in\mathbb{R}$ and $A_i\in\{0,1\}$.
For example: $\{\{-3,0\},\{-2,1\},\{2,1\},\{2,1\},\{1,0\}\}$
Can we somehow estimate the probability of $A$ being $1$ for a certain $r$. From the example data, it seems when $r=2$ that $A=1$ quite certainly. But the data sample is very very large and I'm totally at a loss at how to estimate this probability. When there are a lot of positive outcomes for certain values of $r$ than that increases the probability of a positive outcome for other values close to $r$.
How can all this be accumulated in order to predict (and how confidently) the probability of a positive outcome once we set an arbitrary $r$?