chowon9707
@welleundstrand
Reviews Written
1
Average Rating
5.0
Eine andere Sprache zu lernen ist wie ein anderer Mensch zu werden.
Posts
Q&A
dataํด๋์์ tsvํ์ผ์ด ์๋ค๊ณ ๋์ค๋๋ฐ ์ด๋ป๊ฒ ํด์ผํ๋์?
Review 0 of 4673 Review 1000 of 4673 /usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:18: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead). /usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:20: RuntimeWarning: invalid value encountered in true_divide Review 2000 of 4673 --------------------------------------------------------------------------- IndexError Traceback (most recent call last) "> in () ----> 1 get_ipython().magic('time testDataVecs = getAvgFeatureVecs( getCleanReviews(df_test), model, num_features )') 4 frames in time(self, line, cell, local_ns) in () "> in getAvgFeatureVecs(reviews, model, num_features) 14 print("Review %d of %d" % (counter, len(tokenized_data))) 15 # ํ๊ท ํผ์ฒ ๋ฒกํฐ๋ฅผ ๋ง๋ค๊ธฐ ์ํด ์์์ ์ ์ํ ํจ์๋ฅผ ํธ์ถํ๋ค. ---> 16 reviewFeatureVecs[int(counter)] = makeFeatureVec(review, model, num_features) 17 # ์นด์ดํฐ๋ฅผ ์ฆ๊ฐ์ํจ๋ค. 18 counter = counter + 1. IndexError: index 2036 is out of bounds for axis 0 with size 2036์ด๊ฒ ํน์ ์ ๋ํ๋๋ ์ค๋ฅ์ผ๊น์?? del df_test["Sentence"][:2037] ํ๋ฉด ํ๋์ฉ์ง์์ง๊ธฐ๋ ํ๋๋ฐ... ์ด์ ๋ถํฐ ์ธ๋ฑ์ค์๋ฌ๊ฐ ์ ๋๋์ง ๋ชจ๋ฅด๊ฐฐ์ต๋๋ค..! ์์ ํ ์คํธ๋ ์ ๋์๊ฐ๋๋ฐ...
- 1
- 4
- 684
Q&A
dataํด๋์์ tsvํ์ผ์ด ์๋ค๊ณ ๋์ค๋๋ฐ ์ด๋ป๊ฒ ํด์ผํ๋์?
# ์์ฑ๋ ์๋ฒ ๋ฉ ๋งคํธ๋ฆญ์ค์ ํฌ๊ธฐ ํ์ธ model.vectors.shape ์ด์ฝ๋์์ 'Word2Vec' object has no attribute 'vectors' ์ดํธ๋ฆฌ๋ทฐํธ์๋ฌ๋๋๋ฐ ํน์ ๋ญ๊ฐ ๋ญ๊ฐ๋ฌธ์ ์ผ๊น์? ๊ตฌ๊ธ๋งํด๋ณด์๋๋ฐ ์ ์ฌ ๋ฒ์ ๋ฎ์ท๋๋ฐ๋ ์ด๋์๊ฐ ๋ถํฐ ์๊พธ ์ด๋ถ๋ถ์์ ์ค๋ฅ๊ฐ ๋ฉ๋๋ค
- 1
- 4
- 684
Q&A
dataํด๋์์ tsvํ์ผ์ด ์๋ค๊ณ ๋์ค๋๋ฐ ์ด๋ป๊ฒ ํด์ผํ๋์?
๊ฐ์ฌํฉ๋๋ค! ์ถ๊ฐ์ ์ผ๋ก ์ด ๊ฐ์๋ฅผ ๋ค ๋ฃ๊ณ ์ ์ฉํด์ ํ๊ตญ์ด ๋ฐ์ดํฐ์ ํ๋ ค๊ณ ์ค์ตํด๋ณด๋ ค๊ณ ํ๋๋ฐ ์ด๋ฐ ์ค๋ฅ๊ฐ ๋จ๋ฉด์ ๋ง์ง๋ง์ ๋๋คํฌ๋ ์คํธ ๋ชจ๋ธ์ด ์๋์๊ฐ๋๋ฐ ํน์ test๋ train๋ฐ์ดํฐ ํ์ ๊ฐ์๊ฐ ๋ฌ๋ผ์ ๊ทธ๋ฐ๊ฑธ๊น์? # ํ์ต ๋ฆฌ๋ทฐ๋ฅผ bags of centroids ๋ก ๋ณํํ๋ค. # ํ์ต ๋ฆฌ๋ทฐ๋ฅผ bags of centroids ๋ก ๋ณํํ๋ค. counter = 0 for review in clean_train_reviews: train_centroids[counter] = create_bag_of_centroids( review, \ word_centroid_map ) counter += 1 if counter==4673: pass # ํ ์คํธ ๋ฆฌ๋ทฐ๋ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ๋ฐ๋ณตํด ์ค๋ค. test_centroids = np.zeros((df_test["Sentence"].size, num_clusters), \ dtype="float32" ) counter = 0 for review in clean_test_reviews: test_centroids[counter] = create_bag_of_centroids( review, \ word_centroid_map ) counter += 1 if counter==4673: break # ๋๋คํฌ๋ ์คํธ๋ฅผ ์ฌ์ฉํ์ฌ ํ์ต์ํค๊ณ ์์ธก forest = RandomForestClassifier(n_estimators = 100) # train ๋ฐ์ดํฐ์ ๋ ์ด๋ธ์ ํตํด ํ์ต์ํค๊ณ ์์ธกํ๋ค. # ์๊ฐ์ด ์ข ์์๋๊ธฐ ๋๋ฌธ์ %time์ ํตํด ๊ฑธ๋ฆฐ ์๊ฐ์ ์ฐ๋๋ก ํจ print("Fitting a random forest to labeled training data...") %time forest = forest.fit(train_centroids, df_train["Sentence"]) IndexError: index 4673 is out of bounds for axis 0 with size 4673 ์ธ๋ฒ์งธ ์ค์์ ์๋ฌ๊ฐ ๋์ต๋๋ค. ์ด์ ๊ฐ์๋ฐ ํ์ ๊ฐ์๊ฐ ๊ฐ๊ฐ 4673๊ณผ 267์ ๋๋ค. ๊ฐ์ฌํฉ๋๋ค ์ ๋๊ธ์ ์ฝ๋๊ณต์ ํ์ต๋๋ค. ํน์ ์์๋ฉด ์๋ ค์ฃผ์๋ฉด ๊ฐ์ฌํฉ๋๋ค!
- 1
- 4
- 684
Q&A
๋ฐฐ์ด ๊ฒ ๊ธฐ๋ฐ์ผ๋ก ๋ง๋ค์ด๋ณด๊ณ ์๋๋ฐ ์ง๋ฌธ์ด ์์ต๋๋ค.
์ ์๋์ด ๋ง์ํด์ฃผ์ ๋ฐ๋ก ์์ฝ๋๋ก ์์ ํ๋๋ฐ๋ 20์ผ๋ ์ง ํ๋ฃจ์น๋ง ๊ฐ์ ธ์์ง๊ณ ๋ฐ์์ ์ฐ๋ฒ ์ปฌ๋ผ์ ๋ ์ ๋ถ๋ฌ์์ง๋๋ฐ ๋ญ๊ฐ ์๋ชป๋๊ฑด๊ฐ์? https://colab.research.google.com/drive/1dOIzJP10qMdO18s6r7yknMFi0AmpjvdW?usp=sharing
- 1
- 5
- 374
Q&A
๋ฐฐ์ด ๊ฒ ๊ธฐ๋ฐ์ผ๋ก ๋ง๋ค์ด๋ณด๊ณ ์๋๋ฐ ์ง๋ฌธ์ด ์์ต๋๋ค.
์ ์๋, ํผ์ ๋ง๋ค์ด๋ณด๊ณ ์๋๋ฐ ์ง๊ธ, ๋ ๋ถ๋ถ์์ ๋งํ์ ์๋๋๋ฐ ๋ญ๊ฐ ์๋ชป๋์๋์ง ๋ด์ฃผ์๋ฉด ๊ฐ์ฌ๋๋ฆฝ๋๋ค.... c.f.https://colab.research.google.com/drive/1sOxHYPFilE7LafM7EaHf322HZXlsZK4W?usp=sharing (์ฌ์ง)(์ฌ์ง)
- 1
- 5
- 374
Q&A
๋ฐฐ์ด ๊ฒ ๊ธฐ๋ฐ์ผ๋ก ๋ง๋ค์ด๋ณด๊ณ ์๋๋ฐ ์ง๋ฌธ์ด ์์ต๋๋ค.
๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค. ์ ์๋์ด ๋ง์ํด์ฃผ์ ๋ง์ ๋์ถฉ ์ดํด๊ฐ ๊ฐ๋๋ฐ ์ด๋ป๊ฒ ์์ ํด์ผํ ์ง ๋ชจ๋ฅด๊ฒ ์ด์ ใ ใ ์ด๊ฒ์ ๊ฒ ํด๋ณด๋๋ฐ ์๊พธ์ค๋ฅ๊ฐ ํฐ์ ธ์ ,,,,,ํน์ ์ด๋ป๊ฒ ์ฝ๋๋ฅผ ์์ ํด์ผํ๋์ง์? ์ ๊ฐ ๋งํฌ์ ์ด์ ๋๊ธ๋ฌ๊ธฐ ๊ธฐ๋ฅ์ ์ถ๊ฐํ๋๋ฐ ์ฌ๊ธฐ์ ๋ต๋ณํ์๋๊ฒ ํน์ ๋ฒ๊ฑฐ์ฐ๋ก์๋ฉด ๋ฐ๋ก ๋๊ธ ๋ฌ์์ฃผ์ ๋ ๋ฉ๋๋ค. ๊ฐ์ฌํฉ๋๋ค. >>> ์ ๊ฐ ์์ ์ํ๊ณ ๋๋ ค๋ณด๊ณ ์๋๋ฐ ์ด๋ฒ์๋ ์ด์ชฝ ์ฝ๋์์ ์ค๋ฅ๊ฐ ๋๋๋ฐ ํน์ ๋ญ๊ฐ ์๋ชป์ธ์ง ์๋ ค์ฃผ์๋ฉด ๊ฐ์ฌํฉ๋๋ค. (์ฌ์ง) https://colab.research.google.com/drive/1sOxHYPFilE7LafM7EaHf322HZXlsZK4W?usp=sharing
- 1
- 5
- 374
Q&A
๊ทธ๋ํ ๋ฐ์ ์ ๋ชฉ์ ๋ฃ์ผ๋ ค๋ฉด ์ด๋กํด์ผํ๋์???
์ฐธ์กฐ ์ฌ์ดํธ๊น์ง ์๋ ค์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ ์๋์ด ์๋ ค์ฃผ์ ์ฝ๋๋ก ํ๋๋ฐ๋ ์,์ฃผ๊ฐ ์๋์ค๋๋ฐ ํน์ ์์๋ฉด ์๋ ค์ฃผ์๋ฉด ๊ฐ์ฌ๋๋ฆฝ๋๋ค. (์ฌ์ง)
- 1
- 2
- 402
Q&A
ํ๊ธํฐํธ ์ค์น ํ ๋์ค์ง ์๋ ํ์ ๋ฌธ์
๋ต ๊ฐ์ฌํฉ๋๋ค ์ ์๋! ์๋ ค์ฃผ์ ๋๋ก ํด์ ๋ฆฌ์คํธ์์ ๋ฐ์๋ทฐ ๊ธ์จ์ฒด๋ก ํ๋๋ฐ, ์๋ ์ ์๊ณ ๋ดค๋๋ "ํ๊ธ์ด๋ฆ" ์๋ฆฌ์๋ค๊ฐ ์์ด๋ฅผ ๋ฃ์ผ๋ฉด ๋๊ณ ํ๊ตญ์ด๊ฐ ์ธ์์ด ์๋๋ ๊ฒ ๊ฐ์๋ฐ, ํน์ ํ๊ตญ์ด๋ ์ธ์์ด ๋๊ฒ ํ๋ ค๋ฉด ์ด๋ค ์ฝ๋๋ฅผ ์ฐ๋ฉด ๋๋์? ์ ์ ๊ฐ์์์ ์๋ ค์ฃผ์ ๊ฒ ๊ฐ์๋ฐ, ๋ฒ๋ฒํ ์ง๋ฌธ ๋๋ ค์..... ๊ฐ์ฌํฉ๋๋ค ใ ใ # matplotlib.pyplot ์ ํตํด ํ๊ธํฐํธ๋ฅผ ์ค์ ํฉ๋๋ค. # plt.style.use ๋ก "fivethirtyeight" ์คํ์ผ์ ์ฌ์ฉํด ๋ด ๋๋ค. import matplotlib.pyplot as plt plt.rc("font", family="DejaVu Sans") #plt.rc("font", family="AppleGothic") plt.rc("axes", unicode_minus=False) plt.style.use("ggplot") pd.Series([1, 3, 5, -7, 9]).plot.bar(title="DejaVu Sans") #ํ๊ธ์ ๋ชฉ ์๋์ด
- 1
- 3
- 1.1K
Q&A
ํ๊ธํฐํธ ์ค์น ํ ๋์ค์ง ์๋ ํ์ ๋ฌธ์
๋น ๋ฅธ ๋ต๋ณ ๊ฐ์ฌํฉ๋๋ค!! ๋ฐ์ ์ฝ๋์ณค๋๋ฐ, >>>[] ์ด๋ ๊ฒ ๋์ค๋ฉด ์ ํฐํธ๊ฐ ์๋ฌด๊ฒ๋ ์๋๊ฑด๊ฐ์? import matplotlib.font_manager as fm font_list=fm.findSystemFonts(fontpaths=None,fontext='ttf') f_list=[] for f in fm.fontManager.ttflist: if "Gothic" in f.name: f.list.append(f.name) f_list
- 1
- 3
- 1.1K
Q&A
์ง๋ฌธ
์ ์๋ ๋ต๋ณ๊ฐ์ฌํฉ๋๋ค~ ๋ง์ง๋ง ์ฌ์ง์์ 125.0,280.0,216,0... ์ด๋ ๊ฒ ๋์ค๋ ์ฒซ๋ฒ์งธ ์ปฌ๋ผ ์๋ ๋ฌด์์ ์๋ฏธํ๋์? 125.0 40 ์ด๋ ๊ฒ 1์ด๋ง ๋ณด๋ฉด 29์ ์ด 40๋ฒ ํ์๋ฅผ ๊ฐ์ง๊ณ ์๋ค๋ ๊ฒ์ ์๊ฒ ๋๋ฐ, ์์ 125.0์ ๋ฌด์์ ์๋ฏธํ๋์ง ๋ชจ๋ฅด๊ฒ ์ด์์
- 1
- 2
- 217




