Slide 1

Slide 1 text

Actionable Machine Learning in the Browser with PyScript [email protected] @leriomaggio

Slide 2

Slide 2 text

also me • Background in CS • PhD in Machine Learning for SE • Research: ML/DL for BioMedicine • Data Scientists Advocate • SSI Fellow • Python Geek 
 • Casual M:TG Player me pun Who? 🧙 “a short summary of myself in logos” @mtg_lotus_vale

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

What is Python in HTML the Browser

Slide 5

Slide 5 text

You might be thinking…

Slide 6

Slide 6 text

What is Is PyScript ~similar (i.e. comparable to): • Q: PHP ? • (or any other similar technology injecting server-side code into HTML) • A: No • it’s a client-side technology • Everything happens in the browser • Doesn’t necessarily require a remote server to run • Although it could run everywhere with no speci fi c con fi guration • Deploy is as simple as “deploying” an HTML fi le I’ll start by telling you what it is not 🙃

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Java Server Nightmares

Slide 9

Slide 9 text

• Template Language: is a new language only designed for presentation! Requires an engine to fi ll in the data. • PyScript: Client-side Technology, No server needed, no installation is required • FWIW: presentation + program logic mixture in PyScript is the same as with Javascript!

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

The sign still applies, btw 🙃

Slide 13

Slide 13 text

What is PyScript is not like Javascript • it’s a completely di ff erent technology! • But PyScript can interact with Javascript (Interoperability) • Python Javascript I’ll start by telling you what it is not 🙃

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

PyScript Architecture • (By default) 
 PyScript builds on top of Pyodide • pyodide: 
 CPython interpreter compiled with Emscripten 
 to WebAssembly (WASM) MicroPython Tech Preview: https://pyscript.net/tech-preview/micropython/about.html

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

https://pyodide.org/en/0.22.1/usage/packages-in-pyodide.html

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

https://pyscript.net/examples/repl2.html

Slide 25

Slide 25 text

Before diving into the demos…

Slide 26

Slide 26 text

Source: https://je ff .glass/post/whats-new-pyscript-2023-03-1/

Slide 27

Slide 27 text

🤞 Demo Time 🤞

Slide 28

Slide 28 text

View Code on PyScript.com https://leriomaggio.github.io/pyscript-dataviz/examples/starwars_pyscript.html

Slide 29

Slide 29 text

View Examples on PyScript.com • 🍷 data distribution | view on PyScript.com • Interactive feature exploration with Bokeh | view on PyScript.com • Interactive Clustering with feature scaling | view on PyScript.com • Wine 🍷 XGBoost classi fi er | view on PyScript.com

Slide 30

Slide 30 text

Thank you very much 
 for your kind attention Valerio Maggio [email protected] @leriomaggio