The AMD Ryzen 7 1700 wins in 8 out of 14 comparable specs, with 4 ties. Its biggest advantage is L2 Cache (167% better).
Core i7-8700K wins in 2 specs (Boost Clock: 27% better).
Recommendation
Choose Ryzen 7 1700 if you want the best overall performance — especially l2 cache.
Choose Core i7-8700K if boost clock matters more to you.