Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python Application Case
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Vicky Vernando Dasta
January 27, 2018
Programming
0
65
Python Application Case
Python Workshop @ Kongkow IT 2018
Vicky Vernando Dasta
January 27, 2018
Tweet
Share
More Decks by Vicky Vernando Dasta
See All by Vicky Vernando Dasta
PYTHON 101
vickydasta
0
120
Other Decks in Programming
See All in Programming
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Grafana:建立系統全知視角的捷徑
blueswen
0
330
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
140
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
Package Management Learnings from Homebrew
mikemcquaid
0
200
CSC307 Lecture 09
javiergs
PRO
1
830
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
630
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
170
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
1
2.7k
Building an army of robots
kneath
306
46k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
36k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
50
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
Google's AI Overviews - The New Search
badams
0
900
Designing for Performance
lara
610
70k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Transcript
PYTHON WORKSHOP HAFIZHAN: WEB APPLICATION WITH PYTHON FLASK VICKY: PYTHON
101 AND APPLICATION IN SECURITY & MACHINE LEARNING
Workshop repo github.com/vickydasta/kongkow-python
About • Student @ physics dept. UR • Research assistant
at photonic lab @ UR • Research interest: photonic, applied machine learning on raspberry pi system • Python user 2014-now
Python at a glance • Multipurpose • OOP (everything is
object) • Dynamic typing • Batteries included • Case sensitive
None
Things we can build computer vision search engine security tools
embedded system web services web application machine learning apps
Your First Python Code print “hello, world!” print(“hello, world!”)
Data Structure • Integer • Float • List • String
• Boolean • Dictionary • Tupple
Data Structure: list • Create an empty list • Add
an item into it • Access item • Remove some item fr = [] fr.append(“guava”) fr[0] fr.remove(“guava”)
Data Structure: tupple • Immutable array • Data are read-only
• Items in tupple can’t be deleted • Can’t add more data once it’s created fixed_data = (1, 2) fixed_data[0] # 1 fixed_data[0] = 1
Data Structure: dict • Named-list • Key-value user = {“name”
“vicky”, “age”: 21} user[“name”] user.keys() user.values() user = {name=“vicky”, age=21}
Control Flow In Python, there are: • if • elif
• else • for • while • continue • break
Control Flow: if if 1 > 0: print “1 larger
than 0”
Control Flow: if-else if 1 > 2: print “hola” else:
print “holi”
Control Flow: if-elif-else if 1 > 2: print “hola” elif
1 > 3: print “holu” else: print “holi”
Loop: for • for loop is for iterating over iterable
object • range function creates list which is iterable • in above case, the i is 0, 1, 2, ..., 99 on each iteration for i in range(100): print(i)
Looping: while • while Requires a condition in order to
start or terminate the loop (while-break) while True: print “hello!” N = 0 while N < 10: N += 1
Function: def • def is the keyword for creating function
def gravity_force(M, m, r): return 6.62e+12*(M*m)/r**2 Function keyword Returned value(s) arguments function name
Coding style in Python • Python uses indentation • 3
spaces or 1 tab for each scope • No brackets or semicolons!
Python Application Case: Machine Learning Security
Machine Learning: Security: Predict land price by its size Port
scanner
Sec: Port scanner • Door knocking analogy • Bruteforce
ML: Linear Regression • Linear model out = mx+b •
Scikit learn search for the m • so the predicted value can be close to y
ML: Datasets X (M2) Y ($ USD) 200 2000 250
3500 300 5000 378 5400 456 6500 680 8700 800 10000
ML: model training datasets model f(x)
ML: prediction new input predicted output Trained Model
ML: scikit-learn • Machine learning is difficult problem • Fortunately,
we have scikit-learn
Python resources • github.com/vinta/awesome-python