From c758005037ec2e1cbb96cb37c98302cf6360042d Mon Sep 17 00:00:00 2001 From: mankala sharathchandra <152910893+sharath4444@users.noreply.github.com> Date: Sat, 15 Jun 2024 10:48:39 +0530 Subject: [PATCH 1/4] salary_predict --- .../ml-app-predict_salary-main/README.md | 3 + .../SalaryPrediction.ipynb | 1393 +++++++++++++++++ .../ml-app-predict_salary-main/app.py | 11 + .../explore_page.py | 91 ++ .../predict_page.py | 59 + 5 files changed, 1557 insertions(+) create mode 100644 ml-app-predict_salary-main/ml-app-predict_salary-main/README.md create mode 100644 ml-app-predict_salary-main/ml-app-predict_salary-main/SalaryPrediction.ipynb create mode 100644 ml-app-predict_salary-main/ml-app-predict_salary-main/app.py create mode 100644 ml-app-predict_salary-main/ml-app-predict_salary-main/explore_page.py create mode 100644 ml-app-predict_salary-main/ml-app-predict_salary-main/predict_page.py diff --git a/ml-app-predict_salary-main/ml-app-predict_salary-main/README.md b/ml-app-predict_salary-main/ml-app-predict_salary-main/README.md new file mode 100644 index 000000000..c6c7ee272 --- /dev/null +++ b/ml-app-predict_salary-main/ml-app-predict_salary-main/README.md @@ -0,0 +1,3 @@ +# Build A Salary Prediction Web App With Streamlit + +Build a Machine Learning web application from scratch in Python with Streamlit. We use real world data to build a machine learning model. In the first part of the video you learn how we analyze the data and build our model, and in the second part we build the web app using streamlit. diff --git a/ml-app-predict_salary-main/ml-app-predict_salary-main/SalaryPrediction.ipynb b/ml-app-predict_salary-main/ml-app-predict_salary-main/SalaryPrediction.ipynb new file mode 100644 index 000000000..6f766b73b --- /dev/null +++ b/ml-app-predict_salary-main/ml-app-predict_salary-main/SalaryPrediction.ipynb @@ -0,0 +1,1393 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 55, + "id": "8b11fd46", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import matplotlib.pyplot as plt\n", + "\n", + "df = pd.read_csv(\"survey_results_public.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "0a94c801", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | Respondent | \n", + "MainBranch | \n", + "Hobbyist | \n", + "Age | \n", + "Age1stCode | \n", + "CompFreq | \n", + "CompTotal | \n", + "ConvertedComp | \n", + "Country | \n", + "CurrencyDesc | \n", + "... | \n", + "SurveyEase | \n", + "SurveyLength | \n", + "Trans | \n", + "UndergradMajor | \n", + "WebframeDesireNextYear | \n", + "WebframeWorkedWith | \n", + "WelcomeChange | \n", + "WorkWeekHrs | \n", + "YearsCode | \n", + "YearsCodePro | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "1 | \n", + "I am a developer by profession | \n", + "Yes | \n", + "NaN | \n", + "13 | \n", + "Monthly | \n", + "NaN | \n", + "NaN | \n", + "Germany | \n", + "European Euro | \n", + "... | \n", + "Neither easy nor difficult | \n", + "Appropriate in length | \n", + "No | \n", + "Computer science, computer engineering, or sof... | \n", + "ASP.NET Core | \n", + "ASP.NET;ASP.NET Core | \n", + "Just as welcome now as I felt last year | \n", + "50.0 | \n", + "36 | \n", + "27 | \n", + "
| 1 | \n", + "2 | \n", + "I am a developer by profession | \n", + "No | \n", + "NaN | \n", + "19 | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "United Kingdom | \n", + "Pound sterling | \n", + "... | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "Computer science, computer engineering, or sof... | \n", + "NaN | \n", + "NaN | \n", + "Somewhat more welcome now than last year | \n", + "NaN | \n", + "7 | \n", + "4 | \n", + "
| 2 | \n", + "3 | \n", + "I code primarily as a hobby | \n", + "Yes | \n", + "NaN | \n", + "15 | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "Russian Federation | \n", + "NaN | \n", + "... | \n", + "Neither easy nor difficult | \n", + "Appropriate in length | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "Somewhat more welcome now than last year | \n", + "NaN | \n", + "4 | \n", + "NaN | \n", + "
| 3 | \n", + "4 | \n", + "I am a developer by profession | \n", + "Yes | \n", + "25.0 | \n", + "18 | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "Albania | \n", + "Albanian lek | \n", + "... | \n", + "NaN | \n", + "NaN | \n", + "No | \n", + "Computer science, computer engineering, or sof... | \n", + "NaN | \n", + "NaN | \n", + "Somewhat less welcome now than last year | \n", + "40.0 | \n", + "7 | \n", + "4 | \n", + "
| 4 | \n", + "5 | \n", + "I used to be a developer by profession, but no... | \n", + "Yes | \n", + "31.0 | \n", + "16 | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "United States | \n", + "NaN | \n", + "... | \n", + "Easy | \n", + "Too short | \n", + "No | \n", + "Computer science, computer engineering, or sof... | \n", + "Django;Ruby on Rails | \n", + "Ruby on Rails | \n", + "Just as welcome now as I felt last year | \n", + "NaN | \n", + "15 | \n", + "8 | \n", + "
5 rows × 61 columns
\n", + "| \n", + " | Country | \n", + "EdLevel | \n", + "YearsCodePro | \n", + "Employment | \n", + "Salary | \n", + "
|---|---|---|---|---|---|
| 0 | \n", + "Germany | \n", + "Master’s degree (M.A., M.S., M.Eng., MBA, etc.) | \n", + "27 | \n", + "Independent contractor, freelancer, or self-em... | \n", + "NaN | \n", + "
| 1 | \n", + "United Kingdom | \n", + "Bachelor’s degree (B.A., B.S., B.Eng., etc.) | \n", + "4 | \n", + "Employed full-time | \n", + "NaN | \n", + "
| 2 | \n", + "Russian Federation | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "NaN | \n", + "
| 3 | \n", + "Albania | \n", + "Master’s degree (M.A., M.S., M.Eng., MBA, etc.) | \n", + "4 | \n", + "NaN | \n", + "NaN | \n", + "
| 4 | \n", + "United States | \n", + "Bachelor’s degree (B.A., B.S., B.Eng., etc.) | \n", + "8 | \n", + "Employed full-time | \n", + "NaN | \n", + "
| \n", + " | Country | \n", + "EdLevel | \n", + "YearsCodePro | \n", + "Employment | \n", + "Salary | \n", + "
|---|---|---|---|---|---|
| 7 | \n", + "United States | \n", + "Bachelor’s degree (B.A., B.S., B.Eng., etc.) | \n", + "13 | \n", + "Employed full-time | \n", + "116000.0 | \n", + "
| 9 | \n", + "United Kingdom | \n", + "Master’s degree (M.A., M.S., M.Eng., MBA, etc.) | \n", + "4 | \n", + "Employed full-time | \n", + "32315.0 | \n", + "
| 10 | \n", + "United Kingdom | \n", + "Bachelor’s degree (B.A., B.S., B.Eng., etc.) | \n", + "2 | \n", + "Employed full-time | \n", + "40070.0 | \n", + "
| 11 | \n", + "Spain | \n", + "Some college/university study without earning ... | \n", + "7 | \n", + "Employed full-time | \n", + "14268.0 | \n", + "
| 12 | \n", + "Netherlands | \n", + "Secondary school (e.g. American high school, G... | \n", + "20 | \n", + "Employed full-time | \n", + "38916.0 | \n", + "
| \n", + " | Country | \n", + "EdLevel | \n", + "YearsCodePro | \n", + "
|---|---|---|---|
| 7 | \n", + "13 | \n", + "0 | \n", + "13.0 | \n", + "
| 9 | \n", + "12 | \n", + "2 | \n", + "4.0 | \n", + "
| 10 | \n", + "12 | \n", + "0 | \n", + "2.0 | \n", + "
| 11 | \n", + "10 | \n", + "1 | \n", + "7.0 | \n", + "
| 12 | \n", + "7 | \n", + "1 | \n", + "20.0 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 64113 | \n", + "13 | \n", + "1 | \n", + "15.0 | \n", + "
| 64116 | \n", + "13 | \n", + "0 | \n", + "6.0 | \n", + "
| 64122 | \n", + "13 | \n", + "1 | \n", + "4.0 | \n", + "
| 64127 | \n", + "13 | \n", + "3 | \n", + "12.0 | \n", + "
| 64129 | \n", + "13 | \n", + "2 | \n", + "4.0 | \n", + "
18491 rows × 3 columns
\n", + "3et
z(r6KtT#uQq2$S7EY=tM9jqoZRpFHSX(2(vaugCp_?!asA}j@hbA22VHE4vf2?1&Z!w9?X+;wl$O>_*}
z>~xe9y6`BCAHHD`Khpdd?0-r6kO;&t!{`f3Q6Yt&E7eO0#arQJy5cf7@;=&y7h%fV
zEgd~9Ywtb+K}+H?s6F@IID_j)YbmRv=7kdU%49*y*%B9Zvq|uT^i`drV!urxQVO48
z-$j`L+`e-?J>fO2>V&mN^>@FU6oF~E!^g#;YJ14XE}We>gFcco#YwxmI(jnx_VkP|
zrxAJL91b1duYL1(;puv_IEJK!{^h^gz2KxOIW~WI_tfu~2MDvTwU21lsc7~pQouZ#
zsQ(+k0m2r6SC^k33OF27yzGl}=gcq2yBsaqLx)TD;5i*#`?e#JbxPl-)4Sp{y0`bg
ztG^EQ3aEPW%g4ESyu3P<|19$gc3rM2wNI@6zR^9{(sEDD;;?3p+Ux&(?S%I5HmsR>
zJf6%voI+F9Zi;DbUOsc}7+m4!lbFMzew+20+3eptxj9=gD
0D-uJLKuKc(L+E`$S!Ye%
xJA^IG!RR!hYIyR!dx{L2njNhw-JB8YJ
zaDd<(!