本文整理汇总了Python中pystruct.learners.FrankWolfeSSVM.predict方法的典型用法代码示例。如果您正苦于以下问题:Python FrankWolfeSSVM.predict方法的具体用法?Python FrankWolfeSSVM.predict怎么用?Python FrankWolfeSSVM.predict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pystruct.learners.FrankWolfeSSVM
的用法示例。
在下文中一共展示了FrankWolfeSSVM.predict方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CRFTrainer
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
class CRFTrainer(object):
def __init__(self, c_value, classifier_name='ChainCRF'):
self.c_value = c_value
self.classifier_name = classifier_name
if self.classifier_name == 'ChainCRF':
model = ChainCRF()
self.clf = FrankWolfeSSVM(model=model, C=self.c_value, max_iter=50)
else:
raise TypeError('Invalid classifier type')
def load_data(self):
letters = load_letters()
X, y, folds = letters['data'], letters['labels'], letters['folds']
X, y = np.array(X), np.array(y)
return X, y, folds
# X is a numpy array of samples where each sample
# has the shape (n_letters, n_features)
def train(self, X_train, y_train):
self.clf.fit(X_train, y_train)
def evaluate(self, X_test, y_test):
return self.clf.score(X_test, y_test)
# Run the classifier on input data
def classify(self, input_data):
return self.clf.predict(input_data)[0]
示例2: CRFTrainer
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
class CRFTrainer(object):
def __init__(self, c_value, classifier_name='ChainCRF'):
self.c_value = c_value
self.classifier_name = classifier_name
if self.classifier_name == 'ChainCRF':
model = ChainCRF()
self.clf = FrankWolfeSSVM(model=model, C=self.c_value, max_iter=50)
else:
raise TypeError('Invalid classifier type')
def load_data(self):
letters = load_letters()
X, y, folds = letters['data'], letters['labels'], letters['folds']
X, y = np.array(X), np.array(y)
return X, y, folds
# X是一个由样本组成的numpy数组,每个样本为(字母,数值)
def train(self, X_train, y_train):
self.clf.fit(X_train, y_train)
def evaluate(self, X_test, y_test):
return self.clf.score(X_test, y_test)
# 对输入数据运行分类器
def classify(self, input_data):
return self.clf.predict(input_data)[0]
示例3: n_cross_valid_crf
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def n_cross_valid_crf(X, Y, K, command):
# cross validation for crf
if command == 'write_results':
list_write = list()
cv = KFold(len(X), K, shuffle=True, random_state=0)
for traincv, testcv in cv:
x_train, x_test = X[traincv], X[testcv]
y_train, y_test = Y[traincv], Y[testcv]
crf = ChainCRF(inference_method='max-product', directed=False, class_weight=None)
ssvm = FrankWolfeSSVM(model=crf, C=1.0, max_iter=100)
ssvm.fit(x_train, y_train)
y_pred = ssvm.predict(x_test)
print 'Accuracy of linear-crf %f:' % ssvm.score(x_test, y_test)
if command == 'metrics_F1':
metrics_crf(y_test, y_pred)
elif command == 'confusion_matrix':
confusion_matrix_CRF(y_test, y_pred)
elif command == 'write_results':
list_write += write_results_CRF(testcv, y_test, y_pred)
print '------------------------------------------------------'
print '------------------------------------------------------'
if command == 'write_results':
list_write = sorted(list_write, key=itemgetter(0)) # sorted list based on index
for value in list_write:
pred_list = value[1]
test_list = value[2]
for i in range(0, len(pred_list)):
print str(pred_list[i]) + '\t' + str(test_list[i])
示例4: test_multinomial_blocks_frankwolfe_batch
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def test_multinomial_blocks_frankwolfe_batch():
X, Y = generate_blocks_multinomial(n_samples=10, noise=0.3, seed=0)
crf = GridCRF(inference_method='qpbo')
clf = FrankWolfeSSVM(model=crf, C=1, max_iter=500, batch_mode=True)
clf.fit(X, Y)
Y_pred = clf.predict(X)
assert_array_equal(Y, Y_pred)
示例5: test_multinomial_blocks_frankwolfe
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def test_multinomial_blocks_frankwolfe():
X, Y = generate_blocks_multinomial(n_samples=50, noise=0.5,
seed=0)
crf = GridCRF(inference_method='qpbo')
clf = FrankWolfeSSVM(model=crf, C=1, line_search=True,
batch_mode=False, check_dual_every=500)
clf.fit(X, Y)
Y_pred = clf.predict(X)
assert_array_equal(Y, Y_pred)
示例6: n_cross_valid_crf_candidate
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def n_cross_valid_crf_candidate(list_line, X, Y, K):
list_text = []
for i in range(0, len(list_line), 3):
split_first = 0
split_second = 0
if i % 3 == 0:
split_first = list_line[i].strip().split('\t')
list_text.append(split_first)
list_text = np.array(list_text)
cv = KFold(len(X), K, shuffle=True, random_state=0)
list_write = []
for traincv, testcv in cv:
x_train, x_test = X[traincv], X[testcv]
y_train, y_test = Y[traincv], Y[testcv]
list_text_train, list_text_test = list_text[traincv], list_text[testcv]
crf = ChainCRF(inference_method='max-product', directed=False, class_weight=None)
ssvm = FrankWolfeSSVM(model=crf, C=1.0, max_iter=10)
ssvm.fit(x_train, y_train)
y_pred = ssvm.predict(x_test)
list_wrong = metrics_crf_candidate(list_text_test, y_test, y_pred)
if len(list_write) == 0:
list_write = list_wrong
else:
for i in range(0, len(list_wrong)):
svc = list_wrong[0]
road = list_wrong[1]
busstop = list_wrong[2]
list_write[0] = list_write[0] + svc
list_write[1] = list_write[1] + road
list_write[2] = list_write[2] + busstop
# write_file('d:/', 'wrong_svc', list_write[0])
# write_file('d:/', 'wrong_road', list_write[1])
# write_file('d:/', 'wrong_busstop', list_write[2])
write_file('d:/', 'good_svc', list_write[0])
write_file('d:/', 'good_road', list_write[1])
write_file('d:/', 'good_busstop', list_write[2])
示例7: results_CRFs
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def results_CRFs(X_training, Y_training, X_testing, Y_testing, command):
crf = ChainCRF(inference_method='max-product', directed=False, class_weight=None)
ssvm = FrankWolfeSSVM(model=crf, C=1.0, max_iter=100)
ssvm.fit(X_training, Y_training)
y_pred = ssvm.predict(X_testing)
list_write = list()
print 'Accuracy of linear-crf %f:' % ssvm.score(X_testing, Y_testing)
if command == 'metrics_F1':
metrics_crf(Y_testing, y_pred)
elif command == 'confusion_matrix':
confusion_matrix_CRF(Y_testing, y_pred)
elif command == 'write_results':
list_write = write_CRFs_compare(Y_testing, y_pred)
for value in list_write:
pred_list = value[0]
test_list = value[1]
for i in range(0, len(pred_list)):
print str(pred_list[i]) + '\t' + str(test_list[i])
示例8: CRF_pred_label
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def CRF_pred_label(X, Y, command):
texts = load_demo_text(command)
if command == 'twitter':
convert_texts = filterText_demo(texts, 'removeLink', command)
X_ftr = load_demo_ftr(command)
print len(convert_texts), len(X_ftr)
path_write = 'D:/Project/Transportation_SMU-NEC_collaboration/Data_demo_Dec_2015/twitter'
name_write = 'pred_label_' + command
elif command == 'sgforums':
convert_texts = filterText_demo(texts, 'removePunc', command)
X_ftr = load_demo_ftr(command)
print len(convert_texts), len(X_ftr)
path_write = 'D:/Project/Transportation_SMU-NEC_collaboration/Data_demo_Dec_2015/sgforums'
name_write = 'pred_label_' + command
elif command == 'facebook':
convert_texts = filterText_demo(texts, 'removeLink', command)
X_ftr = load_demo_ftr(command)
print len(convert_texts), len(X_ftr)
path_write = 'D:/Project/Transportation_SMU-NEC_collaboration/Data_demo_Dec_2015/facebook'
name_write = 'pred_label_' + command
crf = ChainCRF(inference_method='max-product', directed=False, class_weight=None)
ssvm = FrankWolfeSSVM(model=crf, C=1.0, max_iter=100)
ssvm.fit(X, Y)
y_pred = ssvm.predict(X_ftr)
list_write = list()
for line in y_pred:
labels = ''
for label in line:
labels += str(label) + '\t'
list_write.append(labels.strip())
write_file(path_write, name_write, list_write)
示例9: time
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
subgradient_svm.fit(X_train_bias, y_train)
time_subgradient_svm = time() - start
y_pred = np.hstack(subgradient_svm.predict(X_test_bias))
print("Score with pystruct subgradient ssvm: %f (took %f seconds)"
% (np.mean(y_pred == y_test), time_subgradient_svm))
# the standard one-vs-rest multi-class would probably be as good and faster
# but solving a different model
libsvm = LinearSVC(multi_class='crammer_singer', C=.1)
start = time()
libsvm.fit(X_train, y_train)
time_libsvm = time() - start
print("Score with sklearn and libsvm: %f (took %f seconds)"
% (libsvm.score(X_test, y_test), time_libsvm))
start = time()
fw_bc_svm.fit(X_train_bias, y_train)
y_pred = np.hstack(fw_bc_svm.predict(X_test_bias))
time_fw_bc_svm = time() - start
print("Score with pystruct frankwolfe block coordinate ssvm: %f (took %f seconds)" %
(np.mean(y_pred == y_test), time_fw_bc_svm))
start = time()
fw_batch_svm.fit(X_train_bias, y_train)
y_pred = np.hstack(fw_batch_svm.predict(X_test_bias))
time_fw_batch_svm = time() - start
print("Score with pystruct frankwolfe batch ssvm: %f (took %f seconds)" %
(np.mean(y_pred == y_test), time_fw_batch_svm))
示例10: trainModel_Basic
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def trainModel_Basic(num_iter=5,inference="qpbo",trainer="NSlack",num_train=2,num_test=1,C=0.1,edges="180x180_dist1_diag0",inputs=[1,1,1,1,1,1],features="all",directed=False,savePred=False):
padding=(30,30,30,30)
if directed==True:
features +='+directed'
resultsDir = os.getcwd()+'/CRFResults'
nameLen = len(os.listdir(resultsDir))
edgeFeature = edges
filename=str(nameLen)+'_CRF_iter_'+str(num_iter)+"_"+inference+"_"+trainer+"_"+features+"_"+str(num_train)+"_"+str(num_test)+"_"+edgeFeature
print "Loading training slices"
start = time.clock()
train =extractSlices2(train_path,num_train,padding,inputs=inputs)
end= time.clock()
train_load_time = (end-start)/60.0
[trainLayers,trainTruth,sliceShape] = train
print "Training slices loaded in %f" % (train_load_time)
n_features= len(trainLayers[0][0,0])
print "Layer shape is : "
print trainLayers[0].shape
print "Training the model"
edges= np.load("/home/bmi/CRF/edges/"+edges+".npy")
G = [edges for x in trainLayers]
print trainLayers[0].shape
trainLayers = np.array( [x.reshape((sliceShape[0]*sliceShape[1],n_features)) for x in trainLayers] )
trainTruth = np.array( [x.reshape((sliceShape[0]*sliceShape[1],)).astype(int) for x in trainTruth] )
if inference=='ogm':
crf = GraphCRF(inference_method=('ogm',{'alg':'fm'}),directed=directed)
else:
crf = GraphCRF(inference_method=inference,directed=directed)
if trainer=="Frank":
svm = FrankWolfeSSVM(model = crf,max_iter=num_iter,C=C,n_jobs=6,verbose=1)
elif trainer=="NSlack":
svm = NSlackSSVM(model = crf,max_iter=num_iter,C=C,n_jobs=-1,verbose=1)
else:
svm = OneSlackSSVM(model = crf,max_iter=num_iter,C=C,n_jobs=-1,verbose=1)
start = time.clock()
asdf = zip(trainLayers,G)
svm.fit(asdf,trainTruth)
end = time.clock()
train_time = (end-start)/60.0
print "The training took %f" % (train_time)
print "Model parameter size :"
print svm.w.shape
print "making predictions on train data"
predTrain = svm.predict(asdf)
trainDice=[]
for i in range(len(trainLayers)):
diceScore = accuracy(predTrain[i],trainTruth[i])
trainDice.append(diceScore)
meanTrainDice = sum(trainDice)/len(trainLayers)
del trainLayers,trainTruth
################################################################################################
overallDicePerPatient=[] # For overall test Dice
extDicePerPatient=[]
PatientTruthLayers=[]
PatientPredLayers=[]
PREC=[]
RECALL=[]
F1=[]
LayerwiseDiceTotal=[]
testResultFile = open(os.getcwd()+"/CRFResults/"+filename+".csv",'a')
testResultFile.write("folderName,numLayers, Overall Dice, precision , recall, F1"+"\n")
counter=0
print "Loading the test slices"
for folder in os.listdir(test_path):
path = test_path + "/" + folder
layerDiceScores=''
# print path
data = extractTestSlices2(path,padding,inputs=inputs)
if data!=0:
[testLayers,testTruth,sliceShape,startSlice,endSlice] = data
#.........这里部分代码省略.........
示例11: max
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
rnd = np.random.RandomState(1)
selected = rnd.randint(len(y_test), size=n_words)
max_word_len = max([len(y_) for y_ in y_test[selected]])
fig, axes = plt.subplots(n_words, max_word_len, figsize=(10, 10))
fig.subplots_adjust(wspace=0)
fig.text(0.2, 0.05, 'GT', color="#00AA00", size=25)
fig.text(0.4, 0.05, 'NN', color="#5555FF", size=25)
fig.text(0.6, 0.05, 'LCCRF', color="#FF5555", size=25)
fig.text(0.8, 0.05, 'LCCRF+NN', color="#FFD700", size=25)
fig.text(0.05, 0.5, 'Word', color="#000000", size=25)
fig.text(0.5, 0.95, 'Letters', color="#000000", size=25)
for ind, axes_row in zip(selected, axes):
y_pred_nn = nn_predictions_test[ind].argmax(axis=1)
y_pred_chain = chain_ssvm.predict([X_test[ind]])[0]
y_pred_chain_nn = chain_ssvm_nn.predict([nn_predictions_test[ind]])[0]
for i, (a, image, y_true, y_nn, y_chain, y_chain_nn) in enumerate(
zip(axes_row, X_test[ind], y_test[ind], y_pred_nn, y_pred_chain, y_pred_chain_nn)):
a.matshow(image.reshape(16, 8), cmap=plt.cm.Greys)
a.text(0, 3, abc[y_true], color="#00AA00", size=25) # Green
a.text(0, 14, abc[y_nn], color="#5555FF", size=25) # Blue
a.text(5, 14, abc[y_chain], color="#FF5555", size=25) # Red
a.text(5, 3, abc[y_chain_nn], color="#FFD700", size=25) # Yellow
a.set_xticks(())
a.set_yticks(())
for ii in range(i + 1, max_word_len):
axes_row[ii].set_visible(False)
w = chain_ssvm_nn.w[26 * 26:].reshape(26, 26)
示例12: classify
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
def classify(traincorpus, testcorpus):
model = ChainCRF()
ssvm = FrankWolfeSSVM(model=model, C=.1, max_iter=10)
pos_lexicon = load_lexicon("lexica/restaurants/ote/pos")
term_lexicon = load_lexicon("lexica/restaurants/ote/term")
pre1_lexicon = load_lexicon("lexica/restaurants/ote/prefix1")
pre2_lexicon = load_lexicon("lexica/restaurants/ote/prefix2")
pre3_lexicon = load_lexicon("lexica/restaurants/ote/prefix3")
suf1_lexicon = load_lexicon("lexica/restaurants/ote/suffix1")
suf2_lexicon = load_lexicon("lexica/restaurants/ote/suffix2")
suf3_lexicon = load_lexicon("lexica/restaurants/ote/suffix3")
train_sentences = [] #the list to be used to store our features for the words
sentence_labels = [] #the list to be used for labeling if a word is an aspect term
print('Creating train feature vectors...')
#extracting sentences and appending them labels
for instance in traincorpus.corpus:
words = nltk.word_tokenize(instance.text)
tags = nltk.pos_tag(words)
tags_list = [] #the pos list
for _, t in tags:
tags_list.append(t)
last_prediction = ""
train_words = []
word_labels = []
for i, w in enumerate(words):
word_found = False
if words[i] == w:
word_found = True
pos_feats = []
previous_pos_feats = []
second_previous_pos_feats = []
next_pos_feats = []
second_next_pos_feats = []
morph_feats = []
term_feats = []
pre1_feats = []
pre2_feats = []
pre3_feats = []
suf1_feats = []
suf2_feats = []
suf3_feats = []
target_labels = []
train_word_features = []
#prefix of lengths 1,2,3 lexicon features
for p1 in pre1_lexicon:
if p1 == w[0]:
pre1_feats.append(1)
else:
pre1_feats.append(0)
for p2 in pre2_lexicon:
if len(w) > 1:
if p2 == w[0]+w[1]:
pre2_feats.append(1)
else:
pre2_feats.append(0)
else:
pre2_feats.append(0)
for p3 in pre3_lexicon:
if len(w) > 2:
if p3 == w[0]+w[1]+w[2]:
pre3_feats.append(1)
else:
pre3_feats.append(0)
else:
pre3_feats.append(0)
#suffix of lengths 1,2,3 lexicon features
for s1 in suf1_lexicon:
if s1 == w[-1]:
suf1_feats.append(1)
else:
suf1_feats.append(0)
for s2 in suf2_lexicon:
if len(w) > 1:
if s2 == w[-2]+w[-1]:
suf2_feats.append(1)
else:
suf2_feats.append(0)
else:
suf2_feats.append(0)
for s3 in suf3_lexicon:
if len(w) > 2:
if s3 == w[-3]+w[-2]+w[-1]:
suf3_feats.append(1)
else:
#.........这里部分代码省略.........
示例13: max
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
rnd = np.random.RandomState(1)
selected = rnd.randint(len(y_test), size=n_words)
max_word_len = max([len(y_) for y_ in y_test[selected]])
fig, axes = plt.subplots(n_words, max_word_len, figsize=(10, 10))
fig.subplots_adjust(wspace=0)
fig.text(0.2, 0.05, 'GT', color="#00AA00", size=25)
fig.text(0.4, 0.05, 'SVM', color="#5555FF", size=25)
fig.text(0.6, 0.05, 'UD-LCCRF', color="#FF5555", size=25)
fig.text(0.8, 0.05, 'D-LCCRF', color="#FFD700", size=25)
fig.text(0.05, 0.5, 'Word', color="#000000", size=25)
fig.text(0.5, 0.95, 'Letters', color="#000000", size=25)
for ind, axes_row in zip(selected, axes):
y_pred_svm = svm.predict(X_test[ind])
y_pred_undirected = undirected_ssvm.predict([X_test[ind]])[0]
y_pred_crf = ssvm.predict([X_test[ind]])[0]
for i, (a, image, y_true, y_svm, y_undirected, y_crf) in enumerate(
zip(axes_row, X_test[ind], y_test[ind], y_pred_svm, y_pred_undirected, y_pred_crf)):
a.matshow(image.reshape(16, 8), cmap=plt.cm.Greys)
a.text(0, 3, abc[y_true], color="#00AA00", size=25) # Green
a.text(0, 14, abc[y_svm], color="#5555FF", size=25) # Blue
a.text(5, 14, abc[y_undirected], color="#FF5555", size=25) # Red
a.text(5, 3, abc[y_crf], color="#FFD700", size=25) # Yellow
a.set_xticks(())
a.set_yticks(())
for ii in range(i + 1, max_word_len):
axes_row[ii].set_visible(False)
w = ssvm.w[26 * 8 * 16:].reshape(26, 26)
示例14: print
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
ssvm.fit(X_train, y_train)
print("Test score with chain CRF: %f" % ssvm.score(X_test, y_test))
print("Test score with linear SVM: %f" % svm.score(np.vstack(X_test), np.hstack(y_test)))
# plot some word sequenced
n_words = 4
rnd = np.random.RandomState(1)
selected = rnd.randint(len(y_test), size=n_words)
max_word_len = max([len(y_) for y_ in y_test[selected]])
fig, axes = plt.subplots(n_words, max_word_len, figsize=(10, 10))
fig.subplots_adjust(wspace=0)
for ind, axes_row in zip(selected, axes):
y_pred_svm = svm.predict(X_test[ind])
y_pred_chain = ssvm.predict([X_test[ind]])[0]
for i, (a, image, y_true, y_svm, y_chain) in enumerate(
zip(axes_row, X_test[ind], y_test[ind], y_pred_svm, y_pred_chain)
):
a.matshow(image.reshape(16, 8), cmap=plt.cm.Greys)
a.text(0, 3, abc[y_true], color="#00AA00", size=25)
a.text(0, 14, abc[y_svm], color="#5555FF", size=25)
a.text(5, 14, abc[y_chain], color="#FF5555", size=25)
a.set_xticks(())
a.set_yticks(())
for ii in range(i + 1, max_word_len):
axes_row[ii].set_visible(False)
plt.matshow(ssvm.w[26 * 8 * 16 :].reshape(26, 26))
plt.colorbar()
plt.title("Transition parameters of the chain CRF.")
示例15: ChainCRF
# 需要导入模块: from pystruct.learners import FrankWolfeSSVM [as 别名]
# 或者: from pystruct.learners.FrankWolfeSSVM import predict [as 别名]
list_x.append(np.array(x_1))
list_y.append(y)
list_y.append(y_1)
# crf = ChainCRF(inference_method='max-product')
crf = ChainCRF(inference_method="max-product", directed=False)
ssvm = FrankWolfeSSVM(model=crf, C=1.0, max_iter=100)
ssvm.fit(np.array(list_x), np.array(list_y))
test_x = np.array(list_x)
test_y = np.array(list_y)
# print np.array(list_x)[0].shape[1]
x_test = [[1, 0, 0, 0], [1, 0, 1, 0]]
list_x_test = list()
list_x_test.append(x_test)
pred = ssvm.predict(np.array(list_x_test))
# for value in pred:
# print value
# file_model = pickle.dumps(ssvm)
# load_model = pickle.loads(file_model)
joblib.dump(ssvm, "d:/filename.pkl")
load_model = joblib.load("d:/filename.pkl")
output = load_model.predict(np.array(list_x_test))
for value in output:
print value