Compare commits

..

3 Commits

Author SHA1 Message Date
0a0281ab4e Updated title for graphs. 2025-04-24 01:45:08 -07:00
0f248e6b9a Wrote README. 2025-04-24 01:43:05 -07:00
7d82e4c588 Print only 2 significant figures of regression results. 2025-04-23 18:42:37 -07:00
3 changed files with 9 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -157,7 +157,7 @@
"\n",
" sb.scatterplot(data=self.devs, x=key_x, y=key_y, hue=hue, palette=palette)\n",
" plt.legend(loc='lower center', bbox_to_anchor=(1.5,0)) \n",
" title = \"Annual Salary of %s Developers Over Years of Experience\" % self.language\\\n",
" title = \"Annual Compensation of %s Programmers Over Years of Experience\" % self.language\\\n",
" + \"\\nsample size=%i\" % len (self.devs)\\\n",
" + \"\\ncountry=%s\" % self.country\n",
" plt.title(title)\n",
@@ -178,19 +178,20 @@
"\n",
" model.fit(X_train, y_train)\n",
" y_pred = model.predict(X_test)\n",
"\n",
" \n",
" m = model.coef_[0][0]\n",
" b = model.intercept_[0]\n",
" print(\"+----------------------+\")\n",
" print(\"%s regression line for %s\" % (line_color, self.language))\n",
" print(\"coefficient =\", model.coef_)\n",
" print('intercept=', model.intercept_)\n",
" print(\"coefficient = %0.2f\" % m)\n",
" print('intercept = %0.2f' % b)\n",
" rmse = root_mean_squared_error(y_test, y_pred)\n",
" print(\"rmse = \", rmse)\n",
" print(\"rmse = %0.2f\" % rmse)\n",
" r2 = r2_score(y_test, y_pred)\n",
" print(\"r2 score = \", r2)\n",
" print(\"r2 score = %0.2f\" % r2)\n",
" print(\"sample predictions:\")\n",
" print(y_pred[3:6])\n",
" print(\"+----------------------+\")\n",
" b = model.intercept_[0]\n",
"\n",
" plt.figure(self.canvas)\n",
" plt.plot(X_test, y_pred, color=line_color, label='Regression Line')\n",
@@ -247,7 +248,7 @@
"\n",
"* The income of a data professional can either increase by 2,000 per year (red) or 10,000 per year (cyan).\n",
"\n",
"* For both models, the r2 score ranges from poor to moderate = 0.20 - 0.37 depending on the random number. The variability not explained by the model could be the result of the fields such as advertising, finance, or bio/medical technology.\n",
"* For both models, the r2 score ranges from poor to moderate = 0.20 - 0.37 depending on the random number. The variability not explained by the model could be the result of different fields that employ dats scientists/analysts/engineers such as finance, bio/med, or advertising.\n",
"\n",
"* For any given point in the career, the model is off by 39,000 or 42,000 dollars.\n",
"\n",