Search code examples
pythonmachine-learningdeep-learningknn

extracting some features from a dataframe column for KNN algorithm


My question is about selecting and extracting some features from a dataframe column. Does that effect in the effectiveness of ML algorithms. For example i'm doing analysis on "Chicago crime Dataset". It has a "Date Of Occurrence" column and it has data in this form: "2018-11-23 05:10:00". What i want to do is, i want to add some extra columns out of this for "year", "month", "weekday", "hour".

Will that effect in efficiency of KNN Classifier algorithm.

This is the link to dataset if you want to check which dataset I'm Talking about.

"https://data.cityofchicago.org/Public-Safety/Crimes-2001-to-present/ijzp-q8t2"


Solution

  • Adding new features always benefits the model learning. It is always recommended to add individual new date features for date columns.

    day month day_of_week year is_it_weekend hour minute AM_PM season