<jupyter_start><jupyter_text>Without specifying a feature list, the default is to give you each column as an individual feature:<jupyter_code>I = importances(rf, X_test, y_test)
plot_importances(I, save='/Users/parrt/github/random-forest-importances/article/images/imp.svg')<jupyter_output><empty_output><jupyter_text>But you can specify a subset if you like:<jupyter_code>I = importances(rf, X_test, y_test, features=['price',['latitude','longitude']])
plot_importances(I, scalefig=(1,1.2),
                 save='/Users/parrt/github/random-forest-importances/article/images/subset_imp.svg')
I = importances(rf, X_test, y_test, features=[['latitude','longitude']])
plot_importances(I, scalefig=(1,0.7),
                 save='/Users/parrt/github/random-forest-importances/article/images/latlong_imp.svg')<jupyter_output><empty_output><jupyter_text>By specifying a list of lists, you can provide groups that should be treated together.<jupyter_code>features = ['bathrooms', 'bedrooms', 
            ['latitude', 'longitude'],  
            ['price_to_median_beds', 'beds_baths', 'price'], 
            ['beds_per_price','bedrooms']]
I = importances(rf, X_test, y_test, features=features)
plot_importances(I, save='/Users/parrt/github/random-forest-importances/article/images/grouped_imp.svg')<jupyter_output><empty_output><jupyter_text>Features can be duplicated in multiple groups:<jupyter_code>features = [['latitude', 'longitude'],
            ['price_to_median_beds', 'beds_baths', 'beds_per_price', 'bedrooms'],
            ['price','beds_per_price','bedrooms']]
I = importances(rf, X_test, y_test, features=features)
plot_importances(I, scalefig=(1,.9),
                 save='/Users/parrt/github/random-forest-importances/article/images/grouped_dup_imp.svg')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14596100278551533, 'fraction_numerical': 0.004456824512534819, 'mean_word_length': 5.627306273062731, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '121017', 'license': 'MIT', 'n_tokens_mistral': 621, 'n_tokens_neox': 606, 'n_words': 95, 'path': 'notebooks/rfpimp-collinear.ipynb', 'repo_name': 'abhishekverma0207/unbiased-random-forest-importances', 'size': '1795'}