Git Product home page Git Product logo

project-4's Introduction

Project 4


Table of Contents

  1. Problem Statement
  2. Data Dictionary
  3. Preprocessing & Modeling
  4. Conclusion and Recommendations
  5. Datasets

Problem Statement

Using data from UC Irvine Machine Learning build a model that can predict if a person's income is in excess of $50,000 given certain profile information


Data Dictionary

Feature Type Dataset Description
age int64 large_train_sample person's age
education-num int64 large_train_sample years of education
capital-gain int64 large_train_sample capital gained
capital-loss int64 large_train_sample capital lost
hours-per-week int64 large_train_sample average hours worked per week
native-country int64 large_train_sample 1: from United States, 0: other, engineered feature
wage int64 large_train_sample 1: made over 50k, 0: made under 50k, engineered feature
relationship_Other-relative int64 large_train_sample engineered feature
relationship_Own-child int64 large_train_sample engineered feature
relationship_Unmarried int64 large_train_sample engineered feature
relationship_Wife int64 large_train_sample engineered feature
workclass_Local-gov int64 large_train_sample engineered feature
workclass_Private int64 large_train_sample engineered feature
workclass_Self-emp-inc int64 large_train_sample engineered feature
workclass_Self-emp-not-inc int64 large_train_sample engineered feature
workclass_State-gov int64 large_train_sample engineered feature
workclass_ Without-pay int64 large_train_sample engineered feature

Preprocessing and Modeling

Data cleaning included dropping the following features: final weight, education, marital status, and occupation. Null values or non numerical values were dropped. The wage and native country columns were binarized and the sex, relationship and workclass columns were dummied.

The models used were a Random Forest Classifier, XGBoost Classifier, and XGBoost-Dart Classifer. First, a baseline score was established then I used GridSearchCV to identify the best scores and parameters generated from the models. The models consisted of 18 features.

Model R2 Traing Score R2 Testing Score Cross Val Score
Random Forest 0.846 0.837 0.842
XGBoost Classifer 0.860 0.853 0.856
XGBoost-Dart Classifer 0.872 0.853 0.854

Conclusion and Recommendations

In summary, the 3 models used performed better in predicting wage under 50k that it was predicting over 50k. Precision scores across the 3 models were fairly similar, but the best score came from the Random Forest Classifier with 0.80. The model with the highest accuracy score was XGBoost Classifier with .8529


Datasets

project-4's People

Contributors

anthonyzurke avatar jbeightol avatar

Stargazers

 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.