I am trying to visualize some stats of features, and some of my features have value 0, and i am using seaborn histplot's parameter log_scale which takes log for base 10
and because i have 0 present in my feature values, i can not visualize the plot, so what should i do without doing harm to data ?
my code:
fig, axes = plt.subplots(ncols=2, nrows=len(METAFEATURES), figsize=(20,50),dpi=100)
for i, feature in enumerate(METAFEATURES):
sns.histplot(dfs['toxic'][feature], label='toxic', ax=axes[i][0], color=colors[0],log_scale=True)
sns.histplot(dfs['severe_toxic'][feature], label='severe_toxic',ax=axes[i][0], color=colors[1],log_scale=True)
sns.histplot(dfs['obscene'][feature], label='obscene', ax=axes[i][0], color=colors[2],log_scale=True)
sns.histplot(dfs['threat'][feature], label='threat', ax=axes[i][0], color=colors[3],log_scale=True)
sns.histplot(dfs['insult'][feature], label='insult', ax=axes[i][0], color=colors[4],log_scale=True)
sns.histplot(dfs['identity_hate'][feature], label='identity_hate', ax=axes[i][0], color=colors[5],log_scale=True)
sns.histplot(train_df[feature], label="Training", ax=axes[i][1],color=colors[0],log_scale=True)
sns.histplot(test_df[feature], label='Test', ax=axes[i][1],color=colors[1],log_scale=True)
for j in range(2):
axes[i][j].set_xlabel('')
axes[i][j].tick_params(axis='x', labelsize=12)
axes[i][j].tick_params(axis='y', labelsize=12)
axes[i][j].legend()
axes[i][0].set_title(f"{feature} Target Distribution in Training Set", fontsize=13)
axes[i][1].set_title(f"{feature} Training & Test Set Distribution", fontsize=13)
plt.show()