Nome non risolto: il nome della colonna non verrà risolto quando lo specifico come valore in un elencoSto cercando di calcolare l'AUC per ogni colonna in una tabella dati. Sto raccogliendo tutti i nomi delle colonne in un elenco "colNamesList" e recuperando ciascun nome di colonna in Fit Model all'interno di un ciclo For incrementando il pedice dell'elenco. Tuttavia, la chiamata all'array non viene risolta all'interno della chiamata Fit Model.Se includo show(colNamesList[i]) su una riga separata, si risolve correttamente, ma non all'interno della chiamata Fit Model. Sto utilizzando uno script da un post precedente in questo forum e sospetto che la mia versione precedente di JMP (versione 9.0.0) richieda solo una sintassi leggermente diversa. Tutte le idee sarebbero apprezzate.
Names Default To Here( 1 );
// Open and example data table
dt = Open( "sample.jmp" );
// Get the columns to be analyzed
colNamesList = dt << get column names( string );
// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );
// Loop across all of the columns to be analyzed and retrieve the AUC
For( i = 1, i <= N Items( colNamesList ), i++,
// Add a new row to the output data table
dtOutput << Add Rows( 1 );
// Add the active variable name to the current row in the data table
dtOutput:var_name[i] = colNamesList[i];
// Run the Logistic Regression
theLog = dt << Fit Model(invisible, Y( :case ),Effects( column (colNameList[i]) ),Personality( Nominal Logistic ),Run(Positive Level( "1" ),Likelihood Ratio Tests( 1 ),ROC Curve( 1 ),));
// Add the AUC to the data table by grabbing it from the display report output
dtOutput:AUC = (Report( theLog )["Receiver Operating Characteristic"][numberbox(1)] << get text);
// Close the report window
Report( theLog ) << close window;
);
L'errore nel registro è il seguente:
Name Unresolved: colNameList{1}
in access or evaluation of 'colNameList' , colNameList
Exception in platform launch{1}
in access or evaluation of 'Fit Model' , Fit Model(
invisible,
Y( :case ),
Effects( Column( colNameList[i] ) ),
Personality( Nominal Logistic ),
Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
)
In the following script, error marked by /*###*/
Fit Model(
invisible,
Y( :case ),
Effects( Column( colNameList/*###*/[i] ) ),
Personality( Nominal Logistic ),
Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
)
Cannot subscript Display Box{1}
in access or evaluation of 'Subscript' , Report( theLog )["Receiver Operating Characteristic"]
In the following script, error marked by /*###*/
Names Default To Here( 1 );
dt = Open( "sample.jmp" );
colNamesList = dt << get column names( string );
dtOutput = New Table( "Results",
New Column( "var_name", character ),
New Column( "AUC", character )
);
For( i = 1, i <= N Items( colNamesList ), i++,
dtOutput << Add Rows( 1 );
dtOutput:var_name[i] = colNamesList[i];
theLog = dt << Fit Model(/*###*/invisible,
Y( :case ),
Effects( Column( colNameList[i] ) ),
Personality( Nominal Logistic ),
Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
);
dtOutput:AUC = Report( theLog )[/*###*/"Receiver Operating Characteristic"][
numberbox( 1 )] << get text;
Report( theLog ) << close window;
);Automazione e scriptingfinestreRi: Nome non risolto: il nome della colonna non verrà risolto quando lo specifico come valore in un elenco- Il motivo per cui il nome era irrisolto è perché hai chiamato l'elenco, colNamesList, e lo hai fatto riferimento come colNameLise.
- Il valore AUC deve essere posizionato in una riga definita, pertanto è necessario aggiungere il suscritto a dtOutput:AUC
Names Default To Here( 1 );
// Open and example data table
dt = Open( "sample.jmp" );
// Get the columns to be analyzed
colNamesList = dt << get column names( string );
// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );
// Loop across all of the columns to be analyzed and retrieve the AUC
For( i = 1, i <= N Items( colNamesList ), i++,
// Add a new row to the output data table
dtOutput << Add Rows( 1 );
// Add the active variable name to the current row in the data table
dtOutput:var_name[i] = colNamesList[i];
// Run the Logistic Regression
theLog = dt << Fit Model(
invisible,
Y( :case ),
Effects( Column( colNamesList[i] ) ),
Personality( Nominal Logistic ),
Run( Positive Level( "1" ), Likelihood Ratio Tests( 1 ), ROC Curve( 1 ) )
);
// Add the AUC to the data table by grabbing it from the display report output
dtOutput:AUC[i] = (Report( theLog )["Receiver Operating Characteristic"][numberbox( 1 )] << get text);
// Close the report window
Report( theLog ) << close window;
);
Ri: Nome non risolto: il nome della colonna non verrà risolto quando lo specifico come valore in un elencoSì, era un errore di battitura e correggerlo faceva parte della soluzione, quindi grazie per averlo visto. Ricevevo ancora un errore "impossibile trovare la colonna{1}" e il problema si è risolto facendo riferimento alla tabella dati quando si specificava la colonna: Column(dt, colNamesList[i]) invece di Column(colNamesList[i]). Poi ho ricevuto l'errore "Anche la risposta non dovrebbe essere un fattore, ^ 1case", quindi ho aggiunto un'istruzione IF per ignorare la colonna di risposta.Funzionava se aggiungevo il pedice ad AUC.
Quindi ecco il mio primo script jsl. Una bella esperienza di apprendimento. Grazie a txnelson per il tuo aiuto!
Names Default To Here( 1 );
// Open and example data table
dt = Open( "sample.jmp" );
// Get the columns to be analyzed
colNamesList = dt << get column names( string );
// Create a data table to save the results to
dtOutput = New Table( "Results", New Column( "var_name", character ), New Column( "AUC", character ) );
// Loop across all of the columns to be analyzed and retrieve the AUC
For( i = 1, i <= N Items( colNamesList ), i++,
// Add a new row to the output data table
dtOutput << Add Rows( 1 );
// Add the active variable name to the current row in the data table
dtOutput:var_name[i] = colNamesList[i];
//Get the next column name
colName = colNamesList[i];
// If the column is "case", leave AUC blank, otherwise run the Logistic Regression
if(colName=="case", AUC=.,
theLog = dt << Fit Model(
invisible,
Y(:case),
Effects(column(dt,colName)),
Personality( Nominal Logistic ),
Run(
Positive Level( "1" ),
Likelihood Ratio Tests( 1 ),
ROC Curve( 1 ),
)
);
// Add the AUC to the data table by grabbing it from the display report output
dtOutput:AUC[i] = (Report( theLog )["Receiver Operating Characteristic"][numberbox(1)] << get text);
);
// Close the report window
Report( theLog ) << close window;
);Ri: Nome non risolto: il nome della colonna non verrà risolto quando lo specifico come valore in un elencoOttimo lavoro!
È possibile evitare la risposta di errore modificando la riga in
try(Report( theLog ) << close window);
È inoltre possibile abbreviare e far funzionare JSL in modo più efficiente rimuovendo le assegnazioni duplicate a una singola istruzione
colName = dtOutput:var_name[i] = colNamesList[i];