Giter Site home page Giter Site logo

ds-glassdoor's Introduction

Data Scientist in Canada: Project Overview

  • Created a tool that estimates data science salaries (asymmetric MAE ~ $ 8K) to help data scientists negotiate their income when they get a job, and built a client facing API using Flask
  • Scraped over 500 job postings in Canada from glassdoor using python and selenium
  • Engineered features from the text of each job description to quantify the value companies put on python, excel, aws, and spark.
  • Optimized Linear, Lasso, Ridge, and Random Forest Regressors using GridsearchCV to reach the best model.
  • ON-GOING: data scientist job description generator

Development

This project is managed using Poetry. To install Poetry, please refer to the documentation.

# install dependencies
poetry install

# activate the environment
poetry shell

Web Scraping

data/data.py scraped 500 job postings from glassdoor.com using data/glassdoor_scraper.py and saved results to data/glassdoor_jobs.csv. With each job, we got the following:

  • Job title
  • Salary Estimate
  • Job Description
  • Ratings
  • Company
  • Location
  • Company Size
  • Company Founded Year
  • Type of Ownership
  • Industry
  • Sector
  • Revenue
  • ...

Data Preprocessing

After scraping the data, data/data_preprocess.py preprocess the raw data with data/parse_info.py and save to data/data_processed.csv.

Explorary Data Analysis (EDA)

data/data_analysis.ipynb conducted EDA. Below are a few highlights.

alt text alt text alt text

Data Scientist Salary Estimation

model.ipynb built and evaluated several machine learning models to predict the average salary for data scientist jobs.

Percentages are first converted to float values. Mean imputation is implemented to handle the missing values for these features, as there are not too many of them.

Four different models are evaluated with a customized asymmetric loss function: Linear Regression, Lasso Regression, Ridge Regression, and Random Forest. The objective of the customized loss function is to impose a higher penalty when the prediction falls below the ground truth value. This approach aims to potentially dissuade users from making further requests.

Model performance

The Random Forest model far outperformed the other approaches on the test and validation sets.

  • Random Forest : asymmetric MAE = 7.95
  • Lasso Regression: asymmetric MAE = 10.08
  • Ridge Regression: asymmetric MAE = 10.25

Productionization

FlaskAPI contains a flask API endpoint that was hosted on a local webserver. The API endpoint takes in a request with a csv file of features (FlaskAPI/test_input.csv) and a model (FlaskAPI/models) and returns an estimated salary.

To run locally:

cd FlaskAPI

# start the APP
gunicorn --bind 0.0.0.0:8080 wsgi:application -w 1

# go to a new terminal in ./FlaskAPI
# predict with python
python request.py 
# predict with curl
curl -X GET http://0.0.0.0:8080/predict -H "Content-Type: application/json" -d '{"input":"test_input.csv", "mdl": "models/rf_mae_f1_est30.pkl"}'

Acknowledgement

ds-glassdoor's People

Contributors

yinanazhou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.