Neprox commited on
Commit
8f4d7ac
1 Parent(s): c33542b

Circumvent Hopsworks read port bug

Browse files
Files changed (1) hide show
  1. app.py +14 -10
app.py CHANGED
@@ -13,13 +13,14 @@ def load_data():
13
  project = hopsworks.login()
14
  fs = project.get_feature_store()
15
 
16
- posts_fg = fs.get_feature_group("reddit_posts", version=os.getenv("POSTS_FG_VERSION", default=1))
17
- users_fg = fs.get_feature_group("reddit_users", version=os.getenv("USERS_FG_VERSION", default=1))
18
- subreddits_fg = fs.get_feature_group("reddit_subreddits", version=os.getenv("SUBREDDITS_FG_VERSION", default=1))
19
- full_join = posts_fg.select(features=["post_id", "snapshot_time", "num_likes", "upvote_ratio"]).join(
20
- users_fg.select(features=["user_id", "snapshot_time"]), on=["user_id", "snapshot_time"]).join(
21
- subreddits_fg.select(features=["subreddit_id", "snapshot_time"]), on=["subreddit_id", "snapshot_time"])
22
- df = full_join.read()
 
23
 
24
  # Load model including the generated images and evaluation scores
25
  mr = project.get_model_registry()
@@ -56,9 +57,12 @@ st.markdown("This is the dashboard for the Like It Or Not model that predict the
56
  # Data stats
57
  st.markdown("## Data Statistics")
58
  col1, col2, col3 = st.columns(3)
59
- col1.metric("Unqiue Posts", str(df["post_id"].nunique()))
60
- col2.metric("Unique Users", str(df["user_id"].nunique()))
61
- col3.metric("Unique Subreddits", str(df["subreddit_id"].nunique()))
 
 
 
62
 
63
  # Distribution of the target variables
64
  col1, col2 = st.columns(2)
 
13
  project = hopsworks.login()
14
  fs = project.get_feature_store()
15
 
16
+ #posts_fg = fs.get_feature_group("reddit_posts", version=os.getenv("POSTS_FG_VERSION", default=1))
17
+ #users_fg = fs.get_feature_group("reddit_users", version=os.getenv("USERS_FG_VERSION", default=1))
18
+ #subreddits_fg = fs.get_feature_group("reddit_subreddits", version=os.getenv("SUBREDDITS_FG_VERSION", default=1))
19
+ #full_join = posts_fg.select(features=["post_id", "snapshot_time", "num_likes", "upvote_ratio"]).join(
20
+ # users_fg.select(features=["user_id", "snapshot_time"]), on=["user_id", "snapshot_time"]).join(
21
+ # subreddits_fg.select(features=["subreddit_id", "snapshot_time"]), on=["subreddit_id", "snapshot_time"])
22
+ #df = full_join.read()
23
+ df = None
24
 
25
  # Load model including the generated images and evaluation scores
26
  mr = project.get_model_registry()
 
57
  # Data stats
58
  st.markdown("## Data Statistics")
59
  col1, col2, col3 = st.columns(3)
60
+ col1.metric("Unqiue Posts", str(29579)))
61
+ col2.metric("Unique Users", str(21751)))
62
+ col3.metric("Unique Subreddits", str(25))
63
+ #col1.metric("Unqiue Posts", str(df["post_id"].nunique()))
64
+ #col2.metric("Unique Users", str(df["user_id"].nunique()))
65
+ #col3.metric("Unique Subreddits", str(df["subreddit_id"].nunique()))
66
 
67
  # Distribution of the target variables
68
  col1, col2 = st.columns(2)