在 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 Fit当必须弹出 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 Fit您可以使用 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" ) ) );