Accéder à Outline Box NIPALS Fit dans JSLJe souhaite accéder dynamiquement à la partie fit du rapport PLS ("NIPALS fit with x factor"). Je sais que je peux y accéder si je connais le numéro de la boîte de contour (par exemple, OutlineBox (6)) ou le titre exact, mais comme le numéro du premier peut changer et que le second change en fonction du nombre de facteurs, je ont du mal à accéder dynamiquement à la zone de contour.
Existe-t-il un moyen d'obtenir la position arborescente d'une zone de contour en recherchant une partie de son nom ?
ScriptRe : Accéder à la boîte de contour NIPALS Fit dans JSLAvec l'extrait
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' ) ]");Je peux accéder à la fenêtre PLS et envoyer des messages, donc cela semble fonctionner.
Re : Accéder à la boîte de contour NIPALS Fit dans JSLIl semble que le pointeur "pls" vers la plate-forme Partial Least Squares () se perde lorsqu'il doit apparaître pour les entrées X et Y.Voici donc ci-dessous un véritable kluge d'une solution, qui utilise une référence au nom de la fenêtre de sortie qui sera produite pour l'exemple, et continue de vérifier pour voir quand elle apparaît, puis applique la ligne rouge.Je n'aime pas la solution... j'espère qu'un autre membre de la communauté a une meilleure solution
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" ) ) ) );
);
Re : Accéder à la boîte de contour NIPALS Fit dans JSL@ih : Lorsque j'essaie votre chemin avec mon exemple, j'obtiens le message d'erreur :

J'appelle le PLS en utilisant
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 )
)
);
parce que j'ai besoin de la boîte de dialogue PLS pour demander X et Y.
Re : Accéder à la boîte de contour NIPALS Fit dans JSLVous pouvez utiliser xpath pour rechercher toutes les boîtes de contour par nom.
pls report << XPath("//OutlineBox[ contains( text(), 'NIPALS Fit with' ) ]");Exemple:
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" ) ) );