Skip to content

Instantly share code, notes, and snippets.

View dukn's full-sized avatar
🎯
Focusing

DucNguyen dukn

🎯
Focusing
View GitHub Profile
@dukn
dukn / funny_max_nn.py
Last active May 14, 2019 15:06
Just 4 fun =)))
import random
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from sklearn.datasets.samples_generator import make_blobs
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.metrics import mean_squared_error
@dukn
dukn / install_conda.sh
Last active May 14, 2019 03:39
install anaconda with 1 line :))
#!/bin/bash
wget --quiet https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
@dukn
dukn / download_image_parallel.py
Created August 23, 2018 09:55
download image form link farallel
import os
import sys
import wget
import pandas as pd
from multiprocessing import Pool
FILE_PATH = sys.argv[1]
def get_file_paths(FILE_PATH):
df = pd.read_csv(FILE_PATH, header=None)
import os
def count(path):
ld = os.listdir(path)
#print (ld)
result = 0
for name in ld:
if os.path.isdir(path+'/'+name):
#print (name)
ld2 = os.listdir("{}/{}/".format(path,name))
@dukn
dukn / parallels.py
Last active July 23, 2018 10:06
Parallel download image from list of links
from __future__ import print_function
import os
import sys
import Queue
import threading
import urllib
import time
PARALLEL = True
if not os.path.exists("parallels"):
@dukn
dukn / fpgrowth.py
Last active December 5, 2017 15:48
Report datamining - Nhóm 7 - Association rule và giải thuật FP-Growth
from __future__ import division, print_function
import numpy as np
import itertools
class FPTreeNode():
def __init__(self, item=None, support=1):
self.item = item
self.support = support
self.children = {}
@dukn
dukn / Plot_Examples.md
Created May 3, 2017 10:16 — forked from gizmaa/Plot_Examples.md
Various Julia plotting examples using PyPlot