Giter Site home page Giter Site logo

spark-assignment's Introduction

Spark Assignment

Fork this project, complete the assigned objectives.

This repo scaffolds a basic Apache Spark project for your convenience. Please feel free to edit it as you see fit Or not use it at all, if you prefer to use a different Spark version or language such as SparkR or pyspark

Complete the assignment on a POSIX like system such as Mac OS or a Linux distribution Hadoop based technologies generally do not function smoothly on Windows machines

If you are not familiar with Apache Spark you may submit the assignment using the framework/language of your choice (such as Python Pandas or R dplyr)

Assumptions

  • No dividends adjustments are necessary, using only the closing price to determine returns
  • If a price is missing on a given date, you can compute returns from the closest available date
  • Return can be trivially computed as the % difference of two prices

Assignment Objectives

The file stock_prices.csv (included in the repository) contains the daily closing price of a few stocks on the NYSE/NASDAQ Look at src/main/scala/com/example/spark/assignment/Main.scala to get started

  • Load up stock_prices.csv as a DataFrame, Dataset or RDD
  • Compute the average daily return of every stock for every date. Print the results to screen

In other words, your output should have the columns:

date average_return
yyyy-MM-dd return of all stocks on that date
  • Which stock was traded most frequently - as measured by closing price * volume - on average?

Bonus Question

  • Which stock was the most volatile as measured by annualized standard deviation of daily returns?

Evaluation

  • Correctness is most important
  • Elegance and style is the next most important
  • Performance is the last criteria, but can be detrimental to you if your implementation is unreasonably costly

Some helpful hints

You may or may not need these hints depending on the approach you take

spark-assignment's People

Contributors

erfangchen avatar

Watchers

James Cloos 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.