Skip to content

Commit

Permalink
Merge pull request #200 from shahules786/master
Browse files Browse the repository at this point in the history
Change the distribution of discrete features in EDA (#197)
  • Loading branch information
pplonski authored Sep 21, 2020
2 parents ce85f8d + 0c42c4b commit 07f5255
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions supervised/preprocessing/eda.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def compute(X, y, eda_path):
for col in X.columns:
inform["feature_type"].append(PreprocessingUtils.get_type(X[col]))

if PreprocessingUtils.get_type(X[col]) in ("categorical", "discrete"):
if PreprocessingUtils.get_type(X[col]) in ("categorical"):

plt.figure(figsize=(5, 5))
chart = sns.countplot(
Expand All @@ -103,7 +103,7 @@ def compute(X, y, eda_path):
plt.title(f"{col} class distribution")
plt.tight_layout(pad=2.0)

elif PreprocessingUtils.get_type(X[col]) in ("continous"):
elif PreprocessingUtils.get_type(X[col]) in ("continous","discrete"):

plt.figure(figsize=(5, 5))
sns.distplot(X[col], color=BLUE)
Expand Down Expand Up @@ -162,7 +162,7 @@ def compute(X, y, eda_path):
f"- **{key.capitalize()}** :{row['desc'][key]}\n"
)

fout.write(f"- {row['plot']}\n")
fout.write(f"\n{row['plot']}\n")

fout.close()
except Exception as e:
Expand Down

0 comments on commit 07f5255

Please sign in to comment.