Quick demo of IntegratedML based on Titanic data
More info on IntegratedML: https://community.intersystems.com/post/intersystems-iris-advanced-analytics-and-iris-health-advanced-analytics-preview-published
Commands from this demo:
a) Run docker container
docker run --name irisml --init --detach --publish 52773:52773 --volume /tmp:/tmp/parent store/intersystems/iris-aa-community:2020.3.0AA.331.0
b) Run terminal session
docker exec -it irisml irissession iris
c) Check that data is in the file
! head -n 10 /tmp/parent/titanic/train.csv
d) Specify header for data in csv
set header="ROW(PassengerId %Integer, Survived %Boolean, Pclass %Integer, Name VARCHAR(100), Sex VARCHAR(6), Age %Integer, SibSp %Integer, Parch %Integer, Ticket VARCHAR(20), Fare %Currency, Cabin VARCHAR(20), Embarked VARCHAR(2))"
e) Specify filename to load train data from
set filename = "/tmp/parent/titanic/train.csv"
f) Specify table name to load train data to
set tableName = "test.TitanicTrain"
g) Load test data
do ##class(%SQL.Util.Procedures).CSVTOCLASS(,header,filename,,,1,tableName)
h) Run SQL Shell
do $system.SQL.Shell()
i) Check that data was loaded correctly
select top 10 * from test.titanicTrain
j) Create and train model
CREATE MODEL TitanicSurvival Predicting (Survived) From Test.titanicTrain
TRAIN MODEL TitanicSurvival
k) Leave SQL Shell
quit
l) Load test data. Header is the same, but without Survived column
set header="ROW(PassengerId %Integer, Pclass %Integer, Name VARCHAR(100), Sex VARCHAR(6), Age %Integer, SibSp %Integer, Parch %Integer, Ticket VARCHAR(20), Fare %Currency, Cabin VARCHAR(20), Embarked VARCHAR(2))"
m) Specify filename to load test data from
set filename = "/tmp/parent/titanic/test.csv"
n) Specify table name to load test data to
set tableName = "test.titanicTest"
o) Load test data
do ##class(%SQL.Util.Procedures).CSVTOCLASS(,header,filename,,,1,tableName)
p) Open SQL Shell
do $system.SQL.Shell()
q) Check that test data was loaded correctly
select top 10 * from test.titanicTest
r) Predict value for Survived for test data
select PassengerId, Predict(TitanicSurvival) Survived from test.titanicTest
s) Specify output folder to export results to CSV
set displaypath=/tmp/parent/titanic
t) Specify filename
set displayfile=results.txt
u) Specify encoding
set displaytranslatetable=UTF8
v) Specify format. CSV in our case
set displaymode=csv
w) Repeat last SQL command, now with results forwarded to the file
go
x) Leave the SQL Shell
quit
y) Check the results
! head -n 10 /tmp/parent/titanic/results.txt.csv
z) Replace TAB with comma in results file
! sed 's/\t/,/g' /tmp/parent/titanic/results.txt.csv > /tmp/parent/titanic/results.csv
zz) View final results
! head -n 10 /tmp/parent/titanic/results.csv
Share this recording
Link
Append ?t=30
to start the playback at 30s, ?t=3:20
to start the playback at 3m 20s.
Embed image link
Use snippets below to display a screenshot linking to this recording.
Useful in places where scripts are not allowed (e.g. in a project's README file).
HTML:
Markdown:
Embed the player
If you're embedding on your own page or on a site which permits script tags, you can use the full player widget:
Paste the above script tag where you want the player to be displayed on your page.
See embedding docs for additional options.
Download this recording
You can download this recording in asciicast v2 format, as a .cast file.
DownloadReplay in terminal
You can replay the downloaded recording in your terminal using the
asciinema play
command:
asciinema play 334969.cast
If you don't have asciinema CLI installed then see installation instructions.
Use with stand-alone player on your website
Download asciinema player from
the releases page
(you only need .js
and .css
file), then use it like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
</head>
<body>
<div id="player"></div>
<script src="asciinema-player.min.js"></script>
<script>
AsciinemaPlayer.create(
'/assets/334969.cast',
document.getElementById('player'),
{ cols: 172, rows: 32 }
);
</script>
</body>
</html>
See asciinema player quick-start guide for full usage instructions.
Generate GIF from this recording
While this site doesn't provide GIF conversion at the moment, you can still do it yourself with the help of asciinema GIF generator utility - agg.
Once you have it installed, generate a GIF with the following command:
agg https://asciinema.org/a/334969 demo.gif
Or, if you already downloaded the recording file:
agg demo.cast demo.gif
Check agg --help
for all available options. You can change font
family and size, select color theme, adjust speed and more.
See agg manual for full usage instructions.