Skip to content

Machine learning#37

Open
ryosuke071111 wants to merge 11 commits intodevelopmentfrom
machine_learning
Open

Machine learning#37
ryosuke071111 wants to merge 11 commits intodevelopmentfrom
machine_learning

Conversation

@ryosuke071111
Copy link
Collaborator

what

レコメンデーション機能実装

why

ユーザーの嗜好性に合わせてリスティングを変えるため

参考

homes/1 と homes/3 で推奨される物件が変わる。(推奨度も変わる)

https://gyazo.com/51a94c54d376685a7da02dd0367083af

https://gyazo.com/6c6eb499d5eefda5958a9367fe18ed9a

注意点(下記条件の場合railsでエラーが起きる)

・python APIサーバーを立ち上げていない場合
・学習データに該当する物件の名前でない場合

※あとで相談させてください

@photos = @home.listing_photos
@cancel = @home.cancel_policy
@space = AvailableSpace.find_by(home_id: params[:id])
@beds = BedType.where(home_id: params[:id])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このへんの検索ロジックはモデルにスコープ作って@home.~~で取り出せるといいかも!

end

#homeIDを抽出
def extract_recommend_ids(learning_result)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このへんもモデルに移した方がいいかも、、?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当初モデルに記述していたのですがノーメソッドエラーとなりコントローラに移しました。良い方法があれば後で教えていただけると嬉しいです。。!

#{home.home_category_sub.name}
%span(推奨度: #{similarity})
%p.listing-title.bold #{home.name}
%p.listing-price ¥8,761 /泊・キャンセル無料
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここってhome.price.default_price(?)とかでとれますか?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

取れたので入れました!ただここも三万件入れないとかも。。

@@ -0,0 +1,9 @@
.similar-category__item.left.slick-sub
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderで変数渡してるけど使っていない、、?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants