第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Python:使用scikit-learn進(jìn)行預(yù)測,給出空白預(yù)測

Python:使用scikit-learn進(jìn)行預(yù)測,給出空白預(yù)測

千萬里不及你 2021-03-16 17:12:48
我從事客戶支持工作,在給定一組培訓(xùn)票證的情況下,我正在使用scikit-learn來預(yù)測我們機(jī)票的標(biāo)簽(培訓(xùn)集中約40,000張票證)。我正在使用基于此模型的分類模型。即使訓(xùn)練集中的所有票證都沒有標(biāo)簽,它也只是將“()”作為我的許多票證測試組的標(biāo)簽進(jìn)行預(yù)測。我的標(biāo)簽訓(xùn)練數(shù)據(jù)是一個(gè)列表列表,例如:tags_train = [['international_solved'], ['from_build_guidelines my_new_idea eligibility'], ['dropbox other submitted_faq submitted_help'], ['my_new_idea_solved'], ['decline macro_backer_paypal macro_prob_errored_pledge_check_credit_card_us loading_problems'], ['dropbox macro__turnaround_time other plq__turnaround_time submitted_help'], ['dropbox macro_creator__logo_style_guide outreach press submitted_help']]雖然我的票務(wù)說明訓(xùn)練數(shù)據(jù)只是一個(gè)字符串列表,例如:descs_train = ['description of ticket one', 'description of ticket two', etc]這是構(gòu)建模型的代碼的相關(guān)部分:import numpy as npimport scipyfrom sklearn.pipeline import Pipelinefrom sklearn.feature_extraction.text import CountVectorizerfrom sklearn.feature_extraction.text import TfidfTransformerfrom sklearn.multiclass import OneVsRestClassifierfrom sklearn.svm import LinearSVC# We have lists called tags_train, descs_train, tags_test, descs_test with the test and train dataX_train = np.array(descs_train)y_train = tags_trainX_test = np.array(descs_test)  classifier = Pipeline([    ('vectorizer', CountVectorizer()),    ('tfidf', TfidfTransformer()),    ('clf', OneVsRestClassifier(LinearSVC(class_weight='auto')))])classifier.fit(X_train, y_train)predicted = classifier.predict(X_test)但是,“預(yù)測”給出的列表如下:predicted = [(), ('account_solved',), (), ('images_videos_solved',), ('my_new_idea_solved',), (), (), (), (), (), ('images_videos_solved', 'account_solved', 'macro_launched__edit_update other tips'), ('from_guidelines my_new_idea', 'from_guidelines my_new_idea macro__eligibility'), ()]我不明白為什么訓(xùn)練集中沒有空白()的原因。它不應(yīng)該預(yù)測最接近的標(biāo)簽嗎?誰能推薦我正在使用的模型的任何改進(jìn)?非常感謝您的提前幫助!
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 326 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)