Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished - Alexia Newgord #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
182 changes: 92 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
# Name

write-your-name
Alexia Newgord

# How many points have you earned?

0/100
100/100, but a day late

(Make your own calculation and replace the number 0 with the points you think you've earned.)

# How many hours have you spent on this?

fill-in-your-answer
8ish

# When did you first start working on this week's learning challenges?

fill-in-your-answer
Wednesday

# What is the most difficult part about this week's challenge?

fill-in-your-answer
I accidently imported the wrong dataset at one point, which took four hours. Had problems converting csv into json and importing in one go due to mongo size restrictions, so instead I directly imported each row by converting it to json and passing it in one by one.

# Graph Database I

## Checkpoints (5 points x 3 = 15 points)

### 1. (5 point)

![screenshot](screenshot.png)
to start: cd to the extracted folder, start with bin/neo4j start

![screenshot](gcp1.png)

### 2. (5 point)

![screenshot](screenshot.png)
![screenshot](gcp2.png)

### 3. (5 point)

![screenshot](screenshot.png)
![screenshot](gcp3.png)

# MongoDB IV

Expand All @@ -44,66 +46,66 @@ fill-in-your-answer

Count

![screenshot](screenshot.png)
![screenshot](mc1a.png)

FindOne

![screenshot](screenshot.png)
![screenshot](mc1b.png)


Query

![screenshot](screenshot.png)
![screenshot](mc1c.png)


### 2. (5 point)

Count

![screenshot](screenshot.png)
![screenshot](mc2a.png)

FindOne

![screenshot](screenshot.png)
![screenshot](mc2b.png)


Query

![screenshot](screenshot.png)
![screenshot](mc2c.png)

### 3. (5 point)

Count

![screenshot](screenshot.png)
![screenshot](mc3a.png)

FindOne

![screenshot](screenshot.png)
![screenshot](mc3b.png)


Query

![screenshot](screenshot.png)
![screenshot](mc3c.png)


### 4. (5 point)

Count

![screenshot](screenshot.png)
![screenshot](mc4a.png)

FindOne

![screenshot](screenshot.png)
![screenshot](mc4b.png)

Query 1

![screenshot](screenshot.png)
![screenshot](mc4c.png)

Query 2

![screenshot](screenshot.png)
![screenshot](mc4d.png)


# Machine Learning III
Expand All @@ -112,141 +114,141 @@ Query 2

### 1. (5 point)

![screenshot](screenshot.png)
![screenshot](mlcp1.png)

### 2. (5 point)

![screenshot](screenshot.png)
![screenshot](mlcp2.png)

## Challenges (5 points x 4 = 20 points)

### 1. (5 point)

Accuracy = {fill-in-your-best-number}
Accuracy = 82.7387

Features/Parameters

%%%%%%%%% Choose feature source %%%%%%%%%%%
add_accelerometer = {TODO}; % Adds accelerometer features
add_gyroscope = {TODO}; % Adds gyroscope features
add_magneticField = {TODO}; % Adds magnetic field features
add_gravity = {TODO}; % Adds gravity features
add_linearAcceleration = {TODO}; % Adds linear acceleration features
add_orientation = {TODO}; % Adds azimuth, pich and roll features
add_light = {TODO}; % Adds light value
add_proximity = {TODO}; % Adds proximity value
add_studentID = {TODO}; % Adds student ID
add_accelerometer = true; % Adds accelerometer features
add_gyroscope = true; % Adds gyroscope features
add_magneticField = true; % Adds magnetic field features
add_gravity = true; % Adds gravity features
add_linearAcceleration = true; % Adds linear acceleration features
add_orientation = true; % Adds azimuth, pich and roll features
add_light = true; % Adds light value
add_proximity = true; % Adds proximity value
add_studentID = true; % Adds student ID
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%% Choose machine learning classifier parameters %%%%%%%%%%%%%%%
numTrees = {TODO}; % Try different number of trees for the Random Forest classifier
sigma = {TODO}; % Try different values of sigma for the Support Vector Machine classifier
dist = {TODO}; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = {TODO}; % Try different values of K for the K-nearest Neighbor classifier
numTrees = 1; % Try different number of trees for the Random Forest classifier
sigma = 1; % Try different values of sigma for the Support Vector Machine classifier
dist = 'normal'; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = 1; % Try different values of K for the K-nearest Neighbor classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

### 2. (5 point)

Accuracy = {fill-in-your-best-number}
Accuracy = 71.5526

Features/Parameters

%%%%%%%%% Choose feature source %%%%%%%%%%%
add_accelerometer = {TODO}; % Adds accelerometer features
add_gyroscope = {TODO}; % Adds gyroscope features
add_magneticField = {TODO}; % Adds magnetic field features
add_gravity = {TODO}; % Adds gravity features
add_linearAcceleration = {TODO}; % Adds linear acceleration features
add_orientation = {TODO}; % Adds azimuth, pich and roll features
add_light = {TODO}; % Adds light value
add_proximity = {TODO}; % Adds proximity value
add_studentID = {TODO}; % Adds student ID
add_accelerometer = true; % Adds accelerometer features
add_gyroscope = true; % Adds gyroscope features
add_magneticField = true; % Adds magnetic field features
add_gravity = true; % Adds gravity features
add_linearAcceleration = true; % Adds linear acceleration features
add_orientation = true; % Adds azimuth, pich and roll features
add_light = true; % Adds light value
add_proximity = true; % Adds proximity value
add_studentID = true; % Adds student ID
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%% Choose machine learning classifier parameters %%%%%%%%%%%%%%%
numTrees = {TODO}; % Try different number of trees for the Random Forest classifier
sigma = {TODO}; % Try different values of sigma for the Support Vector Machine classifier
dist = {TODO}; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = {TODO}; % Try different values of K for the K-nearest Neighbor classifier
numTrees = 1; % Try different number of trees for the Random Forest classifier
sigma = 1; % Try different values of sigma for the Support Vector Machine classifier
dist = 'kernel'; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = 1; % Try different values of K for the K-nearest Neighbor classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

### 3. (5 point)

Accuracy = {fill-in-your-best-number}
Accuracy = 65.5738

Features/Parameters

%%%%%%%%% Choose feature source %%%%%%%%%%%
add_accelerometer = {TODO}; % Adds accelerometer features
add_gyroscope = {TODO}; % Adds gyroscope features
add_magneticField = {TODO}; % Adds magnetic field features
add_gravity = {TODO}; % Adds gravity features
add_linearAcceleration = {TODO}; % Adds linear acceleration features
add_orientation = {TODO}; % Adds azimuth, pich and roll features
add_light = {TODO}; % Adds light value
add_proximity = {TODO}; % Adds proximity value
add_studentID = {TODO}; % Adds student ID
add_accelerometer = true; % Adds accelerometer features
add_gyroscope = false; % Adds gyroscope features
add_magneticField = true; % Adds magnetic field features
add_gravity = true; % Adds gravity features
add_linearAcceleration = true; % Adds linear acceleration features
add_orientation = true; % Adds azimuth, pich and roll features
add_light = false; % Adds light value
add_proximity = true; % Adds proximity value
add_studentID = true; % Adds student ID
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%% Choose machine learning classifier parameters %%%%%%%%%%%%%%%
numTrees = {TODO}; % Try different number of trees for the Random Forest classifier
sigma = {TODO}; % Try different values of sigma for the Support Vector Machine classifier
dist = {TODO}; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = {TODO}; % Try different values of K for the K-nearest Neighbor classifier
numTrees = 1; % Try different number of trees for the Random Forest classifier
sigma = 150; % Try different values of sigma for the Support Vector Machine classifier
dist = 'kernel'; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = 1; % Try different values of K for the K-nearest Neighbor classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

### 4. (5 point)

Accuracy = {fill-in-your-best-number}
Accuracy = 87.1745

Features/Parameters

%%%%%%%%% Choose feature source %%%%%%%%%%%
add_accelerometer = {TODO}; % Adds accelerometer features
add_gyroscope = {TODO}; % Adds gyroscope features
add_magneticField = {TODO}; % Adds magnetic field features
add_gravity = {TODO}; % Adds gravity features
add_linearAcceleration = {TODO}; % Adds linear acceleration features
add_orientation = {TODO}; % Adds azimuth, pich and roll features
add_light = {TODO}; % Adds light value
add_proximity = {TODO}; % Adds proximity value
add_studentID = {TODO}; % Adds student ID
add_accelerometer = true; % Adds accelerometer features
add_gyroscope = true; % Adds gyroscope features
add_magneticField = true; % Adds magnetic field features
add_gravity = true; % Adds gravity features
add_linearAcceleration = true; % Adds linear acceleration features
add_orientation = true; % Adds azimuth, pich and roll features
add_light = true; % Adds light value
add_proximity = true; % Adds proximity value
add_studentID = true; % Adds student ID
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%% Choose machine learning classifier parameters %%%%%%%%%%%%%%%
numTrees = {TODO}; % Try different number of trees for the Random Forest classifier
sigma = {TODO}; % Try different values of sigma for the Support Vector Machine classifier
dist = {TODO}; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = {TODO}; % Try different values of K for the K-nearest Neighbor classifier
numTrees = 50; % Try different number of trees for the Random Forest classifier
sigma = 150; % Try different values of sigma for the Support Vector Machine classifier
dist = 'kernel'; % Try different distributions = {'normal', 'kernel', 'mvmn' , 'mn'} for Naive Bayes classifier
K = 1; % Try different values of K for the K-nearest Neighbor classifier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


# D3 (VI) (5 points x 7 = 35 points)

### 1. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp1.png)

### 2. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp2.png)

### 3. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp3.png)

### 4. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp4.png)

### 5. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp5.png)

### 6. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp6.png)

### 7. (5 point)

![screenshot](screenshot.png)
![screenshot](dcp7.png)
7 changes: 4 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var express = require('express');
var app = express();

var mongo = require('mongoskin');
var db = mongo.db("mongodb://{USERNAME}:{PASSWORD}@{SEVERURL}", {native_parser:true});
var db = mongo.db("mongodb://localhost/yelp/:3000", {native_parser:true});

app.engine('.html', require('ejs').__express);
app.set('views', __dirname);
Expand All @@ -12,9 +12,10 @@ app.set('view engine', 'html');
app.get('/state/:state', function(req, res) {
var query = {"state" : req.params.state};
var projection = {};
db.collection('business')
db.collection('businesses2')
.find(query,projection)
.limit(20)
.limit(100)
.sort({"review_count" : -1 })
.toArray(function (err, items) {
res.render("business_map", {data: items});
});
Expand Down
Loading