Initial Release
IRIS for Windows (x86-64) 2024.1.3 (Build 456U) Thu Jan 9 2025 12:47:03 EST
Install Python:
Install InterSystems IRIS:
Configure Python in IRIS:
Set ^%SYS("Python","Path") = "/path/to/python3"
Install Python Packages:
pip
to install any required Python packages:
python3 -m pip install --target /path/to/iris/mgr/python
Enable Embedded Python:
Set ^%SYS("Python","Enabled") = 1
Write and Execute Embedded Python Code:
ClassMethod RunPython() As %Status
{
&python
print("Hello from Python!")
&endpython
Quit $$$OK
}
Run Your Code:
Do ##class(YourNamespace.YourClass).RunPython()
irispip.exe
:irispip install --target C:\InterSystems\iris\mgr\python pandas
irispip install --target C:\InterSystems\iris\mgr\python numpy==1.21
irispip install --target C:\InterSystems\iris\mgr\python pyod
Move IRIS Class Files: Transfer the following class files to the appropriate namespace:
Compile the Class Files: Ensure the files are compiled and ready for execution.
Do ##class(SQLClass.PaxUtil).DataSetup()
This method generates 1 million testing records spanning a total duration of 4 years and 4 months, starting from January 1, 2021, at 00:00:00 and continuing until March 31, 2025, at 23:59:59.
Sample Execution Output: Upon running the command, the system will execute the data setup process for the following logs:
USER>Do ##class(SQLClass.PaxUtil).DataSetup() Data setup - Containers History of 6 Ports from different locations (Logistics): Data Clean up : Done Loaded DataSet 1 : 500000 - Records Populated Loaded DataSet 2 : 500000 - Records Populated Outlier Data Injected for WeekNo 13 - 2025
Data setup - Transactions history of 6 ATMs from different locations (Banking): Data Clean up : Done Loaded DataSet 1 : 500000 - Records Populated Loaded DataSet 2 : 500000 - Records Populated Outlier Data Injected for WeekNo 13 - 2025
This application is designed to identify anomaly activities in the following domains:
Command Execution:
Navigate to the namespace where the data population was performed.
Execute the following command:
Do ##class(SQLClass.PaxTransHistory).anomalyDetection("2025-03-25")
Input Parameter:
"2025-03-25"
specifies the week for anomaly detection.Ensure the namespace matches the one used during test data setup.
Output and Variability:
%POPULATE
class introduces randomness during the data generation phase.Sample Execution Output:
USER>Do ##class(SQLClass.PaxTransHistory).anomalyDetection("2025-03-25")
ANOMALIES IDENTIFIED IN WEEKLY RUN ON WK#13 (2025) --------------------------------------------------- Withdrawal at New Mangalore Port - Western Coast(Karnataka)(ATM-Code:NMP787780) Amount : 20556730 This year's avg : 14348216 Previous 4 week's Avg : 13683931 Previous Week : 13315884 Previous Year's Same week : 13130318 Withdrawal at Visakhapatnam Port - Eastern Coast(Andhra Pradesh)(ATM-Code:VPP868080) Amount : 19955652 This year's avg : 14369368 Previous 4 week's Avg : 14553030 Previous Week : 13348459 Previous Year's Same week : 14003942 Transfer at Ennore Port - Eastern Coast(Tamil Nadu)(ATM-Code:ENP697880) Amount : 21084254 This year's avg : 14023015 Previous 4 week's Avg : 13283452 Previous Week : 12864380 Previous Year's Same week : 13429192
Command Execution:
Do ##class(SQLClass.PaxContainersHistory).anomalyDetection("2025-03-25")
"2025-03-25"
specifies the date for anomaly detection.Output and Variability:
Sample Execution Output:
USER>Do ##class(SQLClass.PaxContainersHistory).anomalyDetection("2025-03-25")
ANOMALIES IDENTIFIED IN WEEKLY RUN ON WEEK#13 (2025) ---------------------------------------------------------- Container Gate-Out at Chennai Port - Eastern Coast(Tamil Nadu)(CHP) Units : 3036621 This year's avg : 1969605 Previous 4 week's Avg : 1946684 Previous Week : 1897887 Previous Year's Same week : 1836667 Container Gate-Out at Cochin Port -Western Coast(Kerala)(CNP) Units : 3209278 This year's avg : 1926549 Previous 4 week's Avg : 1892441 Previous Week : 1936414 Previous Year's Same week : 1744798 Container Gate-Out at Ennore Port - Eastern Coast(Tamil Nadu)(ENP) Units : 3037720 This year's avg : 1923845 Previous 4 week's Avg : 1901025 Previous Week : 1992539 Previous Year's Same week : 1854914 Container Gate-Out at New Mangalore Port - Western Coast(Karnataka)(NMP) Units : 3139142 This year's avg : 1961736 Previous 4 week's Avg : 1907479 Previous Week : 1975264 Previous Year's Same week : 1853297 Container Gate-Out at Tuticorin Port - Eastern Coast(Tamil Nadu)(TTP) Units : 3328492 This year's avg : 1951659 Previous 4 week's Avg : 1835133 Previous Week : 1883748 Previous Year's Same week : 1902192 Container Gate-Out at Visakhapatnam Port - Eastern Coast(Andhra Pradesh)(VPP) Units : 3446854 This year's avg : 1989926 Previous 4 week's Avg : 1884473 Previous Week : 1827341 Previous Year's Same week : 1840329 Container Gate-In at Chennai Port - Eastern Coast(Tamil Nadu)(CHP) Units : 3131779 This year's avg : 2007539 Previous 4 week's Avg : 1933595 Previous Week : 1964282 Previous Year's Same week : 2107174 Container Gate-In at Ennore Port - Eastern Coast(Tamil Nadu)(ENP) Units : 3148797 This year's avg : 1999663 Previous 4 week's Avg : 1867842 Previous Week : 1886003 Previous Year's Same week : 2023913 Container Gate-In at New Mangalore Port - Western Coast(Karnataka)(NMP) Units : 3363762 This year's avg : 1941400 Previous 4 week's Avg : 1862354 Previous Week : 2004584 Previous Year's Same week : 1991292 Container Gate-In at Tuticorin Port - Eastern Coast(Tamil Nadu)(TTP) Units : 2960126 This year's avg : 1947936 Previous 4 week's Avg : 1918125 Previous Week : 1950421 Previous Year's Same week : 2003365 Container Gate-In at Visakhapatnam Port - Eastern Coast(Andhra Pradesh)(VPP) Units : 3221396 This year's avg : 1961220 Previous 4 week's Avg : 1915614 Previous Week : 1852360 Previous Year's Same week : 1685215
%POPULATE
class.