テーマ: data
-
特徴量のスケーリングとカテゴリのエンコーディング:変換対象を選び、適合は訓練データだけで行う
距離や勾配に基づくモデルでは、数値特徴量の尺度を比較可能にする必要がある(StandardScaler、MinMaxScaler、RobustScaler)。カテゴリ列は、カテゴリ数とモデルの種類に応じて、ワンホット、順序、ターゲットの各エンコーディングで数値に変換する。すべての変換器を訓練用の分割で適合させ、変更せずに検証、テスト、本番の行へ適用する。
-
訓練・検証・テスト集合:各分割の役割と分け方
モデルは訓練集合で適合し、モデルやハイパーパラメーターは検証集合、または交差検証で選び、テスト集合には最終推定のために一度だけ触れる。行を無作為、層化、グループ別、時系列のどれで割り当てるかによって、推定が本番について何かを示すかどうかが決まる。
-
Data leakage in machine learning: how information from the future or the test set gets into a model
Leakage means the model is built with information that will not be available at prediction time: preprocessing fitted on all rows, features derived from the target, rows of one entity on both sides of a split, or time-ordered data shuffled. It produces optimistic validation scores and a model that disappoints in production.
-
小規模データセットの来歴とバージョン管理
原データを変更せずに保存し、チェックサムと出所を記録する。直接編集せずスクリプトで新しいファイルを生成し、データへのポインターをコードと一緒にバージョン管理する(DVC または Git LFS)。datapackage.json でパッケージを記述し、PROV の用語で来歴を残すことで、報告書のどの数値もコミット、チェックサム、スクリプトへとたどれるようにする。
-
Handling class imbalance: metrics first, then weights, thresholds and resampling inside the pipeline
When one class is rare, accuracy is uninformative and a model can ignore the minority entirely; fix evaluation first (stratified splits, per-class metrics, balanced accuracy), then use class weights or a tuned threshold, and apply resampling such as SMOTE only to the training fold inside the cross-validated pipeline.
-
データ型としての埋め込み:固定長ベクトル、距離関数、そしてベクトル列に必要な情報
埋め込みは特定のモデルが生成する固定長の浮動小数点ベクトルです。そのモデルが学習した距離と、同じモデルバージョンのベクトルとの間でのみ意味を持ちます。保存には次元数、モデル識別子、距離の記録が必要で、問い合わせは厳密または近似の最近傍探索になります。
機械可読: JSON