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
    
  
  
    
  | #! /bin/bash | |
| add_users() { | |
| auth=$(echo "admin:admin"|base64) | |
| for i in {1..1000} | |
| do | |
| username="testuser${i}" | 
  
    
      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
    
  
  
    
  | mvn versions:update-properties -Dincludes=org.wso2.carbon.identity.* -DgenerateBackupPoms=false | |
| mvn versions:update-properties -DgenerateBackupPoms=false -Dincludes=org.wso2.carbon.identity.*,org.wso2.carbon.extension.identity.*,org.wso2.charon,org.apache.rampart.wso2,org.apache.ws.security.wso2,org.wso2.carbon.consent.* -U | |
| //Run in release profile with signing disabled | |
| mvn clean install -P wso2-release -Dgpg.skip | |
| mvn versions:set -DnewVersion=1.0.8-SNAPSHOT | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env bash | |
| # | |
| # gh-dl-release! It works! | |
| # | |
| # This script downloads an asset from latest or specific Github release of a | |
| # private repo. Feel free to extract more of the variables into command line | |
| # parameters. | |
| # | |
| # PREREQUISITES | |
| # | 
  
    
      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
    
  
  
    
  | /* | |
| This widget shows Recent Posts on your Tumblr blog. | |
| Its dependency is jQuery. | |
| Usage: | |
| 1) Add html: | |
| <div id="recent-posts"></div> | |
| 2) Add code into the <head>: | 
  
    
      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
    
  
  
    
  | var config = { | |
| "transport" : "http", | |
| "das_host" : "127.0.0.1:9763", | |
| "das_endpoint" : "/endpoints/", | |
| "event_receiver" : "event_receiver", | |
| "ml_host" : "127.0.0.1:9765", | |
| "ml_username" : "admin", | |
| "ml_password" : "admin" | |
| }; | 
  
    
      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 json | |
| import zipfile | |
| import numpy as np | |
| import pandas as pd | |
| import ast | |
| import time | |
| import datetime | |
| import httplib2 | |
| import pprint | 
  
    
      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(caret) | |
| library(randomForest) | |
| trainFiles <- dir("testtt/rows", pattern = "*") | |
| testFiles <- dir("testtt/tests", pattern = "*") | |
| #models <- vector("list", 320) | |
| result <- data.frame("TRIP_ID" = character(), "TRAVEL_TIME" = numeric(), stringsAsFactors = FALSE) | |
| for(i in 1:320) { | |
| print(i) | |
| trdata <- read.csv(paste("testtt/rows", trainFiles[[i]], sep="/")) | 
  
    
      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
    
  
  
    
  | /** | |
| * Returns the list of recommendations for a given user | |
| * | |
| * @param userId user id. | |
| * @param model best model. | |
| * @param ratings rating data. | |
| * @param products product list. | |
| * @return The list of recommended products. | |
| */ | |
| private static List<Rating> getRecommendations(final int userId, MatrixFactorizationModel model, JavaRDD<Tuple2<Integer, Rating>> ratings, Map<Integer, String> products) { | 
  
    
      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
    
  
  
    
  | /** | |
| * Calculating the Root Mean Squared Error | |
| * | |
| * @param model best model generated. | |
| * @param data rating data. | |
| * @return Root Mean Squared Error | |
| */ | |
| public static Double computeRMSE(MatrixFactorizationModel model, JavaRDD<Rating> data) { | |
| JavaRDD<Tuple2<Object, Object>> userProducts = data.map( | |
| new Function<Rating, Tuple2<Object, Object>>() { | 
  
    
      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
    
  
  
    
  | //training model | |
| int[] ranks = {8, 12}; | |
| float[] lambdas = {0.1f, 10.0f}; | |
| int[] numIters = {10, 20}; | |
| double bestValidationRmse = Double.MAX_VALUE; | |
| int bestRank = 0; | |
| float bestLambda = -1.0f; | |
| int bestNumIter = -1; | |
| MatrixFactorizationModel bestModel = null; | 
NewerOlder