engineering the features sowhat kind of features can we provide to our classifierwhat do we think will have the most discriminative powerthe timetoanswer attribute is already present in our meta dictionarybut it probably won' provide much value on its own then there is only textbut in its raw formwe cannot pass it to the classifier as the features must be in numerical form we will have to do the dirty work of extracting features from it what we could do is check the number of html links in the answer as proxy for quality our hypothesis would be that more hyperlinks in an answer indicate better answersand thus have higher likelihood of being up-voted of coursewe want to only count links in normal text and not in code examplesimport re code_match re compile('*?)'re multiline|re dotalllink_match re compile('< href="re multiline|re dotalldef extract_features_from_body( )link_count_in_code count links in code to later subtract them for match_str in code_match findall( )link_count_in_code +len(link_match findall(match_str)return len(link_match findall( )link_count_in_code for production systemswe should not parse html content with regular expressions insteadwe should rely on excellent libraries such as beautifulsoup that does marvelous job of robustly handling all the weird things that typically occur in everyday html with this in placewe can generate one feature per answer but before we train the classifierlet us first have look at what we will train it with we can get first impression with the frequency distribution of our new feature this can be done by plotting the percentage of how often each value occurs in the data as shown in the following graph