JSL - 保存最佳轉型嗨,
我正在運行下面的腳本,它將在box-cox大綱框生成後停止。我所做的是在“Box Cox Transformation”大綱框中手動“保存最佳轉換”。我的問題,有沒有辦法通過JSL自動化“保存最佳轉換”以繼續編寫更多項目的腳本進行轉換?感謝幫助
-Rgsd,Joel
清除日誌();
dtName =“大班”;
dt = Open(“$ SAMPLE_DATA /”|| dtName ||“。jmp”);
nwd =新窗口(“Box Cox”,
dt << Fit Model(
Y(:重量),
影響,
人格(“標準最小二乘法”),
重點(“效果槓桿”),
跑(
:權重<< {擬合概要(1),方差分析(1),參數估計(1),缺乏擬合(0),預測實際情節(1),
繪圖回歸(0),通過預測繪製殘差(1),繪圖效果槓桿(1),框Cox Y變換(1),
保存最佳轉型(1)}
)
)
);
回复:JSL - 保存最佳轉型僅供參考,這是一個不需要你構建字符串的替代方案。這樣,保留了編輯器中的語法檢查和突出顯示。如果你犯了盡可能多的錯誤,這很有用。
NamesDefaultToHere(1);
dtName = "Big Class";
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
numericCols = dt << getColumnNames("String", "Numeric");
// Build a function to do what's needed . . .
getBestBoxCox =
Function({numCol}, {Default Local},
// Open the fit model lauch dialog
fmDialog = dt << Fit Model(
Y( Eval(numCol) ),
Effects,
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" )
);
// Run the desired model ('fmAnalysis' is a reference to the analysis layer of the report window)
fmAnalysis = fmDialog << runModel;
// Close the launch dialog
Report(fmDialog) << closeWindow;
// Ask for the transformations
fmAnalysis << Box Cox Y Transformation;
// Get a reference to the little red triangle for the transformations
lrt = Report(fmAnalysis)["Box-Cox Transformations"] << getScriptableObject;
// Save the best transformation
lrt << saveBestTransformation;
// Close the report window
Report(fmAnalysis) << closeWindow;
);
// Use the function on the required columns . . .
for(c=1, c<=NItems(numericCols), c++, getBestBoxCox(numericCols[c]));
回复:JSL - 保存最佳轉型你好stephen_pearson,
正是我需要'Box Cox Y Transformation(1,Save Best Transformation(1))'。是的,我正在通過多個選項運行此選項,現在無需人工干預即可處理。謝謝回复:JSL - 保存最佳轉型如果您創建在JSL中作為字符串共享的代碼,並將所有列名稱轉換為列表( colListYBoxCox )然後你可以在列名中替換並循環列表中的所有列(例如下面的例子)。
我已經做了這個,然後檢查box-cox轉換是否有很大的不同,並自動刪除那些浪費時間的東西。
問候,
斯蒂芬
對於(i = 1,i <= N項(colListYBoxCox),i ++,
boxcoxstring =“boxcoxwindow = Fit Model(
Y(“;
boxcoxstring = Concat(boxcoxstring,“:Name(\!”“,colListYBoxCox [i],”\!“),”);
boxcoxstring = Concat(boxcoxstring,“),”);
boxcoxstring = Concat(
boxcoxstring,
“影響,
個性(\!“標準最小二乘\!”),
重點(\!“效果槓桿\!”),“
);
boxcoxstring = Concat(
boxcoxstring,
“運行(:名稱(\”“,
colListYBoxCox [I],
“\!”)<< {缺乏擬合(0),預測實際繪圖(0),
繪製回歸(0),通過預測繪製殘差(0),
繪圖效果槓桿(0),Box Cox Y轉換(1,保存最佳轉換(1)),顯示VIF(1)},
),“
);
boxcoxstring = Concat(boxcoxstring,“);” );
Eval(Parse(boxcoxstring));
等等(0);
boxcoxwindow <<關閉窗口;
);