Introduction to scikit-learn

Introduction to scikit-learn#

Learning Objectives#

After working through this topic, you should be able to:

  • list the basic steps for running machine algorithms using scikit-learn:

    1. Arrange data into a features matrix / target vector, split into training / test sets

    2. Choose a class of models by importing the appropriate estimator

    3. Set hyperparameters by instantiating this class

    4. Fit the model to your data by calling the fit() method on the model instance

    5. Apply the model to new data using the predict() method

    6. Evaluate the quality of predictions

  • run machine learning algorithms using scikit-learn

  • explain the intuition behind the different scores used to evaluate the quality of predictions:

    • accuracy

    • precision

    • recall

    • F1 score

Materials#

Video:

Download the slides.