A Stitch Fix warehouse in San Francisco. The company relies on algorithms to help personalize shipments to customers. One of the best-selling T-shirts for the Indian e-commerce site Myntra is an olive, blue and yellow colorblocked design. It was conceived not by a human but by a computer algorithm — or rather two algorithms.

SwissCognitiveThe first algorithm generated random images that it tried to pass off as clothing. The second had to distinguish between those images and clothes in Myntra’s inventory. Through a long game of one-upmanship, the first algorithm got better at producing images that resembled clothing, and the second got better at determining whether they were like — but not identical to — actual products.

This back and forth, an example of artificial intelligence at work, created designs whose sales are now “growing at 100 percent,” said Ananth Narayanan, the company’s chief executive. “It’s working.” Clothing design is only the leading edge of the way algorithms are transforming the fashion and retail industries. Companies now routinely use artificial intelligence to decide which clothes to stock and what to recommend to customers.

And fashion, which has long shed blue-collar jobs in the United States, is in turn a leading example of how artificial intelligence is affecting a range of white-collar work as well. That’s especially true of jobs that place a premium on spotting patterns, from picking stocks to diagnosing cancer.

“A much broader set of tasks will be automated or augmented by machines over the coming years,” Erik Brynjolfsson, an economist at the Massachusetts Institute of Technology, and Tom Mitchell, a Carnegie Mellon computer scientist, wrote in the journal Science last year. They argued that most of the jobs affected would become partly automated rather than disappear altogether.

The fashion industry illustrates how machines can intrude even on workers known more for their creativity than for cold empirical judgments. Among those directly affected will be the buyers and merchandise planners who decide which dresses, tops and pants should populate their stores’ inventory. Merchandise planners then use the buyer’s input to figure out what mix of clothing — say, how many sandals, pumps and flats — will help the company reach its sales goals. In the small but growing precincts of the industry where high-powered algorithms roam free, however, it is the machine — and not the buyer’s gut — that often anticipates what customers will want. […]