Skip to main content

Kaggle Dataset Analysis : Is your Avocado organic or not?

Hey readers! Today, allow me to present you yet another dataset analysis of a rather gluttony topic, namely Avocado price analysis.

This Data set represents the historical data on avocado prices and sales volume in multiple US markets.



Our prime objectives will be to visualize the dataset, pre-process it and ultimately test multiple sklearn classifiers to checkout which one gives us the best confidence and accuracy for our Avocado's Organic assurance!

Note : I'd like to extend the kernel contribution to Shivam Negi. All this code belongs to him.

Data Visualization

This script must procure the following jointplot 




While a similar joint plot can be drawn for conluding the linearly exponent relations between extra large bags and the small ones.





Pre Processing

The following script has been used for pre processing the input data.




Model Definition and Comparisons

We will be looking mostly at three different models, namely random forest classifiers, KNN and our good old SVM.

Obviously, the Grid search optimization has been used for best results.

Random Forest Classifier





You can see that our model is giving (false positive) + (false negatives) = 3. Total 3 inaccurate predictions which is pretty awesome.



KNN Classifier




So, the performance drops by a total 0f 0.02, not bad at all!
For The SVM Part, I'd recommend that you visit the kernel itself (Link is at the top)

Conclusion

In the end, I would just like to say that we have tried Random Forest Classifier, KNN and SVM but most efficient among them is Random Forest Classifier giving 100% accuracy, KNN is also not too bad as it has 98% accuracy but Support Vector Classifier(SVC) is not that much efficient in predicting the values having only 54% accuracy for conventional and 100% accuracy for organic type. Recommended Model for prediction of TYPE(coventional and organic categories) columns is Random Forest Classifier.

Comments

Total Pageviews

Popular posts from this blog

Your help in Fashion : 7 layer CNN at your service (~92% accurate)

Hey Readers! Welcome to yet another post where I play with a self designed neural network. This CNN would be tackling a variant of classical MNIST known as Fashion MNIST dataset  . Before we start exploring what is the approach for this dataset, let's first checkout what this dataset really is. Fashion-MNIST is a dataset of Zalando's article images—consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes. Zalando intends Fashion-MNIST to serve as a direct drop-in replacement for the original MNIST dataset for benchmarking machine learning algorithms. It shares the same image size and structure of training and testing splits. The original MNIST dataset contains a lot of handwritten digits. Members of the AI/ML/Data Science community love this dataset and use it as a benchmark to validate their algorithms. In fact, MNIST is often the first dataset researchers try. &q

IOT Breakthrough : TensorFlow 1.9 Officially Supports the Raspberry Pi

Hey Readers! Good news for all the "cheap fair power" computer fans, as a result of a major collaboration effort between TensorFlow and Raspberry Pi foundation, one can now install tensorflow precompiled binaries using Python's pip package system !  When TensorFlow was first launched in 2015, they wanted it to be an “ open source machine learning framework for everyone ”. To do that, they needed to run on as many of the platforms that people are using as possible. They have long supported Linux, MacOS, Windows, iOS, and Android, but despite the heroic efforts of many contributors, running TensorFlow on a Raspberry Pi has involved a lot of work. If one is using Rasbian9 they can simply use these 2 commands to install tensorflow on their machine! According to an excerpt from TensorFlow's medium article page :  " We’re excited about this because the Raspberry Pi is used by many innovative developers, and is also widely used in education to