Skip to content

Commit

Permalink
algo
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoXX committed Oct 28, 2024
1 parent ec9d377 commit 338a5c1
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 6 deletions.
60 changes: 60 additions & 0 deletions docs/key-features/how-the-algo-works.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
sidebar_position: 11
description: "Learn how the daily.dev algorithm works, including content filtering, recommendation system strategies, and how it adapts to user engagement and post freshness."
---

# How the Algorithm works

## Summary
The daily.dev feed algorithm is designed to deliver the most relevant content to each user. This system is built to optimize relevance and engagement using recommendation techniques, including content-based filtering, collaborative filtering, and advanced methods for enhancing personalization.

## Objective
The primary goal of the algorithm is to provide users with content that matches their interests while continuously adapting based on user interactions and engagement patterns. The system balances relevance with diversity, ensuring that users are exposed to both familiar and new topics.

## Recommendation System Overview
The daily.dev recommendation system is built around an infinite scroll feed that surfaces content based on both traditional and modern recommendation strategies. The focus is on content-based and collaborative filtering, with deep learning methods noted for potential future enhancements.

### 1. Content-Based Filtering
- **Mechanism:** Recommends content similar to what the user has interacted with previously, such as articles they have read or upvoted.
- **Pros:**
- No need for data from other users, making it effective for niche or specialized content.
- Provides recommendations that align with the user's existing preferences.
- **Cons:**
- Relies on predefined features, which limits adaptability to new trends.
- Less effective at broadening the user’s horizons or introducing diverse content.

### 2. Collaborative Filtering
- **Mechanism:** Recommends content based on the preferences of users with similar interaction patterns, enabling discovery of new topics.
- **Pros:**
- Helps users explore content beyond their known interests, promoting discovery.
- Can function even with minimal user-specific contextual data.
- **Cons:**
- Struggles with the cold start problem, where there is insufficient data to recommend new content.
- Faces challenges in incorporating additional features like content freshness or publication sources.

## Addressing the Cold Start Problem
A critical challenge for recommendation systems is the **cold start problem**, where it becomes difficult to recommend content for new users or new posts due to a lack of interaction data.

- **User Cold Start:** For new users, the system quickly gathers initial interests based on interactions (e.g., article views, upvotes) to deliver increasingly relevant content.
- **Post Cold Start:** For new posts, initial exposure is limited to gather engagement metrics (e.g., clicks, upvotes). Over time, metadata and user engagement help the system assess the post’s value.

## User Lifecycle Phases
The algorithm evolves with the user’s lifecycle, refining content recommendations as more data is gathered over time.

1. **New User:** The system starts with general recommendations based on broad interests.
2. **Onboarding:** Initial user metadata, such as interests and experience, is collected to refine future recommendations.
3. **Learning Phase:** Early user interactions, such as upvotes and downvotes, help personalize the feed.
4. **Personalization:** The algorithm continuously adapts as more user-specific data is gathered, delivering a highly tailored feed experience.

## Post Lifecycle Phases
Posts also go through different stages within the recommendation system:

1. **Fresh Post:** New posts are given limited exposure to gather initial feedback.
2. **Engagement Assessment:** Posts are evaluated based on predefined metrics (e.g., upvotes, time spent reading).
3. **Engaged Post:** Posts that meet engagement thresholds remain in the feed longer, but are periodically reassessed.
4. **Drop Post:** Posts that fail to meet engagement criteria are gradually removed from the feed.

## Inventory Strategy
To maintain relevance and diversity in the feed, daily.dev continuously expands its content sources beyond just web-based materials. This approach ensures users receive a wide array of content, including both familiar and fresh perspectives.

The overall strategy of the daily.dev algorithm is to create a feed that is not only personalized but also dynamic, continuously evolving based on user behavior and the freshness of the content.
13 changes: 12 additions & 1 deletion docs/setting-up-your-feed/blocking-tags-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sidebar_position: 3
description: "Learn how to block tags and sources on daily.dev for a more personalized feed experience."
---

# Blocking Tags and Sources
# Blocking and Report

