Posts
Q&A
plot์ ๊ทธ๋ฆด๋ ๋ฐ์ดํฐ์ ๊ฒฐ์ธก์น๊ฐ ์์ผ๋ฉด ๊ทธ๋ ค์ง์ง ์๋ ์ปฌ๋ผ์ด ์์ต๋๋ค.
๋ค. ์ด๋ฏธ ๊ฐ์ธ์ ์ผ๋ก ํ๊ฒฝ์ด ๊ตฌ์ฑ๋์ด ์์ด ์ด๋ฐ ํ๊ฒฝ ์ค์ ๊ฐ์๋ฅผ ๋๊ธฐ๊ณ ์งํํด์ ๊ทธ๋ฐ๊ฑฐ ๊ฐ์ต๋๋ค. ๋ต๋ณ ์ฃผ์ ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
- 0
- 10
- 678
Q&A
plot์ ๊ทธ๋ฆด๋ ๋ฐ์ดํฐ์ ๊ฒฐ์ธก์น๊ฐ ์์ผ๋ฉด ๊ทธ๋ ค์ง์ง ์๋ ์ปฌ๋ผ์ด ์์ต๋๋ค.
๋ค. 1.4.1 ์ ๋๋ค.
- 0
- 10
- 678
Q&A
plot์ ๊ทธ๋ฆด๋ ๋ฐ์ดํฐ์ ๊ฒฐ์ธก์น๊ฐ ์์ผ๋ฉด ๊ทธ๋ ค์ง์ง ์๋ ์ปฌ๋ผ์ด ์์ต๋๋ค.
๋ค. ๋ค์๊ณผ ๊ฐ์ต๋๋ค. --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /opt/conda/lib/python3.7/site-packages/statsmodels/nonparametric/kde.py in kdensityfft(X, kernel, bw, weights, gridsize, adjust, clip, cut, retgrid) 450 try: --> 451 bw = float(bw) 452 except: ValueError: could not convert string to float: 'scott' During handling of the above exception, another exception occurred: RuntimeError Traceback (most recent call last) in 1 columns = ['AMT_REQ_CREDIT_BUREAU_HOUR'] ----> 2 show_hist_by_target(app_train, columns) in show_hist_by_target(df, columns) 6 fig, axs = plt.subplots(nrows=1, ncols=2, figsize=(12, 4), squeeze=False) 7 sns.violinplot(x='TARGET', y=column, data=df, ax=axs[0][0] ) ----> 8 sns.distplot(df[cond_0][column], ax=axs[0][1], label='0', color='blue') 9 sns.distplot(df[cond_1][column], ax=axs[0][1], label='1', color='red') /opt/conda/lib/python3.7/site-packages/seaborn/distributions.py in distplot(a, bins, hist, kde, rug, fit, hist_kws, kde_kws, rug_kws, fit_kws, color, vertical, norm_hist, axlabel, label, ax) 231 if kde: 232 kde_color = kde_kws.pop("color", color) --> 233 kdeplot(a, vertical=vertical, ax=ax, color=kde_color, **kde_kws) 234 if kde_color != color: 235 kde_kws["color"] = kde_color /opt/conda/lib/python3.7/site-packages/seaborn/distributions.py in kdeplot(data, data2, shade, vertical, kernel, bw, gridsize, cut, clip, legend, cumulative, shade_lowest, cbar, cbar_ax, cbar_kws, ax, **kwargs) 703 ax = _univariate_kdeplot(data, shade, vertical, kernel, bw, 704 gridsize, cut, clip, legend, ax, --> 705 cumulative=cumulative, **kwargs) 706 707 return ax /opt/conda/lib/python3.7/site-packages/seaborn/distributions.py in _univariate_kdeplot(data, shade, vertical, kernel, bw, gridsize, cut, clip, legend, ax, cumulative, **kwargs) 293 x, y = _statsmodels_univariate_kde(data, kernel, bw, 294 gridsize, cut, clip, --> 295 cumulative=cumulative) 296 else: 297 # Fall back to scipy if missing statsmodels /opt/conda/lib/python3.7/site-packages/seaborn/distributions.py in _statsmodels_univariate_kde(data, kernel, bw, gridsize, cut, clip, cumulative) 365 fft = kernel == "gau" 366 kde = smnp.KDEUnivariate(data) --> 367 kde.fit(kernel, bw, fft, gridsize=gridsize, cut=cut, clip=clip) 368 if cumulative: 369 grid, y = kde.support, kde.cdf /opt/conda/lib/python3.7/site-packages/statsmodels/nonparametric/kde.py in fit(self, kernel, bw, fft, weights, gridsize, adjust, cut, clip) 138 density, grid, bw = kdensityfft(endog, kernel=kernel, bw=bw, 139 adjust=adjust, weights=weights, gridsize=gridsize, --> 140 clip=clip, cut=cut) 141 else: 142 density, grid, bw = kdensity(endog, kernel=kernel, bw=bw, /opt/conda/lib/python3.7/site-packages/statsmodels/nonparametric/kde.py in kdensityfft(X, kernel, bw, weights, gridsize, adjust, clip, cut, retgrid) 451 bw = float(bw) 452 except: --> 453 bw = bandwidths.select_bandwidth(X, bw, kern) # will cross-val fit this pattern? 454 bw *= adjust 455 /opt/conda/lib/python3.7/site-packages/statsmodels/nonparametric/bandwidths.py in select_bandwidth(x, bw, kernel) 172 # eventually this can fall back on another selection criterion. 173 err = "Selected KDE bandwidth is 0. Cannot estimate density." --> 174 raise RuntimeError(err) 175 else: 176 return bandwidth RuntimeError: Selected KDE bandwidth is 0. Cannot estimate density.
- 0
- 10
- 678
Q&A
plot์ ๊ทธ๋ฆด๋ ๋ฐ์ดํฐ์ ๊ฒฐ์ธก์น๊ฐ ์์ผ๋ฉด ๊ทธ๋ ค์ง์ง ์๋ ์ปฌ๋ผ์ด ์์ต๋๋ค.
๋ต๋ณ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. seaborn ๋ฒ์ ์ ๊ทธ๋ ์ด๋ ์ดํ ์์ ์ค๋ฅ๋ ํด๊ฒฐ๋์์ต๋๋ค. ๋ค์ ์คํ ํด๋ณด๋ 'AMT_REQ_CREDIT_BUREAU_HOUR' ์ปฌ๋ผ์์ ์๋์ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ์์ต๋๋ค. (์ฌ์ง) ์ค์ต ์ฝ๋๋ ๊ทธ๋๋ก ์ฌ์ฉํ๊ณ ์๊ณ , pandas ๋ฒ์ ์ 1.1.2 ์ ๋๋ค. ํด๋น library ๋ฒ์ ์ ๋ณด๋ฅผ ์๋ ค์ฃผ์๋ฉด ๋์ผํ๊ฒ ๋ง์ถฐ์ ๋ค์ ํด๋ณด๊ฒ ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค.
- 0
- 10
- 678
Q&A
plot์ ๊ทธ๋ฆด๋ ๋ฐ์ดํฐ์ ๊ฒฐ์ธก์น๊ฐ ์์ผ๋ฉด ๊ทธ๋ ค์ง์ง ์๋ ์ปฌ๋ผ์ด ์์ต๋๋ค.
์๋ ํ์ธ์. ์๋์ ๊ฐ์ด AMT_ANNUITY ์ปฌ๋ผ์ distplot์ ๊ทธ๋ฆด๋ ๋ฐ์ํฉ๋๋ค. (์ฌ์ง) (์ฌ์ง) seaborn library ๋ฒ์ ์ 0.9.0 ์ ๋๋ค.
- 0
- 10
- 678