<jupyter_start><jupyter_text>Feautuers<jupyter_code>for feat in df.columns:
 print(feat)

SUFFIX_CAT='__cat'
for feat in df.columns:
   if isinstance(df[feat][0],list):continue

   factorized_values=df[feat].factorize()[0]
   if SUFFIX_CAT in feat:
          df[feat]= factorized_values
   else:
          df[feat+SUFFIX_CAT]=df[feat].factorize()[0]
cat_feats=[x for x in df.columns if SUFFIX_CAT in x]
cat_feats
cat_feats=[x for x in cat_feats if 'price' not in x]
len(cat_feats)
X=df[cat_feats].values
y=df['price_value'].values

model=DecisionTreeRegressor(max_depth=5)
scores=cross_val_score(model, X, y, cv=3, scoring="neg_mean_absolute_error")
np.mean(scores)
m=DecisionTreeRegressor(max_depth=5)
m.fit(X,y)

imp=PermutationImportance(m, random_state=0).fit(X,y)
eli5.show_weights(m,feature_names=cat_feats)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.132858837485172, 'fraction_numerical': 0.009489916963226572, 'mean_word_length': 7.115384615384615, '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': '636708', 'license': 'MIT', 'n_tokens_mistral': 353, 'n_tokens_neox': 341, 'n_words': 56, 'path': 'day3_simple_model.ipynb', 'repo_name': 'lohengrin88/dw_matrix_car', 'size': '843'}