The world’s most valuable company crammed a lot into the tablespoon-sized volume of an Apple Watch. There’s GPS, a heart-rate sensor, cellular connectivity, and computing resources that not long ago would have filled a desk-dwelling beige box. The wonder gadget doesn’t have a sphygmomanometer for measuring blood pressure or polysomnographic equipment found in a sleep lab---but thanks to machine learning, it might be able to help with their work.

Research presented at the American Heart Association meeting in Anaheim Monday claims that, when paired with the right machine-learning algorithms, the Apple Watch’s heart-rate sensor and step counter can make a fair prediction of whether a person has high blood pressure or sleep apnea, in which breathing stops and starts repeatedly through the night. Both are common---and commonly undiagnosed---conditions associated with life-threatening problems, including stroke and heart attack.

The new study adds to evidence that the right algorithms might transform the Apple Watch from personal trainer to personal physician. Apple said in September that it is working on a study with Stanford that will test whether the gadget can detect atrial fibrillation, or irregular heartbeat, which can lead to stroke or heart failure. A study independent of Apple presented in May has already suggested the answer is yes. And health insurer Aetna said last week that it is partnering with Apple to give Apple Watches to members to try to reduce health costs.

The Apple Watch’s potential to predict high blood pressure and sleep apnea was revealed by a collaboration between University of California San Francisco and a startup called Cardiogram. The company offers an app for organizing heart-rate data from an Apple Watch, and other devices with heart-rate sensors. UCSF provided data from more than 6,000 Apple Watch users enrolled in a study on mobile health. Cardiogram’s founders drew on their previous experience as Google employees, working on speech recognition for Android phones and the Google Assistant.

Cardiogram’s engineers took the kind of artificial neural networks that Google and others use to turn our speech into text and adapted them to interpret heart-rate and step count data. (Like speech, they are signals that vary over time.) The system, dubbed DeepHeart, is given strings of heart-rate and step data from multiple people, and information about their health conditions. In May, the company and UCSF released results showing that DeepHeart could figure out how to predict atrial fibrillation from a person's Apple Watch data. The study presented Monday shows that with one week of data on a wearer, the algorithms can predict hypertension with roughly 80 percent accuracy, and sleep apnea with about 90 percent accuracy.

Doctors don’t---and probably couldn’t---diagnose high blood pressure or sleep apnea just by eyeballing a week’s worth of data from your smartwatch. They diagnose hypertension by putting that familiar cuff on your arm. Sleep apnea requires a visit to a sleep clinic, or use of home monitoring equipment. So how do Cardiogram’s algorithms make good guesses without directly measuring a person's blood pressure or breathing? We only sort of know.

Breathing, heart rate, and blood pressure are all connected to our autonomic nervous system, which regulates the unconscious bodily functions that keep us alive. Past research has shown how hypertension and sleep apnea alter the dynamics of heart rate. For example, heart rate variability is lower in people with sleep apnea. But Brandon Ballinger, a Cardiogram cofounder, admits that he doesn’t know all the patterns in a person's heart rate that his algorithms use to make predictions. “They’re kind of a foreign form of intelligence,” says Ballinger.

Ballinger says that, with the right testing, that doesn't prevent his alien intelligence from having business potential. Cardiogram’s app for Apple Watch and other devices is free today. But the startup’s business plan is to one day add features that advise a user to be checked for atrial fibrillation, high blood pressure, or sleep apnea. To stay on the right side of the FDA, the app would have to advise a person to get tested, and not suggest the person has a particular condition. Cardiogram would make money by offering to ship the necessary equipment for a home test, and billing a person's health insurer. The app could also provide advice after a diagnosis, or link people to medical practitioners or health coaches, Ballinger says. He predicts some of these features will appear within months.