How exactly do I go about extracting features from timestamps for machine learning? [on hold]Machine learning - features engineering from date/time dataHow to perform feature engineering on unknown features?Dissmissing features based on correlation with target variableGiving Emails as Input to Machine Learning AlgorithmsHow to find categorical features from a vector representation of text?Extracting meaningful features from clusters and study correlationUsing python and machine learning to extract information from an invoice? Inital dataset?How to model a Machine learning problem considering links between featuresHow can I improve a machine learning model?How to handle date data for Knn?
Where does the bonus feat in the cleric starting package come from?
Create all possible words using a set or letters
Could the E-bike drivetrain wear down till needing replacement after 400 km?
Creature in Shazam mid-credits scene?
Melting point of aspirin, contradicting sources
hline - width of entire table
Can someone explain how this makes sense electrically?
why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?
The Staircase of Paint
I am looking for the correct translation of love for the phrase "in this sign love"
Is a model fitted to data or is data fitted to a model?
Loading commands from file
Is it improper etiquette to ask your opponent what his/her rating is before the game?
Can the Supreme Court Overturn an Impeachment?
Is there a single word describing earning money through any means?
How to explain what's wrong with this application of the chain rule?
What is this called? Old film camera viewer?
Where did Heinlein say "Once you get to Earth orbit, you're halfway to anywhere in the Solar System"?
Is it better practice to read straight from sheet music rather than memorize it?
Travelling outside the UK without a passport
Drawing ramified coverings with tikz
Why is it that I can sometimes guess the next note?
Why did the HMS Bounty go back to a time when whales are already rare?
Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?
How exactly do I go about extracting features from timestamps for machine learning? [on hold]
Machine learning - features engineering from date/time dataHow to perform feature engineering on unknown features?Dissmissing features based on correlation with target variableGiving Emails as Input to Machine Learning AlgorithmsHow to find categorical features from a vector representation of text?Extracting meaningful features from clusters and study correlationUsing python and machine learning to extract information from an invoice? Inital dataset?How to model a Machine learning problem considering links between featuresHow can I improve a machine learning model?How to handle date data for Knn?
$begingroup$
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?
machine-learning feature-extraction feature-engineering
New contributor
$endgroup$
put on hold 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.
add a comment |
$begingroup$
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?
machine-learning feature-extraction feature-engineering
New contributor
$endgroup$
put on hold 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.
add a comment |
$begingroup$
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?
machine-learning feature-extraction feature-engineering
New contributor
$endgroup$
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?
machine-learning feature-extraction feature-engineering
machine-learning feature-extraction feature-engineering
New contributor
New contributor
New contributor
asked Mar 19 at 14:10
ApolloApollo
61
61
New contributor
New contributor
put on hold 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.
put on hold 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.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
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!
$endgroup$
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
add a comment |
$begingroup$
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!
$endgroup$
1
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
1
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
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!
$endgroup$
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
add a comment |
$begingroup$
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!
$endgroup$
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
add a comment |
$begingroup$
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!
$endgroup$
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!
answered Mar 19 at 14:40
Francesco PegoraroFrancesco Pegoraro
56717
56717
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
add a comment |
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
$begingroup$
Nice answer but I think he's looking for more basic help than that!
$endgroup$
– I_Play_With_Data
Mar 19 at 15:50
add a comment |
$begingroup$
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!
$endgroup$
1
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
1
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
add a comment |
$begingroup$
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!
$endgroup$
1
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
1
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
add a comment |
$begingroup$
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!
$endgroup$
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!
edited Mar 19 at 20:31
answered Mar 19 at 15:50
I_Play_With_DataI_Play_With_Data
1,234632
1,234632
1
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
1
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
add a comment |
1
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
1
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
1
1
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
Thank you so much for your response. I'd love it if you could address another silly doubt of mine. Converting the date to the python format worked perfectly fine. However, while trying to extract the month/year, I get the following error: return object.__getattribute__(self, name) AttributeError: 'Series' object has no attribute 'month'
$endgroup$
– Apollo
Mar 19 at 20:15
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo I apologize, there was an error in my original answer. Please try the above code again. Note the addition of "dt" , as in df['client_year'] = df['client_date'].dt.year
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
$begingroup$
@Apollo Also, if my answer has helped you in some way, I'd appreciate the upvote and marking my answer as the chosen solution.
$endgroup$
– I_Play_With_Data
Mar 19 at 20:32
1
1
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
$begingroup$
Upvotes will turn public once my reputation crosses 15. Thanks again!
$endgroup$
– Apollo
Mar 19 at 20:47
add a comment |