JSL - 在平台功能内重复Names Default To Here( 1 );
// Create an Example data table
dt = currentdatatable();
// Get the names of the columns in the data table
colNames = dt << get column group( "WLS" );
nIters = 2;
Neural(
Y( :Type ),
X(eval(colNames)),
Validation Method( "KFold", 5 ),
Set Random Seed( 2 ),
for( k=1, k <= nIters, k++, Fit( NTanH ( 2 ) ) ),
);
我正在尝试使用附加脚本来拟合多个神经模型。如果我不使用 for 循环,而是多次写入 Fit( NTanH(2)),它会正常工作,但使用 for 循环则无法使其工作。有什么建议吗?谢谢!
自动化和脚本数据探索与可视化回复:JSL - 在平台功能中重复您可以将 Fit(NTanH()) 移到 Neural() 之外。 以下是脚本索引中的示例:

使用 for 循环从脚本索引修改版本:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Boston Housing.jmp");
obj = Neural(
Y(:mvalue),
X(:crim, :indus, :chas, :nox, :rooms, :age, :distance, :radial),
Set Random Seed(2)
);
For(i = 1, i <= 2, i++,
obj << Fit(NTanH(4));
);

回复:JSL - 在平台功能中重复嗨 Jarmo,这是一个我没有尝试过的选项,它是解决我的问题的方法。 工作正常。 谢谢!
回复:JSL - 在平台功能中重复嗨 Jarmo,下面是一个工作脚本:
Names Default To Here( 1 );
delete symbols();
dt = current data table();
colNames = dt << get column group("WLs");
exclColnames = dt << get excluded columns();
For( i = 1, i <= N Items( exclColnames ), i++,
Remove From( colNames, As List( Loc( colNames, exclColnames[i] ) ) )
);
rpt = New Window( "Neural of Type", dt <<
Neural(
Y( :Type ),
X( eval ( colNames ) ),
Informative Missing( 0 ),
Validation Method( "KFold", 5 ),
Set Random Seed( 2 ),
Fit( NTanH( 2 ) ),
Fit( NTanH( 2 ) ),
Fit( NTanH( 2 ) )
)
);
Wait( 0 );
rpt["Neural", Outline Box( 1 ), "Validation", "Type", Table Box( 1 )] <<
Make Combined Data Table;
rpt << Close Window;但是,我想让 Fit( NTanH(2)) 灵活。 你演示的方式在这里不起作用,我试图通过下一个脚本解决它(省略第一部分):
obj =Neural(
Y( :Type ),
X( eval ( colNames ) ),
Informative Missing( 0 ),
Validation Method( "KFold", 5 ),
Set Random Seed( 2 ),
);
for(i=1, i<=3, i++, obj << Fit( NTanH(2)));
rpt = current window();<BR />
Wait( 0 );
rpt["Neural", Outline Box( 1 ), "Validation", "Type", Table Box( 1 )] <<
Make Combined Data Table;
rpt << Close Window;
但现在我收到错误消息:“无法在访问或评估 'rpt[/*###*/"Neural",Outline Box(1),"Validation","Type",Table Box(1) 时下标显示框)]', rpt[/*###*/"Neural", Outline Box( 1 ), "Validation", "Type", Table Box( 1 )]"。 我不明白为什么会收到此消息,因为第一个脚本运行良好。
你有这个问题的解决方案吗?你能解释为什么我有这个问题,以便更好地理解 JSL 吗? 谢谢!
回复:JSL - 在平台功能中重复谢谢,Jarmo,那正是我要找的地方。 简单的线条,但对于刚接触 JSL 的人来说很难理解!
回复:JSL - 在平台功能中重复该代码未找到正确的引用,可能是更改 rpt = Current Window();到 rpt = Current Report() 就足够了,但我强烈建议使用您(可以)拥有的参考(在我的示例 obj 中)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Boston Housing.jmp");
obj = Neural(
Y(:mvalue),
X(:crim, :indus, :chas, :nox, :rooms, :age, :distance, :radial),
Set Random Seed(2),
<< Fit(NTanH(4)),
<< Fit(NTanH(4)),
<< Fit(NTanH(4))
);
For(i = 1, i <= 2, i++,
obj << Fit(NTanH(4));
);
Report(obj)[Outline Box("Neural")][Outline Box("Training")][Table Box(1)] << Make Combined Data Table;