This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { StyleSheet, View, Image } from 'react-native'; | |
| import { | |
| PanGestureHandler, | |
| State, | |
| PinchGestureHandler, | |
| TapGestureHandler, | |
| } from 'react-native-gesture-handler'; | |
| import Animated, { Easing } from 'react-native-reanimated'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { StyleSheet, View, Image, } from 'react-native'; | |
| import { | |
| PanGestureHandler, | |
| State, | |
| PinchGestureHandler, | |
| TapGestureHandler, | |
| } from 'react-native-gesture-handler'; | |
| import Animated, { Easing } from 'react-native-reanimated'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shinyServer(function(input, output, session) { | |
| # Session level | |
| idx <- round(runif(1, 1, 2500)) # random place to start | |
| state <- reactive({ | |
| if(input$submit > 0) { # Not on first page load | |
| isolate({ # Don't get reactive on me now | |
| answer <- input$yesorno |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(shiny) | |
| shinyUI(fluidPage( | |
| # Application title | |
| titlePanel("Verify Auto-tagged dresses from Instagram"), | |
| # Sidebar with a slider input for number of bins | |
| sidebarLayout( | |
| sidebarPanel( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mongolite) | |
| # Connections to mongo | |
| instagram <- mongo(collection = "InstagramV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE) | |
| matches <- mongo(collection = "MatchesV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE) | |
| corrections <- mongo(collection = "CorrectionsV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE) | |
| # Get Instagram data we saved earlier | |
| ids.df <- instagram$find(fields = '{"_id" : 1, "payload.created_time" : 1}') | |
| ids.df.simple <- data.frame(id = ids.df$`_id`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib.request | |
| import json | |
| from pymongo import MongoClient | |
| import time | |
| from multiprocessing import Pool | |
| DEEP_DRESS_WGET = 'http://localhost/wget/?url=' | |
| DEEP_DRESS_PREDICT = 'http://localhost/predict/' | |
| def wget_deep_dress(url): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib.request | |
| import json | |
| from pymongo import MongoClient | |
| import time | |
| def fetchAndStash(url, client): | |
| try: | |
| response = urllib.request.urlopen(url + '&count=100') | |
| f = response.read() | |
| payload = f.decode('utf-8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data(MovieLense) | |
| scheme <- evaluationScheme(MovieLense, method = "split", train = .9, | |
| k = 1, given = 10, goodRating = 4) | |
| scheme | |
| # register recommender | |
| recommenderRegistry$set_entry( | |
| method="RSVD", dataType = "realRatingMatrix", fun=REAL_RSVD, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require(recommenderlab) # Install this if you don't have it already | |
| require(devtools) # Install this if you don't have this already | |
| # Get additional recommendation algorithms | |
| install_github("sanealytics", "recommenderlabrats") | |
| data(MovieLense) # Get data | |
| # Divvy it up | |
| scheme <- evaluationScheme(MovieLense, method = "split", train = .9, | |
| k = 1, given = 10, goodRating = 4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unroll_Vecs <- function (params, Y, R, num_users, num_movies, num_features) { | |
| # Unrolls vector into X and Theta | |
| # Also calculates difference between preduction and actual | |
| endIdx <- num_movies * num_features | |
| X <- matrix(params[1:endIdx], nrow = num_movies, ncol = num_features) | |
| Theta <- matrix(params[(endIdx + 1): (endIdx + (num_users * num_features))], | |
| nrow = num_users, ncol = num_features) | |