The Yoga series is the product of Lenovo’s idea of making a popular convertible laptop. Microsoft aimed to do pretty much the same thing with the convertible tablet Surface Pro. In fact, both of them are portable devices with large touch screens that offer you a lot of flexibility with the fact that you can use the keyboard or not. If you want the keyboard to stay attached, maybe it would be better to choose a Yoga product.
The Yoga X1 model has a bigger screen then the Surface Pro 4, offering 14 inches instead of 12.3. The model for 2017 offers three options for the display: the OLED WQHD (2560×1440 pixels resolution), WQHD IPS, and FHD IPS (1920×1080). Meanwhile, the Surface Pro 4 has a PixelSense display which is not as good as the Yoga one, but it has a higher resolution: 2736×1824.
The X1 Yoga model is very portable, but Surface Pro 4 is better at this point. The latter is just 0.52 inches thick, while the Lenovo product is 0.69 inches, with the OLED version being 0.67 inches. Moreover, the Surface Pro 4 is lighter, with a weight of 2.37 pounds, as opposed to the non-OLED X1 Yoga which is 1/3 heavier, with 3.13 pounds.
The X1 Yoga runs on the latest processor made by Intel, namely the seventh gen of Intel Core i5 or i7. Meanwhile, the Surface Pro 4 only uses sixth gen CPUs, Core m3, Core i5 or i7.
All in all, both of them are great devices, but it matters what you need most and what do you like to have on a portable laptop. Of course, flexibility is the most important for these laptops, but there are other specs that make the difference and help you decide.