The relationship between the binding of a ligand to a receptor and activation of biological signaling pathways has remained unclear. The challenge is compounded by functional selectivity, in which a single ligand binding to a single receptor can activate multiple signaling pathways at different levels. Spectroscopic studies show that in the largest class of cell surface receptors, 7 transmembrane receptors, activation is associated with shifts in the equilibria of intracellular pocket conformations. We hypothesized that signaling through the μ opioid receptor, a prototypical 7TMR, is linearly proportional to the equilibrium probability of observing intracellular pocket conformations. Here we show that a machine learning model based on this hypothesis accurately calculates the efficacy of both G protein and β-arrestin-2 signaling. Structural features that the model associates with activation are intracellular pocket expansion, toggle switch rotation, and sodium binding pocket collapse. Distinct pathways are activated by different arrangements of the ligand and sodium binding pockets and the intracellular pocket. Our study provides the first evidence for what could be a scientific law. While recent work has categorized ligands as active or inactive (or partially active) based on binding affinities to two conformations, our approach accurately computes signaling efficacy along multiple pathways.