Skip to content

Commit

Permalink
week 1 solutions + leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
rishi-m100 committed Sep 23, 2024
1 parent 373766b commit d35a3d9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 22 deletions.
36 changes: 15 additions & 21 deletions leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,23 @@

<div class="container">
<h1>Leaderboard</h1>
<div id="podium" class="podium">
<!-- Podium will be populated by JavaScript -->
</div>
<div id="leaderboard" class="leaderboard">
<!-- Leaderboard will be populated by JavaScript -->
</div>
<div id="podium" class="podium"></div>
<div id="leaderboard" class="leaderboard"></div>
</div>

<script>
// Sample JSON data (you can replace this with your own data)
const leaderboardData = [
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "", score: 0 },
{ name: "Kaavya Mahajan", score: 98 },
{ name: "Aaren Kang", score: 96 },
{ name: "Anish Bellamkonda", score: 93 },
{ name: "Yongrong Lu", score: 91 },
{ name: "Seung Wook", score: 90 },
{ name: "Jayden Li", score: 80 },
{ name: "Aaditya Ghimire", score: 72 },
{ name: "Albert Bogdan", score: 71 },
{ name: "Abhiram Batchali", score: 70 },
{ name: "Huan Lin", score: 70 },
{ name: "Prahit Yaugand", score: 70 },
];

function createPodiumItem(rank, name, score, medal, height) {
Expand Down Expand Up @@ -174,10 +172,8 @@ <h1>Leaderboard</h1>
const podium = document.getElementById("podium");
const leaderboard = document.getElementById("leaderboard");

// Sort the leaderboard data by score in descending order
leaderboardData.sort((a, b) => b.score - a.score);

// Create podium
const medals = ["🥇", "🥈", "🥉"];
let podiumHTML = "";
const maxScore = Math.max(
Expand All @@ -186,8 +182,8 @@ <h1>Leaderboard</h1>
const minScore = Math.min(
...leaderboardData.slice(0, 3).map((item) => item.score)
);
const maxHeight = 200; // Maximum height for the tallest bar
const minHeight = 100; // Minimum height for the shortest bar
const maxHeight = 300;
const minHeight = 200;

for (let i = 0; i < 3 && i < leaderboardData.length; i++) {
const rank = ["1st", "2nd", "3rd"][i];
Expand All @@ -207,7 +203,6 @@ <h1>Leaderboard</h1>
}
podium.innerHTML = podiumHTML;

// Create leaderboard
let leaderboardHTML = "";
for (let i = 3; i < leaderboardData.length; i++) {
leaderboardHTML += createLeaderboardItem(
Expand All @@ -219,7 +214,6 @@ <h1>Leaderboard</h1>
leaderboard.innerHTML = leaderboardHTML;
}

// Call the function when the page loads
window.onload = updateLeaderboard;
</script>
</body>
Expand Down
29 changes: 28 additions & 1 deletion solutions.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,34 @@ <h1>Solutions</h1>
week: 1,
title: "House Price Prediction Solution",
content: `
<p>Solutions for Week 1 will be uploaded here after the submission deadline.</p>
<h1>Week 1 Solutions</h1>
<h2>Summary</h2>
<h4>Baseline Models:</h4>
<ul>
<li>Linear Regression yielded an R² score of 0.71, which is a reasonable baseline, but not highly accurate for predicting house prices.</li>
<li>Decision Tree Classifier performed very poorly with a score of 0.0096, indicating it's unsuitable for this regression task.</li>
<li>Random Forest Regressor achieved a significantly better score of 0.84, making it the best among the baseline models.</li>
</ul>
<h4>Highest-Performing Solutions:</h4>
<ul>
<li>Gradient Boosting Regressor after tuning hyperparameters (max_depth=5, n_estimators=200) scored 0.90, showing that ensemble methods with boosting can yield very strong results.</li>
<li>Random Forest Regressor (with 500 estimators) performed similarly, with a score of 0.89, demonstrating that increasing the number of trees from 100 to 500 provided a marginal improvement.</li>
</ul>
<h4>Takeaways:</h4>
<ul>
<li>Feature Scaling and hyperparameter tuning were essential for achieving high accuracy.</li>
<li>Ensemble methods like Random Forest and Gradient Boosting Regressor consistently outperformed linear models.</li>
<li>Grid search allowed further refinement of hyperparameters, slightly improving the model's performance.</li>
</ul>
<a target="_blank" href="https://colab.research.google.com/drive/1u9JW5vECvlZ6huyvz7xrhJj2HmDrlmb_?authuser=5#scrollTo=nsSyl5JME8nn">Link to Notebook</a>
<br>
<a target="_blank" href="https://docs.google.com/presentation/d/1qy1OWxAyliL4PSqrljxphXdFPLurtd8j52xF4pKdMwA/edit?usp=sharing">Link to Slides</a>
`,
},
// Add more solution weeks here as needed
Expand Down

0 comments on commit d35a3d9

Please sign in to comment.