名目ロジスティック回帰分析のために、データをどのように分割してから、その一部(たとえば検証)に基づいてモデル化するのですか。
JMP Proは間違いなくこれを容易にしますが、ここにパーティションを作成するJMP Proの機能を模倣する方法があります。 パーティを使用することはまだかなり手動になるでしょう。 モデルをトレーニングデータに適合させるためにvalとテストセットを非表示/除外してから、使用しているプラットフォームから保存されている予測式を使用してvalとテストセットのトレーニングモデルで予測できます。
dt = Current Data Table();
n_rows = N Row(dt);
//determine proportions for training and validation sets (test is whatever is left over)
train_prop = 0.7;
val_prop = 0.15;
test_prop = 1-train_prop-val_prop;
//randomly shuffle row numbers
rows_shuffled = random shuffle(1::n_rows);
//determine precise number of data points for each partition
n_train = floor(train_prop*n_rows);
n_val = ceiling(val_prop*n_rows);
n_test = n_rows - n_train - n_val;
//obtain the desired data points for the partitions
train_rows = rows_shuffled[1::n_train];
val_rows = rows_shuffled[(n_train+1)::(n_train+1+n_val)];
test_rows = rows_shuffled[(n_rows-n_test)::n_rows];
//Create the partition column
partition_col = dt << New Column("Partition", numeric, nominal); //use partition_col just in case a Partition column already exists and the new column gets a name like "Partition 2"
//mimic JMP Prop underlying numeric values
partition_col[train_rows] = 1;
partition_col[val_rows] = 2;
partition_col[test_rows] = 3;
//Add value labels
partition_col << Add Column Properties({Value Labels( {"." = "Other", 1 = "Training", 2 = "Validation", 3 = "Test"} ),
Use Value Labels( 1 )});私はこれをまとめましたが、トレーニングと検証の比率を尋ねるダイアログが表示されたアプリにこれを簡単に作成できます。 View> Customize> Menus and Toolbarsで、そのアプリのスクリプトをメニューまたはツールバーに追加することで、非常に便利にすることができます。
最も抵抗の少ない方法は、JMP ProとMake Validation Columnユーティリティを使用することです。応答変数セットを分割するために層別ランダムオプションを使用することを考えてください。次に、実際にプラットフォームを起動するときには、[Fit Model]プラットフォーム起動ウィンドウの[検証]ウィンドウに列名を必ず配置してください。