1234567891011121314151617181920212223 unixtime1 = 1514735577.775000000000unix_timestamp_plus_5_min = unixtime1 + (6 * 60) #6분후print("unix_timestamp_plus_5_min",unix_timestamp_plus_5_min) a = 1514734859.55b = 1514735272.40datetimeobj1 = datetime.fromtimestamp(a).strftime('%H:%M:%S')datetimeobj2 = datetime.fromtimestamp(b).strftime('%H:%M:%S') print("datetimeobj1",datetimeobj1) #00:40:59print("dat..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 import numpy as np import matplotlib.pyplot as plt N = 512 T = 1.0 / 44100.0 f1 = 697 f2 = 1209 t = np.linspace(0.0, N*T, N) y1 = 1.1 ..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import tensorflow as tf import numpy as np sess = tf.Session() sess.run(tf.global_variables_initializer()) x = [i for i in range(10)] print(x) #list 생성 #마지막 차원에 2개의 값으로 고정된 2차원 행렬을 만든다 y = tf.reshape(x, shape = [-1,2]).eval(session=sess) print("y.shape ", y.shape) # (5, 2) #마지막 차원에 5개의 값으로 고정된 2차원 ..
RandomState는 다양한 확률 분포에서 추출한 난수를 생성하는 여러 가지 방법을 제공 1 2 3 4 5 6 7 import numpy as np from datetime import datetime random_number = np.random.RandomState(datetime.now().microsecond) print("datetime.now().microsecond",datetime.now().microsecond) #datetime.now().microsecond 600700 print(random_number) #RandomState(MT19937) Colored by Color Scripter cs
Kaggle 사이트 참고하였다. 1. 참고사이트 Xgboost 하이퍼 파라미터 튜닝 1. learning rate 선택 및 learning rate 에 맞는 tree 갯수 선정하기 - 선정 후 learning rate와 estimator 값 고정 2. GridSearchCV 함수를 사용하여 원하는 값 튜닝하기 2-1 max_depth, min_child_weight 2-2 Gamma 2-3 subsample, colsample_bytree 2-4 Regularization parameter 3. seed 별 앙상블 후 결과제출
타이타닉 데이터를 기준으로 하였다. Kaggle 데이터를 사용해서 데이터를 pandas 를 사용해서 어떻게 잘 처리할 수 있는지 공부해보았다. *** 타이타닉 데이터 - 참고 train.py test.py 1. read_csv 파일 읽기 1 2 train = pd.read_csv('C:\\Users\\my\\Desktop\\input\\train.csv') test = pd.read_csv('C:\\Users\\\my\Desktop\\input\\test.csv') cs 2. train, test 정보확인하기 - info 함수 : 각 column의 정보보기 1 2 print(train.info()) print(test.info()) cs - head() 함수 : 앞 5줄의 정보만 간략하게 보기 1 2 p..
input_comma폴더 파일을 다음과 같이 6개가 존재한다. 파일은 다음과 같다. x_coordinate, y_coordinate, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 import pandas as pd import os path_dir = './input_comma/' #폴더명 file_list = os.listdir(path_dir) print(file_list) new_excel = pd.DataFrame( columns=['file_name','average1', 'average2', 'ave..
추후작성예정