The post can be made better by adding some hands on session for the above algorithm.
Yes it can be done , but you need to use another algorithm for it , which is known as Support Vector Machine.
For understanding Support Vector Machines go here
There some errors in the code that I would like to point out.
prediction = diabetesLoadedModel.predict(sampleDataFeatures)
Here instead of diabetesLoadedModel, it should be diabetesCheck because the name of themodel which we trained earlier was this.
labels = list(trainData.columns)
Also , here the columns function apply only to the dataframe , but we have converted the trainData variable to an array using np.asarray(), so this throws an error , instead use this :