This file contains 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 tensorflow as tf | |
import numpy as np | |
from random import random | |
from keras.datasets import mnist | |
ALPHA = 0.05 | |
LEARNING_RATE = 0.1*ALPHA | |
EPOCHS = 10 | |
NUM_OF_FEATURES = 100 |
This file contains 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 math | |
import time | |
class LearningVectorQuantization(): | |
def __init__(self, alpha=0, learning_rate=0): | |
self.weight = {} | |
self.learning_rate = learning_rate | |
self.alpha = alpha |
This file contains 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 math | |
class ActivationFunction(): | |
def sigmoid(self, x): | |
return 1 / (1 + math.exp(-x)) | |
def binary_hard_limit(self, x): | |
if x <= 0: | |
return 0 |
This file contains 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(e1071) | |
library(gmodels) | |
library(caret) | |
# 1. Load dataset from CSV | |
bank_csv <- read.csv("./Downloads/bank-additional/bank-additional-full.csv", header=TRUE, sep=";") | |
bank_df <- as.data.frame(bank_csv[1:32951,]) | |
summary(bank_df) |
This file contains 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(e1071) | |
library(gmodels) | |
# 1. Load dataset from CSV | |
bank_csv <- read.csv("./Downloads/bank-additional/bank-additional-full.csv", header=TRUE, sep=";") | |
bank_df <- as.data.frame(bank_csv[1:32951,]) | |
summary(bank_df) | |
# 2. Do the preprocessing |
This file contains 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
CREATE DATABASE kereta_api_indonesia; | |
use kereta_api_indonesia; | |
CREATE TABLE country ( | |
id_country INT PRIMARY KEY AUTO_INCREMENT, | |
name VARCHAR(50) NOT NULL | |
); | |
INSERT INTO country (name) VALUES ('Indonesia'); |
This file contains 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
class QueueArray(object): | |
def create_queue(self): | |
self.queue = [] | |
def destroy_queue(self): | |
self.queue = None | |
def enqueue(self, nilai): | |
if type(self.queue) != None: |
This file contains 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
class StackArray(object): | |
""" | |
Perbandingan sintaks Python dan Java | |
- self = this | |
- def = function | |
- None = null | |
""" | |
def create_stack(self, panjang): | |
self.panjang = panjang |
This file contains 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
version: '2' | |
services: | |
portainer: | |
image: portainer/portainer | |
command: -H unix:///var/run/docker.sock | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- portainer_data:/data | |
ports: |
This file contains 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 QUEUE_URL = '<url>/clickstreamQueueDev'; | |
var AWS = require('aws-sdk'); | |
var sqs = new AWS.SQS({region : 'ap-northeast-1'}); | |
exports.handler = function(event, context, callback) { | |
var params = { | |
MessageBody: event.body, | |
QueueUrl: QUEUE_URL | |
}; | |