Turi Create  4.0
user_item_graph.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef TURI_RECSYS_USER_ITEM_GRAPH_H_
7 #define TURI_RECSYS_USER_ITEM_GRAPH_H_
8 
9 #include <toolkits/ml_data_2/ml_data.hpp>
10 #include <core/storage/sframe_data/sframe.hpp>
11 #include <core/storage/sgraph_data/sgraph_compute.hpp>
12 #include <memory>
13 #include <vector>
14 
15 namespace turi { namespace recsys {
16 
17 /**
18  * Build a user-item bipartite graph.
19  * user_item_lists are added to user nodes as vertex_data
20  *
21  */
22 void make_user_item_graph(const v2::ml_data& data,
23  const std::shared_ptr<sarray<flex_dict> >& user_item_lists,
24  sgraph& g);
25 }}
26 #endif /* _USER_ITEM_GRAPH_H_ */