Skip to content

Instantly share code, notes, and snippets.

View skyer9's full-sized avatar
🎯
Focusing

skyer9

🎯
Focusing
View GitHub Profile
@skyer9
skyer9 / tfidf.py
Last active August 11, 2019 04:50
TF IDF with amazon review dataset
# -*- coding: utf-8 -*-
import pyspark
from pyspark.sql import SQLContext
# +--------------+---------+------------------+
# | doc_id| token| tfidf|
# +--------------+---------+------------------+
# |R13E0LFYMKV62T| |12.613611576441143|
# |R1QYQ8ZJ9LS8L9| high|11.634883586257445|
@skyer9
skyer9 / word_embedding.ipynb
Created May 4, 2019 13:18
word_embedding.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@skyer9
skyer9 / ElasticSearch.template
Created September 13, 2018 02:53 — forked from ajbrown/ElasticSearch.template
AWS CloudFormation Template For ElasticSearch Cluster
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "ElasticSearch Cluster.",
"Parameters" : {
"KeyName": {
"Description" : "The name of an existing key pair to enable SSH access to Amazon EC2 instances",
"Type": "String",
@skyer9
skyer9 / change time zone ami linux.md
Last active May 2, 2018 21:39
change time zone ami linux
$ tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
@skyer9
skyer9 / sftp on ec2 with vscode.txt
Last active April 29, 2018 12:07
sftp on ec2 with vscode
1. 마켓 플레이스에서 SFTP 다운받기
2. ctrl+shift+p 를 누른 후, sftp: config 를 입력한다.
3. 설정을 아래와 같이 수정한다.
{
"context": "./sftp/searver_a",
"protocol": "sftp",
"host": "13.XXX.42.109",
@skyer9
skyer9 / MyHttpsURLConnection.java
Last active February 11, 2018 08:03
Using Self-Certification File in Androiod App
package kr.co.episode.muglangguide.data.remote;
import android.content.Context;
import org.apache.http.conn.ssl.SSLSocketFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.security.KeyManagementException;
# https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
# https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import SGD
import numpy as np
x_data = [[0, 0, 0],
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
[1, 1, 0],
x_train = [1., 2., 3., 4.]
y_train = [1.1, 2.1, 3.1, 4.1]
W, b = 123, 45
learning_rate = 0.05
for epoch in range(0, 200):
for j in range(0, len(x_train)):
cal_y = W * x_train[j] + b