I made a machine learning project to detect plant diseases using haralick textures from images, I trained and it predicting in 90% accuracy. Now i got a situation that i need to print 3 probable diseases on one image. Example i uploaded one image and predicted it got ‘Fungus’ and also give other 3 probable diseases. I’m new to Python Sklearn,i struggled to get the predict_probe work using ‘LinearSVC’ I got the predit_probe printed but its in binary array how to convert to text?
Here is the code am working
clf_svm = LinearSVC(random_state=9, dual=False, max_iter=1000)
model = CalibratedClassifierCV(clf_svm)
# fit the training data and labels print ("[STATUS] Fitting data/label to model..") model.fit(train_features, train_labels) prediction = model.predict(features.reshape(1, -1)) model.fit(train_features, train_labels) y_proba = model.predict_proba(train_features) #y_proba = regressor.predict(np.array([6.5]).reshape(1, 1)) top_3 = np.argsort(y_proba, axis = 1)[:,1] print ("probably" , top_3 )