問題タブ [subsampling]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - 各グループごとの python 1:1 成層サンプリング
Pythonで1:1の成層サンプリングを実行するにはどうすればよいですか?
Pandas Dataframedf
が非常に不均衡であると想定します。これには、バイナリ グループとカテゴリ サブグループの複数の列が含まれます。
メインのメンバーごとに、withgroup==1
の 1 つの一致を見つける必要がありますgroup==0
。
scikit-learn からの AStratifiedShuffleSplit
は、1:1 の一致ではなく、データのランダムな部分のみを返します。