在 JSL 中訪問輪廓框 NIPALS Fit我想動態訪問 PLS 報告的擬合部分(“NIPALS 擬合 x 因子”)。 我知道,如果我知道大綱框的編號(例如,OutlineBox(6))或確切的標題,我就可以訪問它,但是由於前者的編號可能會發生變化,而後者的變化取決於因素的數量,我無法動態訪問大綱框。
有沒有辦法通過搜索其名稱的一部分來獲取輪廓框的樹位置?
腳本回复:訪問適合 JSL 的大綱框 NIPALS隨著片段
mywind=Window() << Get Window Title;
pls_wind = {};
For( i = 1, i <= N Items( mywind ), i++,
If( Contains( mywind[i], "Partial Least Squares"),
Insert Into( pls_wind, mywind[i] )
)
);
ob = Window( pls_wind[1] ) << XPath("//OutlineBox[ contains( text(), 'NIPALS Fit with' ) ]");我可以訪問 PLS 窗口並發送消息,所以這似乎有效。
回复:訪問適合 JSL 的大綱框 NIPALS當必須彈出 X 和 Y 輸入時,指向偏最小二乘 () 平台的“pls”指針似乎丟失了。所以下面是一個真正的解決方案,它使用對將為示例生成的輸出窗口名稱的引用,並不斷檢查它何時出現,然後應用紅線。我不喜歡這個解決方案....希望其他社區成員有更好的解決方案
Names Default To Here( 1 );
dt = Open( "$Sample_data/iris.jmp" );
pls = Partial Least Squares(
Validation Method( KFold( 7 ), Initial Number of Factors( 3 ) ),
Fit( Method( NIPALS ), Number of Factors( 3 ) ),
Fit( Method( NIPALS ), Number of Factors( 2 ) )
);
ob = "";
counter = 0;
While( ob == "",
Wait( 5 );
ob = Try( Window( "iris - Partial Least Squares of Petal width" ) << XPath( "//OutlineBox[ contains( text(), 'NIPALS Fit with' ) ]" ), "" );
Try( ob[1] << Prepend( Spacer Box( size( 800, 5 ), color( "red" ) ) ) );
);
回复:訪問適合 JSL 的大綱框 NIPALS@ih :當我用我的例子嘗試你的方式時,我收到錯誤信息:

我正在調用 PLS 使用
pls = Partial Least Squares(
Validation( :Validation ),
Initial Number of Factors( 15 ),
Centering( 0 ),
Scaling( 0 ),
Fit(
Method( NIPALS ),
Distance Plots( 1 ),
Diagnostics Plots( 1 ),
Overlay Loadings Plots( 1 ),
VIP vs Coefficients Plots( 1 ),
T Square Plot( 1 ),
Correlation Loading Plot( 2 ),
Overlay Coefficients Plots( 1 )
)
);
因為我需要 PLS 對話框來提示輸入 X 和 Y。
回复:訪問適合 JSL 的大綱框 NIPALS您可以使用 xpath 按名稱搜索所有輪廓框。
pls report << XPath("//OutlineBox[ contains( text(), 'NIPALS Fit with' ) ]");例子:
names default to here(1);
dt = Open( "$Sample_data/iris.jmp" );
pls = Partial Least Squares(
Y( :Petal width ),
X( :Sepal length, :Sepal width, :Petal length ),
Validation Method( KFold( 7 ), Initial Number of Factors( 3 ) ),
Fit( Method( NIPALS ), Number of Factors( 3 ) ),
Fit( Method( NIPALS ), Number of Factors( 2 ) )
);
//get all matching outline boxes:
ob = pls << XPath("//OutlineBox[ contains( text(), 'NIPALS Fit with' ) ]");
//Reference the first match:
ob[1] << Prepend ( Spacer Box( size( 800, 5 ), color( "red" ) ) );