A trick I learned [fucking with sensors] was to have the key on, turn the TPS (any adjustable sensors) to where it would set the code, then move it ever so slightly, [either way] stop and wait. This is so the black box would continue pinging the tps until it was within spec, turns the code light off fandango. Tighten it down, you are within the ballpark.
Old black box was open loop so the guess was not so much learning? Today's box might take many key turns [of riding] to finally turn the code light off. So the TPS controls the low to mid throttle app. Say the TPS dies, it has a backup to mimic the low/mid and still be safe to ride, cough, to a dealer and repair the system.
Kind of imagine a wall clock is hung on the wall. You keep bumping the clock so it lines up pinpoint vertical, and the clock starts ticking when you hit that sweet spot. Same kind of process tapping to turn the light off that lines up the sensor to spec.