您好,在我的脚本中,我想检测用户与gen reg中的解决方案路径交互的时刻(通过拖动解决方案路径图中的垂直线),以便根据所选模型生成一些自定义图表。 有什么建议吗?在此先感谢Matteo
我找到了一个使用mousetrap()的可能解决方案,唉有一些缺点
1)在第一个用户点击解决方案路径框架内,将出现一个刷新按钮。之后,解决方案路径的交互性照常恢复。
2)当用户点击刷新按钮时,恢复初始状态。
然后,我将在刷新按钮脚本中放置模型详解函数。
我正在寻找一个更好的解决方案,对用户来说不那么可见/不需要干预,如果有人能提出改进下面代码的建议,我会很高兴。
谢谢
马特奥
m = Fit Model(
Y( :Y ),
Effects( :X1, :X2, :X3 ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso( Adaptive ) ), Validation Method( AICc ) ) )
);
f1 = (m << report)[Outline Box( "Solution Path" )][frame box( 1 )];
f2 = (m << report)[Outline Box( "Solution Path" )][frame box( 2 )];
setSolutionPathTraps = Function( {fb1, fb2, bb},
Eval(
Eval Expr(
fb1 << add graphics script(
Mousetrap(
bb << visibility( "visible" ),
Expr( fb2 ) << remove graphics script( 1 );
Expr( fb1 ) << remove graphics script( 1 );
)
);
fb2 << add graphics script(
Mousetrap(
bb << visibility( "visible" ),
Expr( fb1 ) << remove graphics script( 1 );
Expr( fb2 ) << remove graphics script( 1 );
)
);
)
);
bb << visibility( "collapse" );
);
New Window( "a", bb = Button Box( "Refresh", setSolutionPathTraps( f1, f2, bb ) ) );
setSolutionPathTraps( f1, f2, bb );