cost 330 ms
NearMiss 在傳遞參數時給出此錯誤:__init__() takes 1 positional argument but 2 were given

[英]NearMiss gives this error when an argument is passed: __init__() takes 1 positional argument but 2 were given

這是我用於不平衡數據的代碼,用於對數據集進行欠采樣。 當我在參數中傳遞單個參數時,它會出錯 當我不傳遞任何參數時,它會給出這個輸出 我正在尋找我遇到錯誤的問題的答案。 ...

為什么使用 pip 安裝 imblearn 會失敗?

[英]why does installing imblearn with pip is failing?

我正在嘗試使用命令 pip install imblearn 將 python package“imblearn”安裝到 balanace 數據集。 但它一直失敗。 從具有管理員權限的 PowerShell cmdand 嘗試, 使用常規 pip 命令,並使用 git 克隆到 repo,然后安裝 ...

2023-01-01 20:45:07   1   37    imblearn  
StratifiedKFold 和過采樣一起使用

[英]StratifiedKFold and Over-Sampling together

我有一個機器學習 model 和一個包含 15 個關於乳腺癌的特征的數據集。 我想預測一個人的狀態(活着或死了)。 我有 85% 的存活病例,只有 15% 的病例死亡。 因此,我想使用過采樣來處理這個問題,並將其與分層 k 折結合起來。 我寫了這段代碼,它似乎運行良好,但我不知道我是否按正確的順序排 ...

AttributeError: 'Pipeline' object 沒有屬性 'fit_resample'

[英]AttributeError: 'Pipeline' object has no attribute 'fit_resample'

基於以下鏈接管道和不平衡的文檔我試圖在一些數據集上實現代碼,這里是代碼: 這段代碼的主要問題是行: 錯誤說 AttributeError: 'Pipeline' object has no attribute 'fit_resample' 我該如何解決這個問題? 提前致謝 ...

為什么當文檔說它接受兩者時,稀疏矩陣的 pandas Dataframe 版本不能與 imblearn 的 RandomOverSampler 一起使用?

[英]Why does the pandas Dataframe version of a sparse matrix not work with RandomOverSampler from imblearn when the documentation says it accepts both?

度過了痛苦的一夜調試 其中 x_trainvec 是 csr 稀疏矩陣,y_train 是 pandas Dataframe,Dataframes 中兩者的尺寸分別為 (75060 x 52651) 和 (75060 x 1),錯誤為 02ValueError:指數暗示 (290210, 5265 ...

管道中一對一的自定義重采樣器

[英]Custom resampler for a one-v-one in a pipeline

我正在努力實現基於SVM工作的自定義欠采樣器。 該類通過選擇類的支持向量附近的多數示例,對多數類進行欠采樣到少數類的大小,直到少數示例的大小。 這是代碼: import numpy as np from collections import Counter from sklearn.svm i ...

將 SMV 'ovo' 與 RandomUnderSampler 一起使用

[英]using SMV 'ovo' with RandomUnderSampler

我正在使用不平衡的數據集進行分類。 我知道 sklearn 的SVM確實有一個decision_function_shape超參數,可以將其設置為'ovo'表示“一對一”(盡管SVM默認情況下是一個'ovo' )。 由於我選擇使用欠采樣進行'ovo' ,因此我有興趣在擬合每個'ovo'模型之前將' ...

為什么 SMOTE 不適用於超過 15 個功能/什么方法適用於超過 15 個功能?

[英]Why does SMOTE not work with more than 15 features / What method does work with more than 15 features?

我目前正在使用 imblearn.over_sampling 中的 SMOTE 實現機器學習,並且在我為它合成數據時,當 SMOTE 方法中斷時,我看到一個非常明顯的截止值。 當我使用以下代碼合成數據並通過 SMOTE 運行它時(由 Jason Brownlee 提供): 它工作正常。 但是,當 ...

在 Anaconda 上的 Jupyter 筆記本上導入 imblearn python package 時遇到問題

[英]Having issues to import imblearn python package on Jupyter notebook on Anaconda

我想使用 pip 安裝不平衡學習來安裝不平衡學習。 然后我嘗試導入 此導入給了我以下錯誤。 我確實嘗試過卸載不平衡學習並重新安裝不平衡學習,但它沒有幫助。 我也試過 他們也沒有幫助。 我正在使用 Anaconda 虛擬環境。 感謝您的建議。 謝謝! ...

使用 imblearn 在 SMOTE 之后執行隨機欠采樣

[英]Performing Random Under-sampling after SMOTE using imblearn

我正在嘗試使用RandomUnderSampler()和 SMOTE( SMOTE()來實現組合過采樣和欠采樣。 我正在處理 loan_status 數據集。 我做了以下拆分。 這就是我的訓練數據分布的樣子。 這是我嘗試為類平衡執行的代碼片段。 它給了我一個帶有以下回溯的 ValueError: ...

scikit-learn錯誤雖然安裝正確

[英]scikit-learn error although it is properly installed

我的代碼如下: 我收到此錯誤: 對 imblearn 的簡單導入給出了相同的錯誤。 我嘗試重新安裝 scikit learn 和 scipy,但我仍然遇到同樣的錯誤。 ...

無法從“sklearn.utils.metaestimators”導入名稱“available_if”

[英]Cannot import name 'available_if' from 'sklearn.utils.metaestimators'

導入“from imblearn.over_sampling import SMOTE”時,出現導入錯誤。 請檢查並幫助。 我嘗試升級 sklearn,但升級因“OSError”而取消。 首先通過 pip 安裝不平衡學習。 使用 jupyter 筆記本 Windows 10 sklearn 版本 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM