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 ) ) ),
);
我正在嘗試使用附加腳本來擬合超過 1 個神經模型。如果我不寫 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;