Skip to content

Instantly share code, notes, and snippets.

View lawrencechen0921's full-sized avatar
🏠
Working from home

Lawrence Chen lawrencechen0921

🏠
Working from home
View GitHub Profile
[![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=lawrencechen0921)](https://github.com/anuraghazra/github-readme-stats)
@lawrencechen0921
lawrencechen0921 / README.md
Created December 7, 2019 09:19 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@lawrencechen0921
lawrencechen0921 / BHP.py
Created September 23, 2019 13:47
Machine Learning of Boston-House-Pricing pred
import tensorflow as tf
import keras
(x_train, y_train), (x_test, y_test) = keras.datasets.boston_housing.load_data()
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['font size'] = 10*3
plt.rcParams['figure.figsize'] = [18, 12]
public class QuickFindUF
{
private int [ ] id;
public QuickFindUF( int N)
{
id = new int[N]; # set id of each object to itself { N array accesses}
for ( int i = 0 ; i < N ; i ++)
id[ i ] = i ;
}
public static void main(String[ ] args)
{
int N = StdIn. readInt( );
UF uf = new UF(N) ;
while (! StdIn . isEmpty( ) )
{
int p = StdIn . readInt( );
int q = StdIn . readInt( );
if (! uf . connected(p, q) )
{
@lawrencechen0921
lawrencechen0921 / recursion.js
Last active September 11, 2019 15:58
start to use Javascript to make a recursion algorithms
function factorial (num) {
if (num === 1) {
return num
} else {
return num * factorial(num - 1)
}
}
factorail(5)
#LIFO 觀念
@lawrencechen0921
lawrencechen0921 / tf.keras.model.py
Last active September 10, 2019 11:38
建立keras model
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
@lawrencechen0921
lawrencechen0921 / tensorflow dataflow.py
Created September 10, 2019 10:36
tensorflow的資料流t 新手教學
import tensorflow as tf
a = tf.constant(1, name='a')
b = tf.constant(1, name='b')
c = a+b
with tf.Session as sess: #注意以上的session將a,b 視為個體, 否則跑出來的結果會為不同
print(sess.run(c))
import tensorflow as tf
a = tf.constant(1, name='a')
@lawrencechen0921
lawrencechen0921 / BS4HTML.py
Created August 30, 2019 11:46
用BeautifulSoup 分析HTML 標籤、屬性和值
from bs4 import BeautifulSoup as soup
fin=open('web.htm', encoding='utf-8') #將html檔案放置 web.htm(再轉換到fin開啟)
s=fin.read()
htm=soup(s,'html.parser')
print(htm.title.prettify())
print(htm.title.contents)
print(htm.contents[0])
print(htm.title.name)
print(htm.title.string)
print(htm.meta)
@lawrencechen0921
lawrencechen0921 / twstock.py
Last active August 24, 2019 14:26
預測股票分析以及建圖---可自選股票型號並用前五天趨勢分析未來(FinMind技術)
from FinMind.Data import Load
import numpy as np
#import pandas as pd
from keras.layers.core import Dense, Dropout
from keras.layers import LSTM , GRU
from keras.models import Sequential
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import math
from keras.optimizers import Adam