Explore Outliers
Explore Outliers using For Each
Summary: Process of exploring outliers in a data table by applying presets and generating reports with customized titles.
Code:
plat_samples = ["Explore Outliers" => {"Show All Methods"}, => {}];
dt = Open("data_table.jmp");
For Each( {sample}, plat_samples["Explore Outliers"],
obj = dt << Explore Outliers( Y( :"Q-E"n, :"ZN-E"n, :"PH-E"n, :"DBO-E"n, :"DQO-E"n, :"SS-E"n ) );
Eval( Eval Expr( obj << Apply Preset( "Sample Presets", Expr( sample ) ) ) );
obj << Set Report Title( sample );
);
Code Explanation:
- Define presets for outlier exploration.
- Open data table;
- Iterate over each preset.
- Run Explore Outliers analysis.
- Apply the current preset.
- Set the report title to the preset name.
Explore Outliers using Structural Equation Models
Summary: Creates and launches a Structural Equation Models analysis with specified model variables, generating an Explore Outliers output.
Code:
dt = Open("data_table.jmp");
obj = dt << Structural Equation Models( Model Variables( :Support_L, :Goal_L, :Work_L, :Interact_L ) );
obj << Launch Explore Outliers( 1 );
Code Explanation:
- Open data_table data
- Create Structural Equation Models object.
- Define model variables.
- Launch Explore Outliers analysis.
Example 1
Summary: Runs data table processing by identifying outlier columns, selecting a specific column, deleting selected columns, and re-analyzing outliers in JMP.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
Column( dt, "Q-E" ) << set selected( 1 );
dt << delete columns;
obj << Quantile Range Outliers;
obj << close window;
Code Explanation:
- Open data table.
- Identify outlier columns.
- Select column "Q-E".
- Delete selected columns.
- Analyze outliers again.
- Close outlier analysis window.
Example 2
Summary: Process of exploring outliers in a data table, selecting a column, deleting columns, and performing robust fit on outliers.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
Column( dt, "Q-E" ) << set selected( 1 );
dt << delete columns;
obj << Robust Fit Outliers;
obj << close window;
Code Explanation:
- Open data table;
- Explore outliers for Sensor Measurements.
- Select column "Q-E".
- Delete selected columns.
- Perform robust fit on outliers.
- Close explore outliers window.
Example 3
Summary: Explores and deletes outliers in a data table, utilizing Multivariate Robust Outliers analysis.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
Column( dt, "Q-E" ) << set selected( 1 );
dt << delete columns;
obj << Multivariate Robust Outliers;
obj << close window;
Code Explanation:
- Open data table;
- Explore outliers on Sensor Measurements
- Select column "Q-E"
- Delete selected columns
- Perform Multivariate Robust Outliers
- Close outlier exploration window
Example 4
Summary: Process of identifying outliers in a data table, selecting columns, and performing multivariate k-Nearest Neighbor analysis with a specified value for k.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( dt << Get Column Group( "Sensor Measurements" ) ) );
Column( dt, "Q-E" ) << set selected( 1 );
dt << delete columns;
obj << Multivariate k Nearest Neighbor Outliers( K( 8 ) );
obj << close window;
Code Explanation:
- Open data table;
- Explore outliers for Sensor Measurements.
- Select column "Q-E".
- Delete selected columns.
- Perform multivariate kNN outliers.
- Set k to 8.
- Close outlier exploration window.
Example 5
Summary: Explores outliers in a dataset by identifying quantile range outliers for height and weight variables.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Quantile Range Outliers );
Code Explanation:
- Open table.
- Assign dataset to dt.
- Create outlier exploration object.
- Set Y variables: height, weight.
- Use Quantile Range Outliers method.
Example 6
Summary: Process of identifying and culled outliers in a data table by configuring Robust Fit Outliers with K Sigma set to 1, and capturing the log of formula script for 'Culled' columns.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ) ) );
obj << Formula Columns( Suffix( "Culled" ) );
Log Capture( obj << Formula Script( Suffix( "Culled" ) ) );
Code Explanation:
- Open data table;
- Launch Explore Outliers platform.
- Set height and weight as Y variables.
- Configure Robust Fit Outliers with K Sigma set to 1.
- Add formula columns with suffix "Culled".
- Capture log of formula script for "Culled" columns.
Example 7
Summary: Process of identifying outliers in a data table, using robust fit with K Sigma set to 1, and captures the log of formula script with new columns prefixed with 'New'.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ) ) );
Log Capture( obj << Formula Script( Prefix( "New" ) ) );
obj << Formula Columns( Prefix( "New" ) );
Code Explanation:
- Open data table;
- Explore outliers for height and weight.
- Use robust fit with K Sigma set to 1.
- Capture log of formula script.
- Prefix new columns with "New".
Example 8
Summary: Process of exploring outliers in a data table, applying robust fit parameters and capturing log output, while modifying formula columns with prefixes and suffixes.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ) ) );
Log Capture( obj << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Code Explanation:
- Open data_table data
- Create outlier exploration object.
- Set robust fit parameters.
- Capture log output.
- Add prefix "New" to formulas.
- Add suffix "Culled" to formulas.
- Apply formula columns with modifications.
Example 9
Summary: Explores and filters outliers in a data table, utilizing robust fit methods to identify anomalies in 'height' and 'weight' columns, with log capture for output.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Cauchy( 1 ) ) );
obj << Formula Columns( Suffix( "Culled" ) );
Log Capture( obj << Formula Script( Suffix( "Culled" ) ) );
Code Explanation:
- Open data table;
- Explore outliers for columns "height" and "weight".
- Use robust fit method.
- Set K Sigma to 1.
- Set Huber to 0.
- Set Cauchy to 1.
- Add suffix "Culled" to formula columns.
- Capture log output.
- Execute formula script with "Culled" suffix.
- Save log capture.
Example 10
Summary: Process of exploring outliers in a data table, applying robust fit methods to height and weight variables, and capturing log output with formula scripting.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Cauchy( 1 ) ) );
Log Capture( obj << Formula Script( Prefix( "New" ) ) );
obj << Formula Columns( Prefix( "New" ) );
Code Explanation:
- Open data table.
- Explore outliers for height and weight.
- Use robust fit with specified methods.
- Capture log of formula script.
- Apply prefix to new columns.
Example 11
Summary: Process of identifying outliers in a data table and capturing log output, utilizing Explore Outliers and Formula Columns to create new columns with prefixes and suffixes.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Cauchy( 1 ) ) );
Log Capture( obj << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Code Explanation:
- Open data table;
- Create Explore Outliers object.
- Set robust fit outliers parameters.
- Capture log output.
- Add formula columns with prefix "New".
- Add formula columns with suffix "Culled".
Example 12
Summary: Explores and filters outliers in a data table, utilizing robust fit parameters and formula columns with suffixes.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
obj << Formula Columns( Suffix( "Culled" ) );
Log Capture( obj << Formula Script( Suffix( "Culled" ) ) );
Code Explanation:
- Open data table.
- Create outlier exploration object.
- Set robust fit parameters.
- Add suffix to formula columns.
- Capture log output.
Example 13
Summary: Process of exploring outliers in a data table, utilizing robust fit methods and log capture for enhanced analysis.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
Log Capture( obj << Formula Script( Prefix( "New" ) ) );
obj << Formula Columns( Prefix( "New" ) );
Code Explanation:
- Open data table.
- Explore outliers for height and weight.
- Use robust fit method.
- Set K Sigma to 1.
- Set Huber to 0.
- Set Quartile to 1.
- Capture log output.
- Prefix new formula script.
- Apply prefix to formula columns.
- Save changes to dataset.
Example 14
Summary: Process of exploring outliers in a data table, applying robust fit parameters and logging capture formula scripts with prefix and suffix modifications.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
Log Capture( obj << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Code Explanation:
- Open data table.
- Explore outliers for height and weight.
- Set robust fit parameters.
- Log capture formula script.
- Apply prefix and suffix to formulas.
- Add formula columns with new names.
Example 15
Summary: Process of identifying and culled outliers in a data table, using robust fit method and K Sigma to 1, with interactive filtering by sex.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ) ) );
obj[1] << Formula Columns( Suffix( "Culled" ) );
Log Capture( obj[1] << Formula Script( Suffix( "Culled" ) ) );
Code Explanation:
- Open data table.
- Explore outliers for specified variables.
- Group analysis by sex.
- Use robust fit method.
- Set K Sigma to 1.
- Access first analysis object.
- Add formula columns with suffix.
- Capture log of formula script.
- Apply suffix to culled data.
- Log the formula script for culled data.
Example 16
Summary: Explores outliers in a data table, grouping analysis by Sex and applying robust fit method with K Sigma set to 1, while capturing log of outlier analysis and prefixing formula script and columns with 'New'.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ) ) );
Log Capture( obj[1] << Formula Script( Prefix( "New" ) ) );
obj[1] << Formula Columns( Prefix( "New" ) );
Code Explanation:
- Open data table;
- Explore outliers for specified variables.
- Group analysis by Sex.
- Use robust fit method.
- Set K Sigma to 1.
- Capture log of outlier analysis.
- Prefix formula script with "New".
- Apply formula columns with prefix "New".
Example 17
Summary: Explores and transforms a data table to identify outliers, group analysis by sex, and prefix/suffix new columns with specific labels.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ) ) );
Log Capture( obj[1] << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj[1] << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Code Explanation:
- Open data table.
- Explore outliers for multiple variables.
- Group analysis by sex.
- Use robust fit method.
- Set outlier detection to 1 sigma.
- Capture log of formula script.
- Prefix new columns with "New".
- Suffix culled columns with "Culled".
- Apply formula to columns.
- Prefix columns with "New".
- Suffix columns with "Culled".
Example 18
Summary: Process of exploring outliers in a data table, applying robust fit methods, and modifying formula columns suffixes, while grouping analysis by sex.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Cauchy( 1 ) ) );
obj[2] << Formula Columns( Suffix( "Culled" ) );
Log Capture( obj[2] << Formula Script( Suffix( "Culled" ) ) );
Code Explanation:
- Open data table;
- Explore outliers for specified columns.
- Apply robust fit method.
- Set outlier detection parameters.
- Group analysis by sex.
- Modify formula columns suffix.
- Log captured formula script.
Example 19
Summary: Detects and handles outliers in a data table, utilizing Explore Outliers to identify anomalies and Log Capture to record output.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Cauchy( 1 ) ) );
Log Capture( obj[2] << Formula Script( Prefix( "New" ) ) );
obj[2] << Formula Columns( Prefix( "New" ) );
Code Explanation:
- Open data table.
- Create Explore Outliers object.
- Specify response variables.
- Use Sex for grouping.
- Apply Robust Fit Outliers method.
- Set K Sigma to 1.
- Set Huber to 0.
- Set Cauchy to 1.
- Capture log output.
- Add new formula columns.
Example 20
Summary: Explores and filters outliers in a data table, utilizing robust fit methods and formula columns with custom prefixes and suffixes.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Cauchy( 1 ) ) );
Log Capture( obj[2] << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj[2] << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Code Explanation:
- Open data table.
- Explore outliers for multiple variables.
- Apply robust fit outliers method.
- Set K Sigma parameter to 1.
- Set Huber parameter to 0.
- Set Cauchy parameter to 1.
- Capture log of formula script.
- Prefix new columns with "New".
- Suffix new columns with "Culled".
- Apply formula columns with specified prefix and suffix.
Example 21
Summary: Process of exploring outliers in a data table, grouping analysis by sex, and renaming formula columns with a suffix.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
obj[1] << Formula Columns( Suffix( "Culled" ) );
Log Capture( obj[2] << Formula Script( Suffix( "Culled" ) ) );
Code Explanation:
- Open data table;
- Explore outliers for selected variables.
- Group analysis by sex.
- Use robust fit method.
- Set outlier detection parameters.
- Rename formula columns with suffix.
- Capture log of formula script.
- Apply suffix to formula script.
Example 22
Summary: Explores outliers in a data table, grouping by sex and configuring robust fit outlier settings, while capturing log formulas and prefixing new columns with 'New'.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
Log Capture( obj[2] << Formula Script( Prefix( "New" ) ) );
obj[1] << Formula Columns( Prefix( "New" ) );
Code Explanation:
- Open data table;
- Create outlier exploration object.
- Set Y variables for analysis.
- Use Sex variable to group data.
- Configure robust fit outliers settings.
- Capture log of outlier formulas.
- Prefix new formula columns with "New".
Example 23
Summary: Process of exploring outliers in a data table, applying robust fit method, and modifying formula column names.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
Log Capture( obj[1] << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj[2] << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Close( dt, nosave );
makeFormCols = 1;
Code Explanation:
- Open data table.
- Explore outliers for specified columns.
- Apply robust fit method.
- Capture log of formula script.
- Modify formula column names.
- Close data table without saving.
- Set makeFormCols variable to 1.
Example 24
Summary: Explores and clears outliers in a data table using Robust PCA, saving cleaned data, residuals, scaled residuals, and low rank approximation, while deleting added columns.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( 7 :: 106 ), Robust PCA Outliers( Center( 1 ), Scale( 1 ) ) );
p = N Col( dt );
For( i = 1, i <= 10, i++,
obj << Save Cleaned( Trim( 2 ), Impute( 3 ), Make Missing( 5 ) );
obj << Save Residuals;
obj << Save Scaled Residuals;
obj << Save Low Rank Approx;
dt << Delete Column( (p + 1) :: N Col( dt ) );
);
obj << close window;
Code Explanation:
- Open data table.
- Explore outliers using Robust PCA.
- Count columns in data table.
- Loop 10 times.
- Save cleaned data.
- Save residuals.
- Save scaled residuals.
- Save low rank approximation.
- Delete added columns.
- Close outlier exploration window.
Example 25
Summary: Process of identifying outliers in a data table by creating an outlier exploration object, setting the tail quantile to zero, rescanning for outliers, and closing the outlier window.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Quantile Range Outliers );
obj << Tail Quantile( . );
obj << Rescan;
obj << close window;
Code Explanation:
- Open data table.
- Create outlier exploration object.
- Set tail quantile to zero.
- Rescan for outliers.
- Close the outlier window.
Example 26
Summary: Explores and transforms a data table by identifying outliers, capturing log information, and modifying formula columns.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :T, :P, :QRST, :J, :Heart rate ), By( :Sex ), Robust Fit Outliers( K Sigma( 1 ), Huber( 0 ), Quartile( 1 ) ) );
Log Capture( obj[1] << Formula Script( Prefix( "New" ), Suffix( "Culled" ) ) );
obj[2] << Formula Columns( Prefix( "New" ), Suffix( "Culled" ) );
Code Explanation:
- Open data table.
- Create outlier exploration object.
- Set robust fit parameters.
- Capture log of formula script.
- Apply prefix to formula script.
- Apply suffix to formula script.
- Modify formula columns.
- Apply prefix to formula columns.
- Apply suffix to formula columns.
Example 27
Summary: Explores outliers in a data table, identifying quantile range outliers and capturing missing value codes for further analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( :BP ), Tail Quantile( 0.25 ), Q( 1.5 ), Quantile Range Outliers, By( :Y Binary, :Y Ordinal ) );
Log Capture( obj[1] << Add Highest Nines to Missing Value Codes( :BP ) );
MVC_Prop = Char( Column( dt, "BP" ) << Get Property( "Missing Value Codes" ) );
obj << close window;
Code Explanation:
- Open data table;
- Explore outliers for BP.
- Set tail quantile to 0.25.
- Use Q value of 1.5.
- Identify quantile range outliers.
- Group by Y Binary and Y Ordinal.
- Log capture highest nines as missing.
- Retrieve missing value codes for BP.
- Convert MVC to character.
- Close outlier exploration window.
Example 28
Summary: Explores outliers in a data table, generating XML output for labeled and unlabeled outlier detection, and closing the corresponding windows.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Label( :name ), Y( :height, :weight ), Quantile Range Outliers );
obj2 = dt << Explore Outliers( Y( :height, :weight ), Quantile Range Outliers );
output1 = obj << get xml;
output2 = obj2 << get xml;
obj << close window;
obj2 << close window;
Code Explanation:
- Open data table;
- Explore outliers with labels.
- Explore outliers without labels.
- Get XML output for labeled exploration.
- Get XML output for unlabeled exploration.
- Close labeled exploration window.
- Close unlabeled exploration window.
Example 29
Summary: Explores outliers in a data table, generating XML output for labeled and unlabeled outlier detection.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Label( :name ), Y( :height, :weight ), Robust Fit Outliers );
obj2 = dt << Explore Outliers( Y( :height, :weight ), Robust Fit Outliers );
output1 = obj << get xml;
output2 = obj2 << get xml;
obj << close window;
obj2 << close window;
Code Explanation:
- Open data table.
- Explore outliers with label.
- Explore outliers without label.
- Get XML output for labeled exploration.
- Get XML output for unlabeled exploration.
- Close labeled exploration window.
- Close unlabeled exploration window.
Example 30
Summary: Explores outliers in a data table, utilizing various options such as label and grouping, and creates a validation column for random sampling.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( :height, :weight ) );
obj << close window;
obj = dt << Explore Outliers( Y( :height, :weight ), Label( :name ) );
obj << close window;
obj = dt << Explore Outliers( Y( :height, :weight ), By( :sex ) );
obj << close window;
isPro = 1;
If( isPro,
dt << Make Validation Column( Random Seed( 123456789 ), Go );
obj = dt << Explore Outliers( Y( :height, :weight ), Validation( :Validation ) );
obj << close window;
);
Code Explanation:
- Open data table.
- Explore outliers for height and weight.
- Close outlier exploration window.
- Explore outliers with name labels.
- Close outlier exploration window.
- Explore outliers by sex.
- Close outlier exploration window.
- Set isPro flag to 1.
- Create validation column if isPro.
- Explore outliers with validation column.
Example 31
Summary: Explores outliers in a data table, specifically for height and weight variables, using various methods such as Huber, Cauchy, and Quartile.
Code:
dt = Open("data_table.jmp");
obj = Explore Outliers( Y( :height, :weight ), Robust Fit Outliers );
obj << Huber( 0 );
obj << Cauchy( 1 );
obj << Cauchy( 0 );
obj << Quartile( 1 );
obj << Quartile( 0 );
obj << Huber( 1 );
obj << Cauchy( 1 );
obj << Quartile( 1 );
obj << close window;
Code Explanation:
- Open data table.
- Explore outliers for height and weight.
- Set Huber method parameter to 0.
- Set Cauchy method parameter to 1.
- Set Cauchy method parameter to 0.
- Set Quartile method parameter to 1.
- Set Quartile method parameter to 0.
- Set Huber method parameter to 1.
- Set Cauchy method parameter to 1.
- Set Quartile method parameter to 1.
Example 32
Summary: Explores outliers in a data table, specifically for 'Sensor Measurements', and configures quantile range outliers with Q4 and tail quantile 0.05.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Quantile Range Outliers( Q( 4 ), Tail Quantile( 0.05 ) ) );
obj2 = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
obj2 << Quantile Range Outliers;
obj2 << Q( 4 );
obj2 << Tail Quantile( 0.05 );
obj2 << Rescan;
obj << close window;
obj2 << close window;
Code Explanation:
- Open data table;
- Explore outliers for Sensor Measurements.
- Set quantile range to Q4.
- Set tail quantile to 0.05.
- Repeat outlier exploration.
- Apply quantile range outliers.
- Set quantile range to Q4.
- Set tail quantile to 0.05.
- Rescan for outliers.
- Close both windows.
Example 33
Summary: Explores outliers in a data table, specifically for Sensor Measurements, using robust fit methods and configuring K Sigma, Cauchy, and Quartile parameters.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers(
Y( Column Group( "Sensor Measurements" ) ),
Robust Fit Outliers( K Sigma( 2 ), Huber( 1 ), Cauchy( 1 ), Quartile( 1 ) )
);
obj2 = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
obj2 << Robust Fit Outliers;
obj2 << K Sigma( 2 );
obj2 << Cauchy( 1 );
obj2 << Quartile( 1 );
obj2 << Rescan;
obj << close window;
obj2 << close window;
Code Explanation:
- Open data table;
- Create Explore Outliers object.
- Set Y as Sensor Measurements.
- Configure robust fit outliers.
- Create second Explore Outliers object.
- Set Y as Sensor Measurements.
- Enable robust fit outliers.
- Set K Sigma to 2.
- Set Cauchy to 1.
- Set Quartile to 1.
- Rescan data.
- Close first window.
- Close second window.
Example 34
Summary: Explores outliers in a data table by creating two Explore Outliers objects, configuring Robust PCA Outliers, and executing the analysis.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers(
Y( Column Group( "Sensor Measurements" ) ),
Robust PCA Outliers( Lambda( 0.2 ), Center( 0 ), Scale( 0 ), MaxIt( 35 ), Outlier Threshold( 1.5 ) )
);
obj2 = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
obj2 << Robust PCA Outliers( Lambda( 0.2 ), Center( 0 ), Scale( 0 ), MaxIt( 35 ), Outlier Threshold( 1.5 ) );
Code Explanation:
- Open data table.
- Create Explore Outliers object.
- Set Y variable group.
- Configure Robust PCA Outliers.
- Execute Explore Outliers.
- Create second Explore Outliers object.
- Set Y variable group again.
- Configure Robust PCA Outliers again.
- Execute Robust PCA Outliers.
- Save results.
Example 35
Summary: Explores outliers in sensor measurements, utilizing k Nearest Neighbor Outliers to identify anomalies and repeating the process with a specified K value.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), k Nearest Neighbor Outliers( K( 3 ) ) );
obj2 = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
obj2 << k Nearest Neighbor Outliers( K( 3 ) );
Code Explanation:
- Open table.
- Explore outliers on sensors.
- Set K to 3 neighbors.
- Repeat outlier exploration.
- Apply K nearest neighbor method.
- Set K to 3 neighbors again.
Example 36
Summary: Explores outliers in a table, utilizing Robust PCA method with specified parameters and logs capture results.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers(
Y( Column Group( "Sensor Measurements" ) ),
Robust PCA Outliers( Lambda( 0.2 ), Center( 0 ), Scale( 0 ), MaxIt( 35 ) )
);
Log Capture(
rpca = runMultivariateRobustPCA(
dt[0, 2 :: 39], TrainRows = [], center = 0, scale = 0, tol = 0.0000001, maxIter = 35, useRandomSVD = 0, showDetails = 0,
lambda = 0.2
)
);
obj << close window;
Code Explanation:
- Open table.
- Explore outliers.
- Define Y variables.
- Use Robust PCA method.
- Set Lambda to 0.2.
- Center data at 0.
- Scale data at 0.
- Set maximum iterations to 35.
- Close window.
- Log capture results.
Example 37
Summary: Explores outliers in a data table using Robust PCA, capturing log output and closing the outlier window.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( 6 :: 13 ), Robust PCA Outliers( Lambda( 0.789654123 ), Center( 1 ), Scale( 0 ), MaxIt( 37 ) ) );
Log Capture(
rpca = runMultivariateRobustPCA(
dt[0, 6 :: 13], TrainRows = [], center = 1, scale = 0, tol = 0.0000001, maxIter = 37, useRandomSVD = 0, showDetails = 0,
lambda = 0.789654123
)
);
obj << close window;
Code Explanation:
- Open data table;
- Explore outliers using Robust PCA.
- Capture log output.
- Run multivariate Robust PCA.
- Set parameters for Robust PCA.
- Execute Robust PCA algorithm.
- Close outlier exploration window.
Example 38
Summary: Explores outliers in a data table using Robust PCA, configuring parameters and capturing log results.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers(
Y( Column Group( "Laboratory Results" ) ),
Robust PCA Outliers( Lambda( 0.0339862892978446 ), Center( 1 ), Scale( 1 ), MaxIt( 38 ) )
);
Log Capture(
rpca = runMultivariateRobustPCA(
x = dt[0, 11 :: 37], TrainRows = [], center = 1, scale = 1, tol = 0.0000001, maxIter = 38, useRandomSVD = 0, showDetails = 0,
lambda = 0.0339862892978446
)
);
obj << close window;
Code Explanation:
- Open data table.
- Explore outliers using Robust PCA.
- Set Y variable as Laboratory Results.
- Configure Robust PCA parameters.
- Log capture of Robust PCA results.
- Define input variables for Robust PCA.
- Set Robust PCA options.
- Execute Robust PCA function.
- Close outlier exploration window.
Example 39
Summary: Explores outliers in a data table by identifying robust principal component analysis (PCA) outliers and clearing all selections.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Robust PCA Outliers );
dt << Clear Select;
dt << Clear Column Selection;
Code Explanation:
- Open data table;
- Create outlier exploration object.
- Set Y variable as "Sensor Measurements".
- Use Robust PCA for outliers.
- Clear all selections in data table.
- Clear column selections in data table.
Example 40
Summary: Process of identifying outliers in a specified range of variables using Robust PCA Outliers method, and clears selected rows and column selection.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( 3 :: 21 ), Robust PCA Outliers( Lambda( 0.5 ), Center( 0 ), Scale( 0 ) ) );
dt << Clear Select;
dt << Clear Column Selection;
Code Explanation:
- Open data table;
- Create Explore Outliers object.
- Set Y variables 3 to 21.
- Use Robust PCA Outliers method.
- Set Lambda to 0.5.
- Center data at 0.
- Scale data at 0.
- Clear selected rows.
- Clear column selection.
Example 41
Summary: Explores and analyzes outliers in a data table, utilizing the Explore Outliers platform to identify quantile range outliers and robust fit outliers.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ), By( :Y Ordinal, :Gender ) );
obj << Quantile Range Outliers( Tail Quantile( 0.25 ), Q( 1.5 ) );
Log Capture( obj << Select Rows );
Log Capture( obj << Exclude Rows );
dt << Clear Select << Select Excluded << Exclude( 0 ) << Clear Select;
obj << close window;
obj = dt << Explore Outliers( Y( :Age, :BMI, :BP, :Total Cholesterol, :LDL, :HDL, :TCH, :LTG, :Glucose ), By( :Y Ordinal, :Gender ) );
obj << Robust Fit Outliers( K Sigma( 3 ) );
Log Capture( obj << Select Rows );
Log Capture( obj << Exclude Rows );
dt << Clear Select << Select Excluded << Exclude( 0 ) << Clear Select;
Code Explanation:
- Open data table;
- Explore outliers for multiple variables.
- Set quantile range for outliers.
- Log selected rows.
- Log excluded rows.
- Clear selection.
- Close outlier exploration window.
- Re-explore outliers using robust fit.
- Set robust fit parameters.
- Log selected and excluded rows.
Example 42
Summary: Explores outliers in a data table by creating an Explore Outliers object and setting the Y variable group.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
Code Explanation:
- Open data table;
- Create Explore Outliers object.
- Set Y variable group.
Example 43
Summary: Runs the exploration and selection of outliers in a multivariate dataset using the Multivariate k-Nearest Neighbor method, grouping by binary and ordinal Y variables.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers(
Y( :BMI, :BP, :Total Cholesterol, :LDL ),
Name( "Multivariate k-Nearest Neighbor Outliers" )(K( 2 )),
By( :Y Binary, :Y Ordinal )
);
p = N Col( dt );
obj[1] << Save NN Distances;
selRows1 = dt << Select Where( :Y Binary == "Low" & :Y Ordinal == "Low" ) << Get Selected Rows;
selRows2 = dt << Invert Row Selection << Get Selected Rows;
countNN = N Row( selRows1 ) * 2;
obj[2] << Save NN Distances;
selRows1 = dt << Select Where( :Y Binary == "Low" & :Y Ordinal == "Medium" ) << Get Selected Rows;
selRows2 = dt << Invert Row Selection << Get Selected Rows;
obj[3] << Save NN Distances;
selRows1 = dt << Select Where( :Y Binary == "High" & :Y Ordinal == "High" ) << Get Selected Rows;
selRows2 = dt << Invert Row Selection << Get Selected Rows;
obj << close window;
Code Explanation:
- Open data table;
- Explore outliers for selected columns.
- Set multivariate k-Nearest Neighbor method.
- Use K=2 for outlier detection.
- Group by binary and ordinal Y variables.
- Count number of columns in dataset.
- Save nearest neighbor distances for first group.
- Select rows where both Y variables are "Low".
- Invert row selection to get other rows.
- Calculate count of nearest neighbors for selected rows.
Example 44
Summary: Explores outliers in a data table using Robust PCA method, with lambda value set to 0.25 and centered/scaled at 0.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( :height, :weight ), Robust PCA Outliers( Lambda( 0.25 ), Center( 0 ), Scale( 0 ) ) );
obj2 = dt << Explore Outliers( Y( :height, :weight ), Lambda( 0.25 ), Center( 0 ), Scale( 0 ), Robust PCA Outliers );
Code Explanation:
- Open data table.
- Assign table to variable.
- Explore outliers for height and weight.
- Use Robust PCA method.
- Set lambda value to 0.25.
- Center data at 0.
- Scale data at 0.
- Assign result to variable.
- Explore outliers again for height and weight.
- Use Robust PCA method with same parameters.
Example 45
Summary: Explores outliers in sensor measurements data, utilizing the quantile range method with a tail quantile set to 0.2 and a quantile set to 0.6.
Code:
dt = Open("data_table.jmp");
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Quantile Range Outliers( Tail Quantile( 0.2 ), Q( 0.6 ) ) );
Code Explanation:
- Open data table.
- Explore outliers for sensor measurements.
- Use quantile range method.
- Set tail quantile to 0.2.
- Set quantile to 0.6.
Explore Outliers using Preferences
Summary: Explores outliers in a data table by generating a report and extracting a summary table, utilizing advanced linear algebra routines.
Code:
dt = Open("data_table.jmp");
Preferences( Enable Advanced Linear Algebra Routines( 1 ) );
Log Capture( obj = dt << Explore Outliers( Y( Column Group( "Responses" ) ), Robust PCA Outliers( Use Randomized SVD( 1 ) ) ) );
rpt = Report( obj );
summary = rpt[Table Box( 1 )] << Get as matrix;
obj << close window;
Code Explanation:
- Open data table;
- Enable advanced linear algebra.
- Log outlier exploration.
- Create report object.
- Extract summary table.
- Close report window.
Explore Outliers using New Column
Example 1
Summary: Process of assigning group labels to data rows and identifying outliers in a dataset, utilizing the Explore Outliers platform.
Code:
dt = Open("data_table.jmp");
dt << New Column( "By", Character, "Nominal" );
n = N Row( dt );
maxRow = ind = 1;
While( maxRow < n,
n2 = Random Integer( 1, 10 );
upper = Min( (maxRow + n2), n );
dt[maxRow :: upper, "By"] = Char( ind );
ind++;
maxRow = maxRow + n2 + 1;
);
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), By( :By ) );
nObj = Length( obj );
byCol = dt[0, "By"];
groups = Associative Array( dt[0, "By"] ) << Get Keys;
For( i = 1, i <= Length( obj ), i++,
myK = N Row( Loc( byCol, Char( i ) ) );
obj[i] << K Nearest Neighbor Outliers( K( myK ) );
);
obj << close window;
Code Explanation:
- Open data table;
- Create new column "By".
- Initialize row count.
- Initialize variables for loop.
- Loop through rows, assign group labels.
- Explore outliers by "Sensor Measurements".
- Count number of outlier objects.
- Retrieve unique group keys.
- Loop through outlier objects.
- Set K for KNN outliers.
Example 2
Summary: Process of assigning random groups and exploring outliers in a data table, utilizing Robust PCA and saving residuals.
Code:
dt = Open("data_table.jmp");
dt << New Column( "Group", Numeric, "Nominal", Format( "Best", 12 ) ) << Move Selected Columns( {:Group}, after( :Date ) ) <<
Begin Data Update;
For Each Row( dt, :Group = Random Integer( 1, 5 ) );
dt << End Data Update;
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Robust PCA Outliers, By( :Group ) );
obj << Save Residuals;
dt << Clear Column Selection << Select Columns( {"Q-E Resid By Group"} ) << Delete Columns;
For( i = 1, i <= 5, i++,
obj << Save Residuals;
);
obj << close window;
Code Explanation:
- Open data table.
- Add new column "Group".
- Move "Group" after "Date".
- Begin data update.
- Assign random group values.
- End data update.
- Explore outliers using Robust PCA.
- Save residuals.
- Clear column selection.
- Delete "Q-E Resid By Group".
- Loop to save residuals 5 times.
- Close outlier exploration window.
Explore Outliers using Log Capture
Example 1
Summary: Explores outliers in a data table using Robust PCA, with specified lambda value, centering, scaling, and maximum iterations.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Explore Outliers( Y( 10 :: 15 ), Robust PCA Outliers( Lambda( 0.3456789 ), Center( 0 ), Scale( 1 ), MaxIt( 35 ) ) )
);
Log Capture(
rpca = runMultivariateRobustPCA(
dt[0, 10 :: 15], TrainRows = [], center = 0, scale = 1, tol = 0.0000001, maxIter = 35, useRandomSVD = 0, showDetails = 0,
lambda = 0.3456789
)
);
obj << close window;
Code Explanation:
- Open data table;
- Log outlier exploration.
- Explore outliers using Robust PCA.
- Set Lambda to 0.3456789.
- Center data at 0.
- Scale data to 1.
- Set maximum iterations to 35.
- Log robust PCA execution.
- Run multivariate Robust PCA.
- Close outlier exploration window.
Example 2
Summary: Process of exploring outliers in a data table, utilizing Robust PCA and Quantile Range Outliers to identify anomalies.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Explore Outliers(
Y( Column Group( "Sensor Measurements" ) ),
Robust PCA Outliers( Lambda( 0.2 ), Center( 1 ), Scale( 1 ), MaxIt( 1 ) )
)
);
obj << close window;
Close( dt, nosave );
dt = New Table( "S1540172",
Add Rows( 5 ),
New Column( "x", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [0, 1, 2, 1, 9999] ), Set Display Width( 78 ) ),
New Column( "x2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [9999, 1, 2, 1, 0] ), Set Display Width( 78 ) )
);
obj = dt << Explore Outliers( Y( :x ), Quantile Range Outliers( Tail Quantile( 0.4 ), Q( 1 ) ) );
obj2 = dt << Explore Outliers( Y( :x2 ), Quantile Range Outliers( Tail Quantile( 0.4 ), Q( 1 ) ) );
Code Explanation:
- Open data table.
- Log capture start.
- Explore outliers using Robust PCA.
- Close outlier exploration window.
- Close original data table without saving.
- Create new table "S1540172".
- Add rows to new table.
- Add column "x" with values.
- Add column "x2" with values.
- Explore outliers for column "x".
- Explore outliers for column "x2".
Example 3
Summary: Explores outliers in a data table using Robust PCA Outliers method, with specified parameters for Lambda, Center, Scale, and MaxIt.
Code:
dt = Open("data_table.jmp");
Log Capture(
obj = dt << Explore Outliers(
Y( Column Group( "Sensor Measurements" ) ),
Robust PCA Outliers( Lambda( 0.2 ), Center( 1 ), Scale( 1 ), MaxIt( 1 ) )
)
);
obj << close window;
Code Explanation:
- Open data table;
- Start Log Capture.
- Explore outliers on Sensor Measurements.
- Use Robust PCA Outliers method.
- Set Lambda to 0.2.
- Center data at 1.
- Scale data at 1.
- Set MaxIt to 1.
- Close log capture window.
- Close outlier exploration window.
Explore Outliers using Select Rows
Example 1
Summary: Process of identifying outliers in a data table, using Robust PCA and saving residuals and low rank approximations.
Code:
dt = Open("data_table.jmp");
dt << Select Rows( 11 :: N Row( dt ) ) << Delete Rows();
obj = dt << Explore Outliers( Y( Column Group( "Processes" ) ), Robust PCA Outliers( Center( 0 ), Scale( 0 ) ) );
obj << Save Residuals;
obj << Save Low Rank Approx;
Code Explanation:
- Open data table.
- Select rows 11 to last.
- Delete selected rows.
- Explore outliers on processes.
- Use Robust PCA for outliers.
- Center data at zero.
- Scale data at zero.
- Save residuals to table.
- Save low rank approximation.
- End script execution.
Example 2
Summary: Explores outliers in a data table by selecting specific rows, excluding others, and creating an outlier object using quantile range method.
Code:
dt = Open("data_table.jmp");
dt << Clear Select << Select Rows( {108} ) << Exclude( 1 );
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Quantile Range Outliers );
Code Explanation:
- Open data table.
- Clear previous selections.
- Select row 108.
- Exclude selected row.
- Create outlier exploration object.
- Set Y variable group.
- Specify sensor measurements column.
- Use quantile range method.
Example 3
Summary: Process of exploring outliers in a data table, generating two journals with outlier detection results for both the original and subset tables.
Code:
dt = Open("data_table.jmp");
dt << Select Rows( 500 :: N Row( dt ) ) << Hide and Exclude( 1 );
dt << Invert Row Selection;
dtSub = dt << Subset( Output Table Name( "Subset of Data" ), Selected Rows( 1 ), All Columns( 1 ) );
dt << Clear Select;
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Robust PCA Outliers( Lambda( 0.08 ) ) );
obj2 = dtSub << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ), Robust PCA Outliers( Lambda( 0.08 ) ) );
jrn1 = Collapse Whitespace( Char( obj << Get Journal ) );
jrn2 = Substitute( Collapse Whitespace( Char( obj2 << Get Journal ) ), "Subset of Data", "data_table" );
If( Host is( "Mac" ),
jrn1 = Substitute( jrn1, "Table(\!"data_table.jmp\!")", "" );
jrn2 = Substitute( jrn2, "Table(\!"data_table\!")", "" );
);
obj << close window;
obj2 << close window;
Code Explanation:
- Open data table;
- Select rows 500 to end.
- Hide and exclude selected rows.
- Invert row selection.
- Subset selected rows into new table.
- Clear original table's selection.
- Explore outliers on original table.
- Explore outliers on subset table.
- Get journal from original exploration.
- Get journal from subset exploration.
- Replace subset name in subset journal.
- If Mac, remove table reference from journals.
- Close original exploration window.
- Close subset exploration window.
Explore Outliers using Add Rows
Summary: Process of selecting and preparing variables for outlier analysis in a JMP data table, utilizing Robust PCA Outliers method to identify anomalies.
Code:
dt = Open("data_table.jmp");
dtShort = New Table( "data_table Short", Add Rows( N Row( dt ) ) );
For( i = 3, i <= 21, i++,
If( Max( dt[0, i] ) < 127 & Min( dt[0, i] ) > -126,
dtShort << New Column( Column( dt, i ) << Get Name, Numeric( 1 ), "Continuous", Set Values( dt[0, i] ) ),
dtShort << New Column( Column( dt, i ) << Get Name, Numeric( 4 ), "Continuous", Set Values( dt[0, i] ) )
)
);
dtShort << Delete Columns( 1 );
obj = dtShort << Explore Outliers( Y( 1 :: 19 ), Robust PCA Outliers( Center( 1 ), Scale( 1 ) ) );
obj << Save Residuals;
obj << Save Low Rank Approx;
Code Explanation:
- Open data table;
- Create new table Arrhythmia Short.
- Loop through columns 3 to 21.
- Check column max and min values.
- Add column to Arrhythmia Short if conditions met.
- Delete first column from Arrhythmia Short.
- Explore outliers on columns 1 to 19.
- Use Robust PCA Outliers method.
- Save residuals from outlier analysis.
- Save low rank approximation.
Explore Outliers using Summary
Summary: Creates a summary table and outlier exploration for a data table, grouping by age and sex, calculating means for height and weight, and identifying outliers using the quantile range method.
Code:
dt = Open("data_table.jmp");
dtSummary = dt << Summary(
Group( :age, :sex ),
Mean( :height ),
Mean( :weight ),
Freq( "None" ),
Weight( "None" ),
output table name( "Summary of data_table grouped by age, sex" )
);
obj = dtSummary << Explore Outliers( Y( :"Mean(height)"n, :"Mean(weight)"n ), Quantile Range Outliers( Tail Quantile( 0.2 ), Q( 1 ) ) );
Code Explanation:
- Open data table;
- Create summary table.
- Group by age, sex.
- Calculate mean height.
- Calculate mean weight.
- Name output table.
- Explore outliers in summary.
- Set Y variables: mean height, weight.
- Use quantile range method.
- Define tail quantile as 0.2.
Explore Outliers using N Col
Example 1
Summary: Explores and analyzes outliers in a data table, utilizing Robust PCA Outliers to identify anomalies and perform robust principal component analysis.
Code:
dt = Open("data_table.jmp");
p = N Col( dt );
obj = dt << Explore Outliers( Y( :QRS, :T, :P, :QRST, :J, :Heart rate ), Robust PCA Outliers( Lambda( 0.0940720868383597 ), Center( 0 ) ) );
x = dt[0, 10 :: 15];
Results = Robust PCA( X, Center( 0 ), Scale( 1 ), Lambda( 0.0940720868383597 ) );
Code Explanation:
- Open data table;
- Count columns in dataset.
- Explore outliers for specified variables.
- Set robust PCA parameters.
- Extract specific data range.
- Perform robust PCA analysis.
Example 2
Summary: Process of exploring outliers in a dataset using Robust PCA, extracting specific columns, and storing results.
Code:
dt = Open("data_table.jmp");
p = N Col( dt );
obj = dt << Explore Outliers( Y( :height, :weight ), Robust PCA Outliers( Lambda( 0.316227766016838 ), Scale( 0 ) ) );
x = dt[0, 4 :: 5];
Results = Robust PCA( X, Center( 1 ), Scale( 0 ), Lambda( 0.316227766016838 ) );
Code Explanation:
- Open data table;
- Count columns in dataset.
- Create outlier exploration object.
- Extract columns 4 and 5 from dataset.
- Perform robust PCA on selected columns.
- Center data before PCA.
- Do not scale data for PCA.
- Set lambda value for PCA.
- Store PCA results.
- End script execution.
Example 3
Summary: Process of identifying outliers in a dataset using Robust PCA Outliers and configuring the analysis with specific lambda, centering, and scaling methods.
Code:
dt = Open("data_table.jmp");
p = N Col( dt );
obj = dt << Explore Outliers( Y( 4 :: 8 ), Robust PCA Outliers( Lambda( 0.272165526975909 ), Center( 0 ), Scale( 0 ) ) );
x = dt[0, 4 :: 8];
Results = Robust PCA( X, Center( 0 ), Scale( 0 ), Lambda( 0.272165526975909 ) );
Code Explanation:
- Open data table;
- Count columns in dataset.
- Launch Explore Outliers platform.
- Specify Y variables.
- Configure Robust PCA Outliers.
- Extract data for analysis.
- Perform Robust PCA.
- Set centering method.
- Set scaling method.
- Apply lambda value.
Explore Outliers using Select Randomly
Example 1
Summary: Process of identifying outliers in a dataset, including random sampling and subset creation.
Code:
dt = Open("data_table.jmp");
dt << Clear Row States;
randRows = dt << Select Randomly( 0.5 ) << Get Selected Rows;
dt << Select Rows( randRows ) << Exclude( 1 );
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
dt << Invert Row Selection;
dt2 = dt << Subset( Selected Rows( 1 ), All Columns( 1 ) );
obj2 = dt2 << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
unexcludedRowsOrig = dt << Clear Select << Select Excluded << Invert Row Selection << Get Selected Rows;
dt << Clear Select;
obj << Quantile Range Outliers( Tail Quantile( 0.25 ), Q( 1.5 ) );
obj2 << Quantile Range Outliers( Tail Quantile( 0.25 ), Q( 1.5 ) );
Code Explanation:
- Open table.
- Clear row states.
- Select random rows.
- Exclude selected rows.
- Explore outliers in original data.
- Invert row selection.
- Subset selected rows.
- Explore outliers in subset data.
- Select unexcluded rows from original.
- Clear selection.
Example 2
Summary: Process of identifying and analyzing outliers in a data table, utilizing random sampling, exclusion, and robust fitting techniques.
Code:
dt = Open("data_table.jmp");
dt << Clear Row States;
randRows = dt << Select Randomly( 0.25 ) << Get Selected Rows;
dt << Select Rows( randRows ) << Exclude( 1 );
obj = dt << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
dt << Invert Row Selection;
dt2 = dt << Subset( Selected Rows( 1 ), All Columns( 1 ) );
obj2 = dt2 << Explore Outliers( Y( Column Group( "Sensor Measurements" ) ) );
unexcludedRowsOrig = dt << Clear Select << Select Excluded << Invert Row Selection << Get Selected Rows;
dt << Clear Select;
obj << Robust Fit Outliers( K Sigma( 3 ), Huber( 1 ), Cauchy( 1 ), Quartile( 1 ) );
obj2 << Robust Fit Outliers( K Sigma( 3 ), Huber( 1 ), Cauchy( 1 ), Quartile( 1 ) );
Code Explanation:
- Open data table;
- Clear all row states.
- Select 25% rows randomly.
- Exclude selected rows.
- Explore outliers for Sensor Measurements.
- Invert row selection.
- Subset selected rows.
- Explore outliers for subset.
- Select unexcluded original rows.
- Clear selection.
Explore Outliers using Random Reset
Summary: Explores outliers in a data table using Robust PCA and captures log output, then extracts a summary table and compares it to expected values.
Code:
dt = Open("data_table.jmp");
Random Reset( 123 );
Log Capture( obj = dt << Explore Outliers( Y( Column Group( "Responses" ) ), Robust PCA Outliers( Use Randomized SVD( 1 ) ) ) );
rpt = Report( obj );
summary = (rpt[Table Box( 1 )] << Get as matrix)[1 :: 4]`;
summaryOracle = [128 100 0.0000001354586550406 0.0262612865719445];
obj << close window;
Code Explanation:
- Open data table.
- Set random seed.
- Explore outliers using Robust PCA.
- Capture log output.
- Extract report object.
- Get summary table from report.
- Convert summary to matrix.
- Define expected summary values.
- Compare summary to expected.
- Close exploration window.