def predict(X, name, ds, svc_hostname, cluster_ip):
    formData = {'instances': X}
    headers = {}
    headers['Host'] = svc_hostname
    res = requests.post((((('http://' + cluster_ip) + '/v1/models/') + name) + ':predict'), json=formData, headers=headers)
    if (res.status_code == 200):
        return ds.target_names[np.array(res.json()['predictions'])[0]]
    else:
        print('Failed with ', res.status_code)
        return []
def predict(X, name, ds, svc_hostname, cluster_ip):
    formData = {'instances': X}
    headers = {}
    headers['Host'] = svc_hostname
    res = requests.post((((('http://' + cluster_ip) + '/v1/models/') + name) + ':predict'), json=formData, headers=headers)
    if (res.status_code == 200):
        return ds.target_names[np.array(res.json()['predictions'])[0]]
    else:
        print('Failed with ', res.status_code)
        return []