日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python gridsearch_python gridsearch中的内存错误

發布時間:2024/7/23 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python gridsearch_python gridsearch中的内存错误 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我需要應用網格搜索我有20000列和110000行的數據幀,我需要使用python的網格搜索模塊調整我的參數

#validation for svm

#there are an error to check it ( grid search ne marche pas i will check why after)

label = df.Sentiment

train= df.drop('Sentiment', axis=1)

from sklearn.pipeline import Pipeline

text_clf = Pipeline([('tfidf', TfidfVectorizer()),

('clf', LinearSVC()),

])

from sklearn.model_selection import GridSearchCV

parameters = {'tfidf_min_df': [[0.8, 1.0], 1],

'tfidf__max_df': ([0.8, 1.0], 1),

'clf__c': (0.1, 1 , 10),

}

gs_clf = GridSearchCV(text_clf, parameters)

gs_clf = gs_clf.fit(trainas_matrix(), label)

我得到這個錯誤

------------------------------------------------- -------------------------- MemoryError Traceback(最近一次調用last)in()3 classif = SklearnClassifier(LinearSVC())4#Séparationdu set de train et de test ----> 5 X_train,X_test,y_train,y_test = train_test_split(train.as_matrix(),label,test_size = 0.33)/usr/local/lib/python2.7/dist-packages/pandas as_matrix中的/ core/generic.pyc(self,columns)2832 self._consolidate_inplace()2833 if self._AXIS_REVERSED: - > 2834 return self._data.as_matrix(columns).T 2835 return self._data.as_matrix(columns)2836 as_matrix中的/usr/local/lib/python2.7/dist-packages/pandas/core/internals.pyc(self,items)3148返回mgr.blocks [0] .get_values()3149其他: - > 3150返回mgr . _interleave()3151 3152 def _interleave(self):/ interleave中的/usr/local/lib/python2.7/dist-packages/pandas/core/internals.pyc(self)3157 dtype = _interleaved_dtype(self.blocks)3158 - > 3159 result = np.empty(self.shape,dtype = dtype)3160 3161 if result.shape [0] == 0:MemoryEr ROR:

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的python gridsearch_python gridsearch中的内存错误的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。