  In this work, we show a correspondence between linear support vector machines
(SVMs) and entanglement witnesses, and use this correspondence to generate
entanglement witnesses for bipartite and tripartite qubit (and qudit) target
entangled states. An SVM allows for the construction of a hyperplane that
clearly delineates between separable states and the target entangled state;
this hyperplane is a weighted sum of observables ('features') whose
coefficients are optimized during the training of the SVM. We demonstrate with
this method the ability to obtain witnesses that require only local
measurements even when the target state is a non-stabilizer state. Furthermore,
we show that SVMs are flexible enough to allow us to rank features, and to
reduce the number of features systematically while bounding the inference
error. This allows us to derive W state witnesses capable of detecting
entanglement with fewer measurement terms than the fidelity method dominant in
today's literature. The utility of this approach is demonstrated on quantum
hardware furnished through the IBM Quantum Experience.
