In the following steps, you will convert the featurized data into a collection of time series and detect crime using isolation forest:
- List all threat actors in preparation for creating labels:
threat_actors = [ "AAM0658", "AJR0932", "BDV0168", <snip> "MSO0222",]
- We then index the dates:
start_date = joint["date"].iloc[0]end_date = joint["date"].iloc[-1]time_horizon = (end_date - start_date).days + 1def date_to_index(date): """Indexes dates by counting the number of days since the starting date of the dataset.""" return (date - start_date).days
- Define a function to extract the time series information of a given user:
def extract_time_series_by_user(user_name, df): """Filters the dataframe down to a specific user.""" ...