草庐IT

$sklearn

全部标签

python - "No space left on device"拟合 Sklearn 模型时出错

我正在使用scikit-learn拟合包含大量数据的LDA模型。相关代码如下:lda=LatentDirichletAllocation(n_topics=n_topics,max_iter=iters,learning_method='online',learning_offset=offset,random_state=0,evaluate_every=5,n_jobs=3,verbose=0)lda.fit(X)(我想这里唯一可能相关的细节是我正在使用多个作业。)一段时间后,我收到“设备上没有剩余空间”错误,即使磁盘上有足够的空间和大量可用内存。我在两台不同的计算机上(在我的本地

python - "No space left on device"拟合 Sklearn 模型时出错

我正在使用scikit-learn拟合包含大量数据的LDA模型。相关代码如下:lda=LatentDirichletAllocation(n_topics=n_topics,max_iter=iters,learning_method='online',learning_offset=offset,random_state=0,evaluate_every=5,n_jobs=3,verbose=0)lda.fit(X)(我想这里唯一可能相关的细节是我正在使用多个作业。)一段时间后,我收到“设备上没有剩余空间”错误,即使磁盘上有足够的空间和大量可用内存。我在两台不同的计算机上(在我的本地

python - scikit-learn 和 sklearn 的区别

在OSX10.11.6和python2.7.10上,我需要从sklearn流形导入。我安装了numpy1.8Orc1、scipy.13Ob1和scikit-learn0.17.1。我使用pip安装sklearn(0.0),但是当我尝试从sklearn流形导入时,我得到以下信息:Traceback(mostrecentcalllast):File"",line1,inFile"/Library/Python/2.7/site-packages/sklearn/init.py",line57,infrom.baseimportcloneFile"/Library/Python/2.7/si

python - scikit-learn 和 sklearn 的区别

在OSX10.11.6和python2.7.10上,我需要从sklearn流形导入。我安装了numpy1.8Orc1、scipy.13Ob1和scikit-learn0.17.1。我使用pip安装sklearn(0.0),但是当我尝试从sklearn流形导入时,我得到以下信息:Traceback(mostrecentcalllast):File"",line1,inFile"/Library/Python/2.7/site-packages/sklearn/init.py",line57,infrom.baseimportcloneFile"/Library/Python/2.7/si

python - sklearn.cross_validation.StratifiedShuffleSplit - 错误 : "indices are out-of-bounds"

我试图使用Scikit-learn的StratifiedShuffleSplit拆分样本数据集。我按照Scikit-learn文档here中显示的示例进行操作。importpandasaspdimportnumpyasnp#UCI'swinedatasetwine=pd.read_csv("https://s3.amazonaws.com/demo-datasets/wine.csv")#separatetargetvariablefromdatasettarget=wine['quality']data=wine.drop('quality',axis=1)#StratifiedSp

python - sklearn.cross_validation.StratifiedShuffleSplit - 错误 : "indices are out-of-bounds"

我试图使用Scikit-learn的StratifiedShuffleSplit拆分样本数据集。我按照Scikit-learn文档here中显示的示例进行操作。importpandasaspdimportnumpyasnp#UCI'swinedatasetwine=pd.read_csv("https://s3.amazonaws.com/demo-datasets/wine.csv")#separatetargetvariablefromdatasettarget=wine['quality']data=wine.drop('quality',axis=1)#StratifiedSp

python - sklearn : TFIDF Transformer : How to get tf-idf values of given words in document

我使用sklearn使用以下命令计算文档的TFIDF(词频逆文档频率)值:fromsklearn.feature_extraction.textimportCountVectorizercount_vect=CountVectorizer()X_train_counts=count_vect.fit_transform(documents)fromsklearn.feature_extraction.textimportTfidfTransformertf_transformer=TfidfTransformer(use_idf=False).fit(X_train_counts)X_

python - sklearn : TFIDF Transformer : How to get tf-idf values of given words in document

我使用sklearn使用以下命令计算文档的TFIDF(词频逆文档频率)值:fromsklearn.feature_extraction.textimportCountVectorizercount_vect=CountVectorizer()X_train_counts=count_vect.fit_transform(documents)fromsklearn.feature_extraction.textimportTfidfTransformertf_transformer=TfidfTransformer(use_idf=False).fit(X_train_counts)X_

python - sklearn 估计器管道的参数无效

我正在使用Python2.7和sklearn0.16实现O'Reilly书籍“IntroductiontoMachineLearningwithPython”中的一个示例。我正在使用的代码:pipe=make_pipeline(TfidfVectorizer(),LogisticRegression())param_grid={"logisticregression_C":[0.001,0.01,0.1,1,10,100],"tfidfvectorizer_ngram_range":[(1,1),(1,2),(1,3)]}grid=GridSearchCV(pipe,param_gri

python - sklearn 估计器管道的参数无效

我正在使用Python2.7和sklearn0.16实现O'Reilly书籍“IntroductiontoMachineLearningwithPython”中的一个示例。我正在使用的代码:pipe=make_pipeline(TfidfVectorizer(),LogisticRegression())param_grid={"logisticregression_C":[0.001,0.01,0.1,1,10,100],"tfidfvectorizer_ngram_range":[(1,1),(1,2),(1,3)]}grid=GridSearchCV(pipe,param_gri