Giter Site home page Giter Site logo

kaggle-house-price-regression's Introduction

kaggle-house-price-regression

This is a project about using Spark with Scala and IntelliJ IDE. I participated in the Kaggle Knowledge Competition called House Prices: Advanced Regression Techniques and used their datasets (put them inside a data/ folder). The goal of the competition is to predict the sales price for each house. The models are evaluated using Root-Mean-Squared-Error (RMSE), which means that the lower the value, the better -- the predictions are close to the actual house prices.

Versions

  • IntelliJ IDEA 2020.1.3
  • scala = 2.11.12
  • spark = 2.4.5

How to build (create the jar file)

This assumes that you are using IntelliJ IDE. This part is similar to using sbt assembly command if you are using the sbt plugin.

  1. File -> Project Structure -> Artifacts -> + -> JAR -> "From modules with dependencies...".

  2. Fill in the information and make sure to tick the box: "Include in project build". Same as shown in the picture below:

    Project structure

  3. Click OK. Then "Build Project". It will generate the jar file inside the out/artifacts/.

How to run using spark

Again, this assumes that you are using IntelliJ IDE. This part is similar to using spark-submit command if you have spark in your machine.

  1. Run -> Edit Configurations... -> + -> Application

  2. Name it "spark-submit", just for ease of understanding.

    • Main class: org.apache.spark.deploy.SparkSubmit
    • VM options: -Dspark.master=local[2]
    • Program arguments: --class <name_of_class> <location_of_jar_file> args, example:
    --class kaggle.houseprice.HPRegression /<location_path>/out/artifacts/kaggle_house_price_jar/kaggle_house_price.jar data/train.csv data/test.csv data/sample_submission.csv tmp/submission
    

    It looks like this:

    spark-submit

  3. Click OK. Run "spark-submit". It will generate the CSV file inside the tmp/submission/, which you can submit to Kaggle.

Kaggle submission

  • Check the RMSE of the sample_submission.csv sample_submission
  • Trial submission using Linear Regression with one feature. sample_submission
  • Linear Regression with more features: combination of numerics and categories. sample_submission
  • Linear Regression with more features: combination of numerics and categories + hyperparameter tuning via cross-validation. sample_submission

References:

kaggle-house-price-regression's People

Contributors

rdolor avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chandankadiri

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.