<jupyter_start><jupyter_text>Exercises:1. Predict the parent process name from the child process name2. Predict the working directory from the process nameMethodology:1. Create "unseen", and "seen" data sets using data you created earlier, or new captures1. Learn the relationship between process names and parent process names1. Explore the effectiveness of the trained model on the unseen data set<jupyter_code># Good Luck!!!!
import matplotlib
import pandas
import psutil
import time

%matplotlib inline
columns = ['pid', 'name', 'ppid', 'cmdline', 'cwd', 'create_time']
i = 0
vvalues = []

# Every 5 seconds for half an hour
for i in range(360):
    for proc in psutil.process_iter(attrs=columns):
        values = list(proc.info.values())
        vvalues += [values]
    
    time.sleep(5)

df = pandas.DataFrame(columns=columns, data=vvalues)
df.to_pickle('my_processes.pickle')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09737417943107221, 'fraction_numerical': 0.012035010940919038, 'mean_word_length': 4.980392156862745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '362589', 'license': 'Apache-2.0', 'n_tokens_mistral': 283, 'n_tokens_neox': 272, 'n_words': 101, 'path': 'tutorial/behaviour/3. Predicting Processes (No Hints!).ipynb', 'repo_name': 'tleeuwenburg/AusCERT-2019', 'size': '914'}