Customizing your daily.dev feed is simple. When there are specific tags or sources you don’t want to see, blocking them comes in handy.

Expand Down Expand Up @@ -80,3 +80,14 @@ A source can have the following states:
|-------------------|----------------------------|
| Following | ✅ Yes |
| Blocked | ❌ No |

### Reporting Posts

If you encounter a post that violates the [community guidelines](/docs/community-guidelines), you can report it. Click on the more options button (⋮) on the post card and select "Report" to notify the daily.dev team.

![Reporting post image](https://github.com/user-attachments/assets/5d544bf0-7e4d-466b-89f2-4f9e709eece1)

Once you click on "Report," you’ll be asked to confirm your action and select the reason for reporting the post. The daily.dev team will review the report and take appropriate action.


![Reporting reason image](https://github.com/user-attachments/assets/b274c1ca-e630-4eda-814f-cb730a60afd6)
Binary file added docs/setting-up-your-feed/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/components/homepage/homeNavBoxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const FeatureList = [
{url: "docs/key-features/pause-new-tab", text: "Pause New Tab (DND)"},
{url: "docs/key-features/the-companion", text: "Companion Widget"},
{url: "docs/key-features/community-picks", text: "Community Picks"},
{url: "docs/key-features/how-the-algo-works", text: "How the algorithm works"},
]
},
{
Expand Down Expand Up @@ -120,8 +121,6 @@ function Feature({title, icon, items }) {





export default function HomepageFeatures() {
return (
<section className={styles.features}>
Expand Down
10 changes: 7 additions & 3 deletions src/components/homepage/homeNavBoxes.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
.homecard {
background-color: #1c1f26;
width: 330px;
height: 420px;
height: 470px;
padding: 20px;
position: relative;
display: block;
Expand All @@ -83,7 +83,7 @@

.homecard:hover {
transform: translateY(-4px);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
box-shadow: 0 12px 30px rgba(192, 41, 240, 0.5); /* Purple shadow on hover */
}

html[data-theme='light'] .homecard {
Expand All @@ -97,15 +97,19 @@ html[data-theme='dark'] .homecard {
}

html[data-theme='dark'] .homecard:hover {
box-shadow: 0 12px 30px rgba(255, 255, 255, 0.2);
box-shadow: 0 12px 30px rgba(192, 41, 240, 0.5); /* Purple shadow on hover for dark theme */
}

.homecard h2 {
display: flex;
align-items: center; /* Vertically align the icon and text */
justify-content: left; /* Center the icon and text horizontally */
margin: 0 0 1rem;
font-size: 1.5rem;
line-height: 1.4;
font-weight: 700;
color: #222;
text-align: left; /* Ensure text itself is centered */
}

html[data-theme='dark'] .homecard h2 {
Expand Down
26 changes: 26 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,29 @@ height: 85% !important;
.DocSearch-MagnifierLabel,.DocSearch-Reset{
padding: 5px !important;
}


.hero__title {
font-family: 'Montserrat', sans-serif; /* Or your preferred font */
font-size: 62px; /* Maintain headline size */
font-weight: 700; /* Bold for emphasis */
line-height: 115%;
text-align: center; /* Center the text */
background: linear-gradient(90deg, #c029f0, #ff00d4a5); /* Gradient from purple to blue */
-webkit-background-clip: text; /* Clip gradient to text */
-webkit-text-fill-color: transparent; /* Make the text itself transparent */
text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
margin-top: 2rem;
transition: transform 0.3s ease, text-shadow 0.3s ease; /* Smooth transition */
}

.hero__title:hover {
text-shadow: 4px 4px 15px rgba(192, 41, 240, 0.8); /* Stronger shadow on hover */
/*transform: scale(1.05); /* Slight scale effect on hover */
}

@media screen and (max-width: 768px) {
.hero__title {
font-size: 48px; /* Adjust title size for smaller screens */
}
}
1 change: 1 addition & 0 deletions src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
align-items: center;
justify-content: center;
}

0 comments on commit 338a5c1

Please sign in to comment.