Training and learning are different. Training is knowledge forced into a brain from the outside, and learning is knowledge allowed in from the inside.
Kids and dogs have brains and can therefore be trained, like to use the potty or go outside (the dogs, not the kids). They can also learn, like when kids discover the "facts of life" or dogs learn that you'll feed them if they beg. Not to imply that all brains can be trained, however, as evidenced by an animal called a cat. Cats can learn okay, like to come to the sound of a can-opener, but that's not training. They're just doing whatever they want to do, which is what they always do anyway.
Car computers can do both; be trained, (programmed) and learn, which is what they do when they calibrate themselves to a particular driving style. Yes, they can actually do that. It's called "adaptive re-learning." It's the computer's built-in ability to automatically adjust various things like idle speeds and transmission shifting points. Some people drive more aggressively than others, revving the engine higher as they accelerate through the gears, and the computer will adapt to that style after a while. Also, as things wear out on the car, changing the way parts fit together, the computer will adapt to compensate for the change in the fit. Sort of like an elastic waist-band on your "relaxed fit" or "Mom" jeans.
Here's the rub. If the battery is disconnected for any reason, or the computer or a computer sensor is removed and reconnected, the computer usually goes back to factory specifications. It forgets what it had learned about recent driver habits, and it starts everything over again. It will take a number of start-ups and trips around town before it settles in again. You know the saying: "If I knew before what I know nowetc.," well this is the computer saying: "If I knew now what I knew before, then things would be better." But it doesn't, so you may feel a difference in the way it behaves. Sometimes it may even allow the engine to stall out when it tries to find the idle speed. Many times people run back to a garage complaining about "new" problems that they didn't have before it was worked on there. (So naturally the mechanic caused the problems, everybody knows that).
Ironically, if two or more people with different driving styles regularly drive a vehicle, it will never settle on one style to compensate for. It will adjust for worn parts but that's all. These people may not notice a change in behavior after a new battery or similar work, although the computer will still have to re-learn about the worn parts, so there will be some slight changes.
If these things happen to you, you have to treat it like training a dog. Be patient. Show it what you want. Be patient. Do it repeatedly and consistently. Be patient. Give it time to respond. Be patient. Allow a few missteps without giving it a beating. Be patient. And most of all, don't raise your voice at your mechanic. He may have caused it, by unhooking your battery, but he couldn't help it, and he can't fix it. You have to train it to run your way, he can't do that. He can only set it to basics, and you have to wait for it to adapt to worn parts, and to your own, special, fabulous driving style, possibly sabotaged by your spouse.
If you think this is too hard, just be glad it's not a cat.