Skip to content

oliviawilson13/Hiring_Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Job Hiring Predictor

Overview

This project predicts whether an applicant will be hired for a job based on their experience, education and skill level.

Features

  • Synthetic dataset stored in a PostgreSQL database, managed with SQLAlchemy ORM.
  • Logistic Regression model trained to predict hiring outcomes.
  • RESTful API build with FastAPI; ongoing improvements to enhance RESTful compliance.
  • Frontend development in progress.

Installation Instructions (for MacOS)

Step 1: Clone the repo

Step 2: Install and start PostgreSQL

    brew install postgresql

    brew services start postgresql

Step 3: Create a virtual environment (in project folder) and install dependencies in it

    python -m venv venv

    source venv/bin/activate

    pip install -r requirements.txt

Step 4: Connect to PostgreSQL

    psql -d postgres

OR

    psql -U your_computer_username -d postgres

Step 5: Create database and user in PostgreSQL

    CREATE DATABASE mydatabase;

    CREATE USER myuser WITH PASSWORD 'mypassword';

    GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser;

Step 6: Connect to mydatabase using myuser and create applicants table

    psql -U myuser -d mydatabase
    CREATE TABLE applicants (
        id SERIAL PRIMARY KEY,
        years_experience INT,
        education_level VARCHAR(50),
        has_relevant_skills BOOLEAN,
        hired BOOLEAN
    )

Step 7: Create an .env file containing database credentials (to connect to DB in database.py)

    DB_USER=myuser
    DB_PASSWORD=mypassword
    DB_HOST=localhost
    DB_PORT=5432
    DB_NAME=mydatabase

Usage

To generate data: num_iters is a postive number, defaults to 100 when nothing is provided

    python data/generate_data.py generate num_iters

To delete data:

    python data/generate_data.py delete

To train model:

    python logistic_regression/train_model.py

To run API:

    uvicorn api.main_api:app --reload

Important Notes

To update requirements.txt:

    pip install some_package # manually installed

    pip freeze > requirements.txt # update file

To disconnect psql:

    \q

Do not remove content from .gitignore!!!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages