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

Done #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Done #21

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
  •  
  •  
  •  
Binary file added .DS_Store
Binary file not shown.
252 changes: 250 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,250 @@
challenge-week-11
=================
# Name

Logan Bates

# How many points have you earned?

95/100

(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?

4

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

Tuesday

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

Challenge 4 mongo

# Graph Database I

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

### 1. (5 point)

![screenshot](checkpoint1graphs.png)

### 2. (5 point)

![screenshot](checkpoint2graphs.png)

### 3. (5 point)

![screenshot](checkpoint3graphs.png)

# MongoDB IV

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

### 1. (5 point)

Count

![screenshot](challenge1-1mongo.png)

FindOne

![screenshot](challenge1-2mongo.png)


Query (db.reviews.find({'stars':5}, {'text':1}))
Find all text for 5 star reviews

![screenshot](challenge1-3mongo.png)


### 2. (5 point)

Count

![screenshot](challenge2-1mongo.png)

FindOne

![screenshot](challenge2-2mongo.png)

Query

### 3. (5 point)

Count

![screenshot](challenge3-1mongo.png)

FindOne

![screenshot](challenge3-2mongo.png)


Query

![screenshot](challenge3-3mongo.png)


### 4. (5 point)

Count

![screenshot](screenshot.png)

FindOne

![screenshot](screenshot.png)

Query 1

![screenshot](screenshot.png)

Query 2

![screenshot](screenshot.png)


# Machine Learning III

## Checkpoints (5 points x 2 = 10 points)

### 1. (5 point)

![screenshot](checkpoint1machine.png)

### 2. (5 point)

![screenshot](checkpoint2machine.png)

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

### 1. (5 point)

Accuracy = 74.7348

Features/Parameters

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

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

### 2. (5 point)

Accuracy = 67.1167

Features/Parameters

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

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

### 3. (5 point)

Accuracy = 71.3597

Features/Parameters

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

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

### 4. (5 point)

Accuracy = 75.8920

Features/Parameters

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

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


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

### 1. (5 point)

![screenshot](checkpoint1d3.png)

### 2. (5 point)

![screenshot](checkpoint2d3.png)

### 3. (5 point)

![screenshot](checkpoint3d3.png)

### 4. (5 point)

![screenshot](checkpoint4d3.png)

### 5. (5 point)

![screenshot](checkpoint5d3.png)

### 6. (5 point)

![screenshot](checkpoint6d3.png)

### 7. (5 point)

![screenshot](checkpoint7d3.png)
25 changes: 25 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Run 'npm install' to install node dependencies
var express = require('express');
var app = express();

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

app.engine('.html', require('ejs').__express);
app.set('views', __dirname);
app.set('view engine', 'html');

app.get('/state/:state', function(req, res) {
var query = {"state" : req.params.state};
var projection = {};
db.collection('business')
.find(query,projection)
.limit(100)
.sort({'review_count':-1})
.toArray(function (err, items) {
res.render("business_map", {data: items});
});
});

app.listen(3000);
console.log('listening on port 3000');
Loading