Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Bonus Calculation Method to Use Min-Max Scaling #516

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 1-Introduction/04-stats-and-probability/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@
"source": [
"## Correlation and Evil Baseball Corp\n",
"\n",
"Correlation allows us to find relations between data sequences. In our toy example, let's pretend there is an evil baseball corporation that pays its players according to their height - the taller the player is, the more money he/she gets. Suppose there is a base salary of $1000, and an additional bonus from $0 to $100, depending on height. We will take the real players from MLB, and compute their imaginary salaries:"
"Correlation allows us to find relations between data sequences. In our toy example, let's pretend there is an evil baseball corporation that pays its players according to their height - the taller the player is, the more money he/she gets. Suppose there is a base salary of $1000, and an additional bonus from $0 to $100, depending on height. We will take the real players from MLB, and compute their imaginary salaries(based on Min-Max scaling):"
]
},
{
Expand All @@ -848,7 +848,7 @@
],
"source": [
"heights = df['Height']\n",
"salaries = 1000+(heights-heights.min())/(heights.max()-heights.mean())*100\n",
"salaries = 1000+(heights-heights.min())/(heights.max()-heights.min())*100\n",
"print(list(zip(heights, salaries))[:10])"
]
},
Expand Down Expand Up @@ -935,7 +935,7 @@
}
],
"source": [
"salaries = 1000+np.sin((heights-heights.min())/(heights.max()-heights.mean()))*100\n",
"salaries = 1000+np.sin((heights-heights.min())/(heights.max()-heights.min()))*100\n",
"print(f\"Correlation = {np.corrcoef(heights, salaries)[0,1]}\")"
]
},
Expand All @@ -960,7 +960,7 @@
}
],
"source": [
"salaries = 1000+np.sin((heights-heights.min())/(heights.max()-heights.mean()))*100+np.random.random(size=len(heights))*20-10\n",
"salaries = 1000+np.sin((heights-heights.min())/(heights.max()-heights.min()))*100+np.random.random(size=len(heights))*20-10\n",
"print(f\"Correlation = {np.corrcoef(heights, salaries)[0,1]}\")"
]
},
Expand Down