An Introduction to Scikit Learn: The Gold Standard of Python Machine Learning

Layers can be easily defined in a tupleSVMs: for learning decision boundariesNaive Bayes: Direct probabilistic modellingEven beyond that, it has some very convenient and advanced functions not commonly offered by other libraries:Ensemble Methods: Boosting, Bagging, Random Forest, Model voting and averagingFeature Manipulation: Dimensionality reduction, feature selection, feature analysisOutlier Detection: For detecting outliers and rejecting noiseModel selection and validation: Cross-validation, Hyperparamter tuning, and metricsA Taste TestTo give you a taste of just how easy it is to train and test an ML model using Scikit Learn, here’s an example of how to do just that for a Decision Tree Classifier!Decision trees for both classification and regression are super easy to use in Scikit Learn with a built in class..We’ll first load in our dataset which actually comes built into the library..Then we’ll initialise our decision tree for classification, also a built in class..Running training is then a simple one-liner!.The .fit(X, Y) function trains the model where X is the numpy array of inputs and Y is the corresponding numpy array of outputsScikit Learn also allows us to visualise our tree using the graphviz library..It comes with a few options that will help in visualising the decision nodes and splits that the model learned which is super useful for understanding how it all works..Below we will colour the nodes based on the feature names and display the class and feature information of each node.Beyond that, Scikit Learn’s documentation is exquisite!.Each of the algorithm parameters are explained clearly and are intuitively named..Moreover, they also offer tutorials with example code on how to train and apply the model, its pros and cons, and practical application tips!Like to learn?Follow me on twitter where I post all about the latest and greatest AI, Technology, and Science!. More details

Leave a Reply