GithubHelp home page GithubHelp logo

bigdata-hw2's Introduction

bigdata-hw2

To get instructions on how to run these files, run them without any parameters and the script will help you know how to run the particular file.

Part 1:

To run: - Use the scrub_vector.py script on any vector file to produce the correctly formatted output file. - Run spark-submit with the correct parameters. For example:

$ spark-submit part1.py matrices/a_100x200.txt 100x200 matrices/b_200x100.txt 200x100

For the part1 matrix and vector multiplication, we went with the one pass approach to solving the problem. When we read the file we decided to group i, j, and value together in the following format (i, j, value), i and j as integers and value as floats.

Then for each value of the matrices we created copies and mapped them to their correct position in the resulting matrix. After, we took the corresponding values, and joined them together so that we could apply the dot product to each value of the resulting matrix.

Part 2:

To run: - Run spark-submit with the correct parameters. For example:

$ spark-submit part2.py graphs/Assign2_100.txt 100x100

To find out if a graph is a shallow graph we needed to compute A^2 + A (A representing a matrix). Since we already had the matrix multiplication sorted out from part1, we re-used that code to compute A*A. Then we added the result to the original matrix. However, to determine if a graph is shallow we need to check our results to make sure the graph doesn't contain any 0s. So to do that we used a filter to see if we found any 0s in there. If there were, we said that the graph was not shallow, otherwise shallow.

bigdata-hw2's People

Contributors

unaveed avatar jesuszarate avatar

Watchers

James Cloos avatar Greg Anderson avatar  avatar  avatar  avatar

bigdata-hw2's Issues

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.