Skip to content

Instantly share code, notes, and snippets.

@aiscool
aiscool / README.md
Created January 17, 2016 02:58 — forked from sepans/README.md
Implementation of Random Projection Locality Sensitive Hashing

Port of this python code in Javascript.

LSH from Wikipedia:

Locality-sensitive hashing (LSH) reduces the dimensionality of high-dimensional data. LSH hashes input items so that similar items map to the same “buckets” with high probability (the number of buckets being much smaller than the universe of possible input items). LSH differs from conventional and cryptographic hash functions because it aims to maximize the probability of a “collision” for similar items. Locality-sensitive hashing has much in common with data clustering and nearest neighbor search.

More explanation:

@aiscool
aiscool / AStar.java
Created April 11, 2016 14:43
This A* Algorithm is not follow the standard(maybe?) since I was not calculate the diagonal part. This code has been written in java and credit to http://www.codebytes.in/2015/02/a-shortest-path-finding-algorithm.html
//source : http://www.codebytes.in/2015/02/a-shortest-path-finding-algorithm.html
import java.util.*;
public class AStar {
public static final int V_H_COST = 1;
static class Cell{
int heuristicCost = 0; //Heuristic cost
int finalCost = 0; //G+H
int i, j;
@aiscool
aiscool / JavaApplication1.java
Created May 13, 2016 12:56
j48 algorithm used for training and testing altered state of consciousness dataset. the result got 94.12% accuracy.
package javaapplication1;
/**
*
* @author commander
*/
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import matplotlib.pyplot as plt
from sklearn import svm,metrics
import pandas as pd
df = pd.read_csv('training-test.csv')
df = df.iloc[:,1:]
train = df.sample(frac=0.9, random_state=255)
test = df.drop(train.index)
@aiscool
aiscool / waktu_solat.py
Last active January 6, 2017 17:49
Download all info about prayer time at www.e-solat.gov.my and store in database
#!/usr/bin/env python
"""
Original Script : https://gist.github.com/efaisal/4583986
Muat turun data waktu solat Jakim
Create database nama 'waktusolat' dalam MySQL
Lepas tu create table 'waktu_solat'
@aiscool
aiscool / mlp_signature.py
Last active January 9, 2017 01:03
Baseline.csv : 97.72% , full.csv : 86.36%
import pandas as pd
from sklearn.metrics import accuracy_score
from sklearn.neural_network import MLPClassifier
df = pd.read_csv('Baseline.csv') #Baseline.csv dengan full.csv
maxi = 0
max_i = 0
max_j = 0
for i in range(10):
data = df.sample(frac=0.7, random_state=i)