SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
○○でかんたん
お部屋探し!
Tokyo.R #49 LT
@soultoru
賃貸物件探しを
統計/MLで
やってみた
先行している
方々がいるよ
課題
部屋の床面積
賃料
妙に安い
回帰直線
(理論価格)
割安な物件
=ボロの可能性
安いのは嬉しい
けどボロは嫌
ボロ物件に
ありがちなもの
...
和式便所
和式便所を
Deep Learning
で分類すれば
いい!
Deep Learning
でかんたん
お部屋探し!
和式便所探し!
手順
1.
便所画像の収集
(手動)
ここでは、
和式便所
洋式便所
洗面台を集取
2.
画像サイズを
揃える
(ImageMagick)
# インストール
sudo apt-get install imagemagick
# 対象のディレクトリに移動
cd washiki
# すべて100x100に上書き変換
mogrify -geometry 100x100! *.jpg
cd ../youshiki
mogrify -geometry 100x100! *.jpg
cd ../senmen
mogrify -geometry 100x100! *.jpg
3.
画像を
グレースケール
に変換
library(raster)
as.grayscale.array <- function(file, flag){
# 画像サイズ変換はImageMagick等で行っておく
image <- brick( file )
# 画像をRGBの配列に変換
image.rgb <- getValues(image)
# グレースケールの配列に変換
image.bw <- image.rgb[,1]*0.21 +
image.rgb[,2]*0.72 + image.rgb[,3]*0.07
return( c(flag, image.bw) )
}
4.
和式便所に
フラグをつけて
h2oで学習
# データフレーム化
washiki <- list.files('~/apps/toilet/washiki',
full.names=T)
yoshiki <- list.files('~/apps/toilet/yoshiki', full.names=T)
senmen <- list.files('~/apps/toilet/senmen', full.names=T)
target <- rbind(t(sapply(washiki, as.grayscale.array, 1)),
t(sapply(yoshiki, as.grayscale.array, 0)),
t(sapply(senmen, as.grayscale.array, 0)) )
target <- data.frame(target)
target[,1] <- as.integer(target[,1])
rownames(target) <- c(washiki, yoshiki, senmen)
library('h2o')
# Deep learningで学習させる
localH2O <- h2o.init(ip = "localhost",
port = 54321,
startH2O = TRUE,
nthreads=-1)
res.dl <- h2o.deeplearning(
x = 2:10001,
y = 1,
training_frame = as.h2o(target),
activation = "TanhWithDropout",
hidden=rep(160,5),
epochs = 20)
pred.dl <- h2o.predict(object=res.dl,
newdata = as.h2o(target))
pred <- as.data.frame(pred.dl)
# 正解率を確認
print(1-sum(abs(round(pred[,1]) -
target[,1]))/length(target[,1]))
Rのソース
全体
library('h2o')
library(raster)
as.grayscale.array <- function(file, flag){
# 画像サイズ変換はImageMagick等で行っておく
image <- brick( file )
# 画像をRGBの配列に変換
image.rgb <- getValues(image)
# グレースケールの配列に変換
image.bw <- image.rgb[,1]*0.21 + image.rgb[,2]*0.72 + image.rgb[,3]*0.07
return( c(flag, image.bw) )
}
# データフレーム化
washiki <- list.files('~/apps/toilet/washiki', full.names=T)
yoshiki <- list.files('~/apps/toilet/yoshiki', full.names=T)
senmen <- list.files('~/apps/toilet/senmen', full.names=T)
target <- rbind(t(sapply(washiki, as.grayscale.array, 1)),
t(sapply(yoshiki, as.grayscale.array, 0)),
t(sapply(senmen, as.grayscale.array, 0)) )
target <- data.frame(target)
target[,1] <- as.integer(target[,1])
rownames(target) <- c(washiki, yoshiki, senmen)
# Deep learningで学習させる
localH2O <- h2o.init(ip = "localhost", port = 54321, startH2O = TRUE, nthreads=-1)
res.dl <- h2o.deeplearning(x = 2:10001, y = 1, training_frame = as.h2o(target), activation = "TanhWithDropout",
hidden=rep(160,5), epochs = 20)
pred.dl <- h2o.predict(object=res.dl, newdata = as.h2o(target))
pred <- as.data.frame(pred.dl)
# 正解率を確認
print(1-sum(abs(round(pred[,1]) - target[,1]))/length(target[,1]))
実行結果
精度 0.86
意外といい
だが
洗面台を
和式便所と分類
してしまう...
Enjoy!

Más contenido relacionado

Último

Último (11)

論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 

Destacado

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

○○でかんたんお部屋探し!