My dataset has a timestamp column with the following format: 06/24/18 0:56 How exactly do I convert this information into features that can be used for classification algorithms like logistic regression?
closed as too broad by Mark.F, oW_♦, Esmailian, Ethan, Siong Thye Goh Mar 20 at 1:16
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
A common approach for time-series classification problems is to divide the continuous stream of data into samples of a certain duration.
This is called sliding window segmentation.
You don't really use timestamps as features because they wouldn't be useful during the classification of unseen data. Imagine training a model with data obtained in 2018, and trying to classify data for 2019. The information is not on the dates but in the values of the other features!
Welcome to the site! You will get better answers if you post the language you are working in, but I'll assume python. One of the most basic things you're going to need is to break it down into components. So, let's say your column in the pandas dataframe is named "client_date". You could use:
# Convert the date to something python understands df['client_date'] = pd.to_datetime(df['client_date']) # Get a year df['client_year'] = df['client_date'].dt.year # Get a month df['client_year'] = df['client_date'].dt.month
I think you get the idea and that will help get you started for the rest of your research. Good luck!