Sklearn is clearly one of the most used libraries for Machine Learning, from creating dummy data to saving finalized models.
Let’s go over 3 of its most useful functions:
Feature selection: Sklearn.feature_selection module offers mutliple ways to select the best features in your data.
SelectPercentile selects top features based on the percentile of the highest scores calculated from a scoring function like Chi square.
Pipeline: sklearn.pipeline.make_pipeline is one of the best functions of sklearn.
Pipeline allows you to club all your pre processing functions like imputer, scaler and the final estimator like logistic regression into a single pipeline.
Having this pipeline pre set, you don’t need to repeat the steps again for each dataset and it’s also a crucial player to prevent Data Leakage.
Column Transformer: sklearn.compose.ColumnTransformer is very handy when you want to perform different pre processing and transformation on different columns.
You can explicitly specify column names or list of columns and the transformations to be done on them.
Plus, you can integrate it within a pipeline for a smarter process!
What Sklearn features do you use the most?
#python #machinelearning #datascience