Due to technological, political, or practical considerations, most price mechanisms are not fully differentiated by time, location, and contingency of delivery. Rate or tax designers then face a trade‐off between the costs and benefits of using more complex price schedules. This paper studies the second‐best problem of designing, for a given market segment, a linear pricing schedule with a limited number of distinct prices while facing exogenous constraints within a large and practically relevant family. Interestingly, we find that second‐best prices may be computed using simple machine learning techniques. As an illustration, we apply our framework to retail electricity pricing in California.