Койляк Евгений Андреевич

Size: px
Start display at page:

Download "Койляк Евгений Андреевич"

Transcription

1 Работы победителя заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Большие данные и машинное обучение» Койляк Евгений Андреевич Класс: 11 Школа: ГБОУ Школа-интернат «Интеллектуал» Уникальный номер участника: 33 Параллель: класс Город: г. Москва Регион: г. Москва Команда на заключительном этапе: Кирпикла Результаты заключительного этапа: Индивидуальная часть Командный результат Математика Информатика Результат Итого 1-й день 2-й день 3-й день 1а 1б 1в

2 Индивидуальная часть Персональный лист участника с номером 33:

3 Лист 1: Математика

4 Лист 1 (обратная сторона): Оценка за задачу 1а: 1 Комментарий к решению: Задача решена верно. Оценка за задачу 1б: 3 Комментарий к решению: Задача решена верно Оценка за задачу 1в: 0 Комментарий к решению: Задача решена не верно Оценка за задачу 2: 0 Комментарий к решению: Задача решена не верно.

5

6 Информатика Задача 1 Задача решена (1 балл). Код программы на языке Python, написанный участником и решающий задачу: 1. n,m = map(int, input().split()) 2. a = list(map(int, input().split())) 3. b = list(map(int, input().split())) 4. a.sort() 5. a.reverse() 6. b.sort() 7. b.reverse() 8. for i in range(min(m,n)): 9. print(a[i], b[i]) 10. if m<n: 11. for i in range(m, n): 12. print(a[i], -1) Задача 2 Задача решена (1 балл). Код программы на языке Python, написанный участником и решающий задачу: import json 3. import math him = clas = 5 7. dop = vozr = n = int(input()) 11. ma = cou = su = ans = [] 15. for i in range(n): 16. v = input().split(', ') 17. b = [int(v[clas]), int(v[him]), int(v[dop]), int(v[vozr])] 18. if b[0] == 8 or b[0] == 9: 19. if b[1] > ma: 20. ma = b[1] 21. ans = v[0][2:-1] + ' ' + v[1][1:-1] 22. if b[2]!= 0: 23. su+= b[3] 24. cou+=1 25. if cou == 0: 26. print("no answer") 27. else: 28. print(su//cou) 29. if ma == -1: 30. print("no answer") 31. else: 32. print(ans)

7 Задача 3 Задача решена (3 балла). Код программы на языке Python, написанный участником и решающий задачу: 1. n,m = map(int, input().split()) 2. mas = [] 3. color = [0]*n 4. for i in range(n): 5. mas.append([]) 6. for i in range(m): 7. a,b = map(int, input().split()) 8. a-=1 9. b-=1 10. mas[a].append(b) 11. mas[b].append(a) def dfs(i, su2): 15. global color 16. color[i] = index 17. for j in mas[i]: 18. if color[j] == 0: 19. su2+= dfs(j, 0) 20. su2+=1 21. return su index = su = [] 25. for i in range(n): 26. if color[i] == 0: 27. index+=1 28. su.append(dfs(i, 0)) print(index) 31. for i in range(0, index): 32. print('['+str(su[i]+1) + ']', end = ' ') 33. for j in range(n): 34. if color[j] == i+1: 35. print(j+1, end=' ') 36. print() Задача 4 Задача решена (3 балла). Код программы на языке Python, написанный участником и решающий задачу: 1. k = int(input()) 2. m = list(map(int, input().split())) 3. alle = [0,0,0,0,0] 4. for i in range(100): 5. v = list(map(int, input().split())) 6. for j in range(5): 7. alle[j] += v[j] 8. def func(x, y): 9. if y == 1: 10. return x 11. else: 12. return 1-x 13. for i in range(5): 14. alle[i]/=

8 16. ans_vero = for i1 in range(2): 18. for i2 in range(2): 19. for i3 in range(2): 20. for i4 in range(2): 21. for i5 in range(2): 22. per = i1*m[0]+ i2*m[1] + i3*m[2] + i4*m[3] + i5*m[4] 23. if per >= k: 24. ans_vero+= func(alle[0], i1) *func(alle[1], i2) * func(alle[2], i3) * func(alle[3], i4) * func(alle[4], i5) 25. print(int(ans_vero* )) Задача 5 Задача решена (4 балла). Код программы на языке Python, написанный участником и решающий задачу: 1. color_dfs = [] 2. color = [] def dfs(i, t): 5. global color, color_dfs 6. color_dfs[i] = False 7. color[i] = t 8. for wqwe, x,y in vzat: 9. if x == i and color_dfs[y]: 10. dfs(y, t) 11. if y == i and color_dfs[x]: 12. dfs(x,t) n,m = list(map(int, input().split())) 15. sp_reb = [] for i in range(m): 18. a,b,w = list(map(int, input().split())) 19. a-=1 20. b-=1 21. sp_reb.append([w,a,b]) color = [0]*n 25. for i in range(n): 26. color[i] = i i = sp_reb.sort() 31. vzat = [] 32. index = while index < n-1: 34. if color[sp_reb[i][1]]!= color[sp_reb[i][2]]: 35. index+=1 36. vzat.append(sp_reb[i]) 37. color_dfs = [True]*n 38. dfs(sp_reb[i][1], color[sp_reb[i][1]]) 39. i+=1 40. su2 = for i in range(n-1): 42. su2 += vzat[i][0] 43. print(su2)

9 Командная часть Результаты были получены в рамках выступления команды: Кирпикла. Личный состав команды: Койляк Евгений Андреевич Коноваленко Даниил Дмитриевич Шумилов Кирилл Дмитриевич Результаты работы в командном этапе: Задача Задача 1 Задача 2 Задача 3 Результат Далее представлен код команды по задачам. Код был написан на языке Python, обрабатывал предоставленный организаторами набор данных. Задача 1 # coding: utf-8 # In[27]: from GraphParser import graphparser as gp from matplotlib import pyplot as plt import matplotlib import Task1Base as tb import os import pandas as pd # In[18]: graph_columns = ["from", "to", "links", "mask"] demography_columns = ["userid", "birth_date"] # In[19]: graph_folder_path = os.path.join("task1", "Task1", "graph") demography_folder_path = os.path.join("task1", "Task1", "traindemography") # In[20]: graph_lines = 5000 demography_lines = 5000 # In[21]: graph_fd = "" demography_fd = "" # In[22]:

10 graph_index_col = "from" demography_index_col = "userid" # In[24]: train_graph, graph_fd = gp.parsefolderbyschema(graph_folder_path, graph_lines, graph_fd, graph_index_col, graph_columns, True) # In[25]: train_demography, demography_fd = gp.parsefolderbyschema(demography_folder_path, demography_lines, demography_fd, demography_index_col, demography_columns, True) # In[26]: train_demography_df = pd.dataframe(list(train_demography.items()), columns = ["id", "age"]) train_demography_df.index = train_demography_df['id'] train_demography_df = train_demography_df[['age']] # In[28]: train_demography_df.head() # In[29]: from sklearn.linear_model import LinearRegression linear_regression = LinearRegression() # In[12]: from Task1Base import prediction_function # In[14]: get_ipython().magic('load_ext autoreload') # In[17]: autoreload 2 # In[19]: prediction_function(train_demography, train_graph)

11 Задача 2 import pickle from collections import Counter, defaultdict import pandas as pd def get_age(user_id, df): return int(df.loc[user_id]['birth_date']) def get_location(user_id, df): return int(df.loc[user_id]['id_location']) def get_country(user_id, df): return int(df.loc[user_id]['id_country']) graph = pickle.load(open('graph_.pkl', 'rb')) df = pickle.load(open('demog_pandas.pkl', 'rb')) know_loc_y = pickle.load(open('know_loc_y.pkl', 'rb')).iloc[:5000] know_loc_ids = know_loc_y.index.values print(len(know_loc_ids)) friends_of_y = dict() for i in know_loc_ids: friends_of_y.setdefault(i, graph[i]) missed = list() features = dict() i = 0 for user, friends in friends_of_y.items(): print(user) ages = list() frequent_location = Counter() frequent_country = Counter() if isinstance(friends, list): for friend in friends: try: age = get_age(friend, df) ages.append(age) try: frequent_location[get_location(friend, df)] += 1 except TypeError: continue frequent_country[get_country(friend, df)] += 1 except KeyError: print('check this guy', friend) continue else: try: age = get_age(friends, df) ages.append(age) try: frequent_location[get_location(friends, df)] += 1 except TypeError: print('check this guy', friends) missed.append(user) continue frequent_country[get_country(friend, df)] += 1 except KeyError: missed.append(user) continue features.setdefault(user, [sum(ages)/len(ages), frequent_location.most_common(1)[0][0], frequent_country.most_common(1)[0][0]]) print(i)

12 i += 1 features = pd.dataframe.from_dict(features, orient='index') features.to_pickle('features.pkl') print(missed, file=open('missed.txt', 'w')) print(know_loc_y) print(features) import pickle graph = pickle.load(open('graph.pkl', 'rb')) locs = pickle.load(open('locs.pkl', 'rb')) file = open('ids_to_predict.txt', 'w') for user in graph.keys(): try: print('{} - {}'.format(user, locs[user])) except KeyError: print('{} - location does not exists'.format(user)) print(user, file=file) file.close() from in_memory import get_friends, get_location def mask_open(mask): mask = int(mask) opened = bin(mask)[2:] opened = '0' + opened[-1::-1] return opened def get_relationships(mask: int) -> set: result = set() relationships = {1: 'Love', 2: 'Spouse', 3: 'Parent', 4: 'Child', 5: 'Brother/Sister', 6: 'Uncle/Aunt', 7: 'Relative', 8: 'Close friend', 9: 'Colleague', 10: 'Schoolmate', 11: 'Nephew', 12: 'Grandparent', 13: 'Grandchild', 14: 'College/University fellow', 15: 'Army fellow', 16: 'Parent in law', 17: 'Child in law', 18: 'Godparent', 19: 'Godchild', 20: 'Playing together', 21: ''} mask = mask_open(mask) for index, bit in enumerate(mask): if bit == '1': result.add(relationships[index]) return result def is_representative(mask: int): set_mask = get_relationships(mask)

13 non_represent = {'Army fellow', 'Playing together'} very_represent = {'Love', 'Spouse', 'Parent', 'Child'} if not set_mask: return 1 if non_represent & set_mask: return 0.1 if very_represent & set_mask: return 7 return 1 def jaccard_from_kailiak(userid_1: int, userid_2: int) -> float: # user1 is user for which we make a prediction neighborhood_1 = set(map(lambda x: x[0], get_friends(userid_1))) neighborhood_2 = set(map(lambda x: x[0], get_friends(userid_2))) c_friends = neighborhood_1 & neighborhood_2 try: return len(c_friends) / len(neighborhood_1) except: return 0 def jaccard_coefficient(userid_1: int, userid_2: int) -> float: neighborhood_1 = set(map(lambda x: x[0], get_friends(userid_1))) neighborhood_2 = set(map(lambda x: x[0], get_friends(userid_2))) c_friends = neighborhood_1 & neighborhood_2 all_friends = neighborhood_1 neighborhood_2 return len(c_friends) / len(all_friends) def list_nearest(user_id: int, friends: list) -> list: # return list with shape (count_of_friends, 2), where for every friend in descreasing order one line contains coefficient and location of friend answers = list() for friend_id, friend_mask in friends: result_friend = (1 + jaccard_from_kailiak(user_id, friend_id)) * is_representative(friend_mask) answers.append((result_friend, get_location(friend_id))) answers.sort() answers.reverse() return answers def k_nearest(user_id, friends, k): list_1 = list_nearest(user_id, friends) list_k = list_1[:max(k, len(list_1))] dict = {} for x, y in list_k: dict.setdefault(y, 0) dict[y] += 1 ma = -1 ma_ind = -1 for ind, value in dict.items(): if ma < value: ma = value ma_ind = ind return ma_ind def nearest(user_id, friends): return k_nearest(user_id, friends, 1) import pickle import os.path

14 pickled_graph = pickle.load(open(os.path.join('..', 'res', 'graph.pkl'), 'rb')) pickled_demography = pickle.load(open(os.path.join('..', 'res', 'locs_.pkl'), 'rb')) def get_friends(user_id): result = pickled_graph.get(user_id, []) try: if type(result[0])!= list: return [result] return result except: return result def get_location(user_id): return int(pickled_demography.get(user_id, 0)) Задача 3 # coding: utf-8 # In[55]: import csv, gzip, os, glob import pandas as pd import numpy as np import scipy as sp from scipy.sparse import coo_matrix, csr_matrix # In[56]: def jaccard_score(common_friends_matrix: csr_matrix, from_user:int, to_user: int) -> float: score = (common_friends_matrix[from_user, to_user] / (common_friends_matrix[from_user, from_user] + common_friends_matrix[to_user, to_user] - common_friends_matrix[from_user, to_user])) if score == sp.inf: return 0.0 else: return score # In[75]: def jaccard_feature(withdemography, commonfriends_csr): jaccard_array = np.zeros_like(withdemography["from"].values, dtype=np.float32) count = 0 for index, row in withdemography.iterrows(): if count % 1000 == 0: print(count) from_id = row['from'] to_id = row['to'] jaccard_array[count] = jaccard_score(commonfriends_csr, from_id, to_id) count += 1 withdemography["jaccard"] = jaccard_array del jaccard_array

15 # In[76]: def dgender_feature(withdemography): dgender_array = np.zeros_like(withdemography["from"].values, dtype=np.float32) count = 0 for index, row in withdemography.iterrows(): if count % 1000 ==0: print(count) if row['gender'] == row['gender_to']: dgender_array[count] += 1 count += 1 withdemography['dgender'] = dgender_array del dgender_array # In[77]: def dloc_feature(withdemography): dloc_array = np.zeros_like(withdemography["from"].values, dtype=np.float32) count = 0 for index, row in withdemography_train.iterrows(): if count % 1000 ==0: print(count) if row['id_country'] == row['id_country_to']: dloc_array[count] += 1 count += 1 withdemography['dloc'] = dloc_array del dloc_array # In[78]: core = pd.dataframe() for f in glob.glob("./coredemography/part*"): # Собираем все в один датафрэйм print(f) core = pd.concat( [core, # Поддержка csv из коробки :) pd.read_csv( f, sep = "\t", # Поддержка gzip из коробки :) compression = 'gzip', # Заводим индекс - будет быстрый доступ по ИД юзера index_col = ["userid"], names = ["userid", "create_date", "birth_date", "gender", "ID_country", "ID_Location", "loginregion"], dtype = { "userid" : np.int32, "create_date" : np.int64, "birth_date" : np.float16, "gender" : np.int8, "ID_country" : np.int64, "ID_Location" : np.int64, # Поскольку поле может быть пусто, используем float. На месте пустоты будет NaN "loginregion" : np.float32 } )])

16 # In[79]: datapath = "./" # In[80]: # Загрузка тренниночовой выборки общих друзей loaded = np.load(os.path.join(datapath, 'commonfriends_train.npz')) commonfriends_train_csr = csr_matrix((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']) commonfriends_train = commonfriends_train_csr.tocoo() # Загрузка тренниночовой выборки связей loaded = np.load(os.path.join(datapath,'train_markup.npz')) train_markup = csr_matrix((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']).tocoo() train_markup_df = pd.dataframe(data = {"from" : train_markup.row, "to" : train_markup.col, "label" : train_markup.data}) train_common_friends_df = pd.dataframe(data = {"from" : commonfriends_train.row, "to" : commonfriends_train.col, "common_neighbors" : commonfriends_train.data}) del loaded # In[81]: positives_train = pd.merge( train_markup_df, train_common_friends_df, how='inner', left_on = ["from","to"], right_on = ["from","to"]) sample_neg_train = train_common_friends_df.sample(frac=0.01, replace=true) del train_common_friends_df pre_negatives_train = pd.merge( sample_neg_train, train_markup_df, how='left', left_on = ["from","to"], right_on = ["from","to"]) negatives_train = pre_negatives_train[pre_negatives_train["label"]!= 1].replace(float("NaN"), 0.0) dataset_train = pd.concat([positives_train, negatives_train]) # In[82]: del positives_train del negatives_train del sample_neg_train del train_markup_df # In[83]:

17 withdemography_train = pd.merge( pd.merge( dataset_train, core, how='inner', left_on = ["from"], right_index = True), core, how='inner', left_on = ["to"], right_index = True, suffixes = ['',"_to"]) # In[84]: del withdemography_train['create_date'] del withdemography_train['create_date_to'] # In[85]: jaccard_feature(withdemography_train, commonfriends_train_csr) dgender_feature(withdemography_train) dloc_feature(withdemography_train) # In[86]: # Загрузка тестовой выборкиобщих друзей loaded = np.load(os.path.join(datapath, 'commonfriends_test.npz')) commonfriends_test_csr = csr_matrix((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']) commonfriends_test = commonfriends_test_csr.tocoo() # Загрузка тестовой выборки связей loaded = np.load(os.path.join(datapath, 'test_markup.npz')) test_markup = csr_matrix((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']).tocoo() test_markup_df = pd.dataframe(data = {"from" : test_markup.row, "to" : test_markup.col, "common_neighbors" : test_markup.data}) test_common_friends_df = pd.dataframe(data = {"from" : commonfriends_test.row, "to" : commonfriends_test.col, "common_neighbors" : commonfriends_test.data}) del loaded # In[24]: positives_test = pd.merge( test_markup_df, test_common_friends_df, how='inner', left_on = ["from","to"], right_on = ["from","to"]) del test_common_friends_df pre_negatives_test = pd.merge( sample_neg_test,

18 test_markup_df, how='left', left_on = ["from","to"], right_on = ["from","to"]) sample_neg_test = test_common_friends_df.sample(frac=0.01, replace=true) negatives_test = pre_negatives_test[pre_negatives_test["label"]!= 1].replace(float("NaN"), 0.0) dataset_test = pd.concat([positives_test, negatives_test]) del positives_test del negatives_test del sample_neg_test del train_markup_df_test del withdemography_test['create_date'] del withdemography_test['create_date_to'] withdemography_test = pd.merge( pd.merge( dataset_test, core, how='inner', left_on = ["from"], right_index = True), core, how='inner', left_on = ["to"], right_index = True, suffixes = ['',"_to"]) jaccard_feature(withdemography_test) dgender_feature(withdemography_test) dloc_feature(withdemography_test) # Загрузка валидационной выборки общих друзей loaded = np.load(os.path.join(datapath, 'commonfriedns_validation.npz')) commonfriends_valid_csr = csr_matrix((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']) commonfriends_valid = commonfriends_valid_csr.tocoo() # Загрузка валидационной выборки связей loaded = np.load(os.path.join(datapath, 'validation_marup.npz')) valid_markup = csr_matrix((loaded['data'], loaded['indices'], loaded['indptr']), shape=loaded['shape']).tocoo() valid_common_friends_df = pd.dataframe(data = {"from" : commonfriends_train.row,

19 commonfriends_train.data}) del loaded "to" : commonfriends_train.col, "common_neighbors" : positives_valid = pd.merge( valid_markup_df, valid_common_friends_df, how='inner', left_on = ["from","to"], right_on = ["from","to"]) del valid_common_friends_df pre_negatives_valid = pd.merge( sample_neg_test, valid_markup_df, how='left', left_on = ["from","to"], right_on = ["from","to"]) sample_neg_valid = valid_common_friends_df.sample(frac=0.01, replace=true) negatives_valid = pre_negatives_valid[pre_negatives_valid["label"]!= 1].replace(float("NaN"), 0.0) dataset_valid = pd.concat([positives_valid, negatives_valid]) del positives_valid del negatives_valid del sample_neg_test del train_markup_df_valid withdemography_valid = pd.merge( pd.merge( dataset_valid, core, how='inner', left_on = ["from"], right_index = True), core, how='inner', left_on = ["to"], right_index = True, suffixes = ['',"_to"]) del withdemography_valid['create_date'] del withdemography_valid['create_date_to']

20 jaccard_feature(withdemography_valid) dgender_feature(withdemography_valid) dloc_feature(withdemography_valid) withdemography_train.to_pickle('withdemography_train.pkl') withdemography_test.to_pickle('withdemography_test.pkl') withdemography_valid.to_pickle('withdemography_valid.pkl') y_train, X_train = withdemography_train['label'].values, withdemography_train[fields].values y_test, X_test = withdemography_test['label'].values, withdemography_test[fields].values y_valid, X_valid = withdemography_train['label'].values, withdemography_train[fields].values from sklearn.ensemble import RandomForestClassifier fields = ['jaccard'] clf = RandomForestClassifier() clf.fit(x_train, y_train) clf.score(x_test, y_test) from sklearn.externals import joblib joblib.dump(clf, 'randforest.pkl') import pickle X_valid = pickle.load(open('x_valid.pkl', 'rb'))

21 answer = clf.predict_proba(x_valid[fields].values) val = X_valid[['from', 'to']] val = X_valid[['from', 'to']] val['is_friend'] = np.array([l[1] for l in answer]) val['not_friend'] = np.array([l[0] for l in answer]) val = val.sort_values(['from', 'not_friend']) val[val['from']==2405] from sklearn.neighbors import KNeighborsClassifier clf1 = KNeighborsClassifier(n_neighbors=40, weights='distance') clf1.fit(x, y) clf1.score(x_test, y_test) answer = clf1.predict_proba(x_valid[fields]) val = X_valid[['from', 'to']] val['is_friend'] = np.array([l[1] for l in answer]) val['not_friend'] = np.array([l[0] for l in answer]) val = val.sort_values(['from', 'not_friend']) X_valid = X_valid.sort_values(['from', 'jaccard'], ascending=[true, False])

22 X_valid X_valid clf.score(x_test, y_test) ids = np.array(sorted(set(x_valid['from'].values))) import csv with open('result.csv', 'w') as f: writer = csv.writer(f, delimiter='\t') for user_id in ids: if X_valid['label']==1: continue top = X_valid[X_valid['from']==user_id] top_users = top['to'].values writer.writerow([user_id] + list(top_users))

Русинович Андрей Сергеевич

Русинович Андрей Сергеевич Работа победителя заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Водные робототехнические системы» Русинович Андрей Сергеевич

More information

Бырков Аким Дмитриевич

Бырков Аким Дмитриевич Работа призера заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Виртуальная и дополненная реальность» Бырков Аким Дмитриевич Класс:

More information

Ковешников Арсений Александрович

Ковешников Арсений Александрович Работа призера заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Виртуальная и дополненная реальность» Ковешников Арсений Александрович

More information

Introduction to Machine Learning. Useful tools: Python, NumPy, scikit-learn

Introduction to Machine Learning. Useful tools: Python, NumPy, scikit-learn Introduction to Machine Learning Useful tools: Python, NumPy, scikit-learn Antonio Sutera and Jean-Michel Begon September 29, 2016 2 / 37 How to install Python? Download and use the Anaconda python distribution

More information

Новоселов Даниил Евгеньевич

Новоселов Даниил Евгеньевич Работа победителя заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Создание систем протезирования (Нейротехнологии)» Новоселов

More information

Lab Five. COMP Advanced Artificial Intelligence Xiaowei Huang Cameron Hargreaves. October 29th 2018

Lab Five. COMP Advanced Artificial Intelligence Xiaowei Huang Cameron Hargreaves. October 29th 2018 Lab Five COMP 219 - Advanced Artificial Intelligence Xiaowei Huang Cameron Hargreaves October 29th 2018 1 Decision Trees and Random Forests 1.1 Reading Begin by reading chapter three of Python Machine

More information

Introduction to Python: The Multi-Purpose Programming Language. Robert M. Porsch June 14, 2017

Introduction to Python: The Multi-Purpose Programming Language. Robert M. Porsch June 14, 2017 Introduction to Python: The Multi-Purpose Programming Language Robert M. Porsch June 14, 2017 What is Python Python is Python is a widely used high-level programming language for general-purpose programming

More information

Scientific Computing with Python. Quick Introduction

Scientific Computing with Python. Quick Introduction Scientific Computing with Python Quick Introduction Libraries and APIs A library is a collection of implementations of behavior (definitions) An Application Programming Interface (API) describes that behavior

More information

Плевако Матвей Дмитриевич

Плевако Матвей Дмитриевич Работа победителя/призера заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Программная инженерия финансовых технологий» Плевако

More information

$ easy_install scikit-learn from scikits.learn import svm. Shouyuan Chen

$ easy_install scikit-learn from scikits.learn import svm. Shouyuan Chen $ easy_install scikit-learn from scikits.learn import svm Shouyuan Chen scikits.learn Advantages Many useful model Unified API for various ML algorithms Very clean source code Features Supervised learning

More information

(2) Hypothesis Testing

(2) Hypothesis Testing (2) Hypothesis Testing March 1, 2016 In [4]: %matplotlib inline #python includes import sys #standard probability includes: import numpy as np #matrices and data structures import scipy.stats as ss #standard

More information

Lab 10 - Ridge Regression and the Lasso in Python

Lab 10 - Ridge Regression and the Lasso in Python Lab 10 - Ridge Regression and the Lasso in Python March 9, 2016 This lab on Ridge Regression and the Lasso is a Python adaptation of p. 251-255 of Introduction to Statistical Learning with Applications

More information

Lab 9 - Linear Model Selection in Python

Lab 9 - Linear Model Selection in Python Lab 9 - Linear Model Selection in Python March 7, 2016 This lab on Model Validation using Validation and Cross-Validation is a Python adaptation of p. 248-251 of Introduction to Statistical Learning with

More information

INTERMEDIATE PYTHON FOR DATA SCIENCE. Comparison Operators

INTERMEDIATE PYTHON FOR DATA SCIENCE. Comparison Operators INTERMEDIATE PYTHON FOR DATA SCIENCE Comparison Operators Numpy Recap In [1]: import numpy as np In [2]: np_height = np.array([1.73, 1.68, 1.71, 1.89, 1.79]) In [3]: np_weight = np.array([65.4, 59.2, 63.6,

More information

Python Data representations. Numpy, pandas, sklearn

Python Data representations. Numpy, pandas, sklearn Python Data representations Numpy, pandas, sklearn M X N matrix mn m m n n m x x x x x x x x x X y y y y 2 1 2 22 21 1 12 11 2 1, Matrix with m-samples in n- dimensions and y labels Data Representations

More information

Derek Bridge School of Computer Science and Information Technology University College Cork

Derek Bridge School of Computer Science and Information Technology University College Cork CS4619: Artificial Intelligence II Overfitting and Underfitting Derek Bridge School of Computer Science and Information Technology University College Cork Initialization In [1]: %load_ext autoreload %autoreload

More information

AN EXAMPLE FOR THE USE OF BITWISE OPERATIONS IN PROGRAMMING. Krasimir Yordzhev

AN EXAMPLE FOR THE USE OF BITWISE OPERATIONS IN PROGRAMMING. Krasimir Yordzhev МАТЕМАТИКА И МАТЕМАТИЧЕСКО ОБРАЗОВАНИЕ, 2009 MATHEMATICS AND EDUCATION IN MATHEMATICS, 2009 Proceedings of the Thirty Eighth Spring Conference of the Union of Bulgarian Mathematicians Borovetz, April 1

More information

Python: Swiss-Army Glue. Josh Karpel Graduate Student, Yavuz Group UW-Madison Physics Department

Python: Swiss-Army Glue. Josh Karpel Graduate Student, Yavuz Group UW-Madison Physics Department 1 Python: Swiss-Army Glue Josh Karpel Graduate Student, Yavuz Group UW-Madison Physics Department My Research: Matrix Multiplication 2 My Research: Computational Quantum Mechanics 3 Why

More information

Pandas and Friends. Austin Godber Mail: Source:

Pandas and Friends. Austin Godber Mail: Source: Austin Godber Mail: godber@uberhip.com Twitter: @godber Source: http://github.com/desertpy/presentations What does it do? Pandas is a Python data analysis tool built on top of NumPy that provides a suite

More information

Lab 16 - Multiclass SVMs and Applications to Real Data in Python

Lab 16 - Multiclass SVMs and Applications to Real Data in Python Lab 16 - Multiclass SVMs and Applications to Real Data in Python April 7, 2016 This lab on Multiclass Support Vector Machines in Python is an adaptation of p. 366-368 of Introduction to Statistical Learning

More information

LECTURE 19. Numerical and Scientific Packages

LECTURE 19. Numerical and Scientific Packages LECTURE 19 Numerical and Scientific Packages NUMERICAL AND SCIENTIFIC APPLICATIONS As you might expect, there are a number of third-party packages available for numerical and scientific computing that

More information

MATH 829: Introduction to Data Mining and Analysis Model selection

MATH 829: Introduction to Data Mining and Analysis Model selection 1/12 MATH 829: Introduction to Data Mining and Analysis Model selection Dominique Guillot Departments of Mathematical Sciences University of Delaware February 24, 2016 2/12 Comparison of regression methods

More information

A. Python Crash Course

A. Python Crash Course A. Python Crash Course Agenda A.1 Installing Python & Co A.2 Basics A.3 Data Types A.4 Conditions A.5 Loops A.6 Functions A.7 I/O A.8 OLS with Python 2 A.1 Installing Python & Co You can download and install

More information

Pandas. Data Manipulation in Python

Pandas. Data Manipulation in Python Pandas Data Manipulation in Python 1 / 27 Pandas Built on NumPy Adds data structures and data manipulation tools Enables easier data cleaning and analysis import pandas as pd 2 / 27 Pandas Fundamentals

More information

Scientific Programming. Lecture A07 Pandas

Scientific Programming. Lecture A07 Pandas Scientific Programming Lecture A07 Pandas Alberto Montresor Università di Trento 2018/10/19 Acknowledgments: Stefano Teso, Pandas Documentation http://disi.unitn.it/~teso/courses/sciprog/python_pandas.html

More information

Python (version 3.6) for R Users: Stat Modules I

Python (version 3.6) for R Users: Stat Modules I Python (version 3.6) for R Users: Stat Modules I CMU MSP 36601, Fall 2017, Howard Seltman 1. Use the numpy module to get vector, matrix, and array functionality as well as linear algebra. The official

More information

Байков Аяз Ильдарович

Байков Аяз Ильдарович Работа победителя/призера заключительного этапа командной инженерной олимпиады школьников Олимпиада Национальной технологической инициативы Профиль «Программная инженерия финансовых технологий» Байков

More information

Lab Four. COMP Advanced Artificial Intelligence Xiaowei Huang Cameron Hargreaves. October 22nd 2018

Lab Four. COMP Advanced Artificial Intelligence Xiaowei Huang Cameron Hargreaves. October 22nd 2018 Lab Four COMP 219 - Advanced Artificial Intelligence Xiaowei Huang Cameron Hargreaves October 22nd 2018 1 Reading Begin by reading chapter three of Python Machine Learning until page 80 found in the learning

More information

A brief introduction to coding in Python with Anatella

A brief introduction to coding in Python with Anatella A brief introduction to coding in Python with Anatella Before using the Python engine within Anatella, you must first: 1. Install & download a Python engine that support the Pandas Data Frame library.

More information

CS Programming Languages: Python

CS Programming Languages: Python CS 3101-1 - Programming Languages: Python Lecture 5: Exceptions / Daniel Bauer (bauer@cs.columbia.edu) October 08 2014 Daniel Bauer CS3101-1 Python - 05 - Exceptions / 1/35 Contents Exceptions Daniel Bauer

More information

file:///users/jacobperricone/desktop/stanford/cme193_s18/cme193/lectures/presentations/lecture6.slides.html?print-pdf=true#/ 1/112

file:///users/jacobperricone/desktop/stanford/cme193_s18/cme193/lectures/presentations/lecture6.slides.html?print-pdf=true#/ 1/112 CME 193 Introduction to Scienti c Python Spring 2018 Lecture 6 Pandas file:///users/jacobperricone/desktop/stanford/cme193_s18/cme193/lectures/presentations/lecture6.slides.html?print-pdf=true#/ 1/112

More information

from sklearn import tree from sklearn.ensemble import AdaBoostClassifier, GradientBoostingClassifier

from sklearn import tree from sklearn.ensemble import AdaBoostClassifier, GradientBoostingClassifier 1 av 7 2019-02-08 10:26 In [1]: import pandas as pd import numpy as np import matplotlib import matplotlib.pyplot as plt from sklearn import tree from sklearn.ensemble import AdaBoostClassifier, GradientBoostingClassifier

More information

Chapter 1 : Informatics Practices. Class XII ( As per CBSE Board) Advance operations on dataframes (pivoting, sorting & aggregation/descriptive

Chapter 1 : Informatics Practices. Class XII ( As per CBSE Board) Advance operations on dataframes (pivoting, sorting & aggregation/descriptive Chapter 1 : Informatics Practices Class XII ( As per CBSE Board) Advance operations on dataframes (pivoting, sorting & aggregation/descriptive statistics) Pivoting - dataframe DataFrame -It is a 2-dimensional

More information

LECTURE 22. Numerical and Scientific Packages

LECTURE 22. Numerical and Scientific Packages LECTURE 22 Numerical and Scientific Packages NUMERIC AND SCIENTIFIC APPLICATIONS As you might expect, there are a number of third-party packages available for numerical and scientific computing that extend

More information

Lab 15 - Support Vector Machines in Python

Lab 15 - Support Vector Machines in Python Lab 15 - Support Vector Machines in Python November 29, 2016 This lab on Support Vector Machines is a Python adaptation of p. 359-366 of Introduction to Statistical Learning with Applications in R by Gareth

More information

Derek Bridge School of Computer Science and Information Technology University College Cork

Derek Bridge School of Computer Science and Information Technology University College Cork CS4618: rtificial Intelligence I Vectors and Matrices Derek Bridge School of Computer Science and Information Technology University College Cork Initialization In [1]: %load_ext autoreload %autoreload

More information

Pandas. Data Manipulation in Python

Pandas. Data Manipulation in Python Pandas Data Manipulation in Python 1 / 26 Pandas Built on NumPy Adds data structures and data manipulation tools Enables easier data cleaning and analysis import pandas as pd 2 / 26 Pandas Fundamentals

More information

Hands-on Machine Learning for Cybersecurity

Hands-on Machine Learning for Cybersecurity Hands-on Machine Learning for Cybersecurity James Walden 1 1 Center for Information Security Northern Kentucky University 11th Annual NKU Cybersecurity Symposium Highland Heights, KY October 11, 2018 Topics

More information

SUPERVISED LEARNING WITH SCIKIT-LEARN. How good is your model?

SUPERVISED LEARNING WITH SCIKIT-LEARN. How good is your model? SUPERVISED LEARNING WITH SCIKIT-LEARN How good is your model? Classification metrics Measuring model performance with accuracy: Fraction of correctly classified samples Not always a useful metric Class

More information

IMPORTING & MANAGING FINANCIAL DATA IN PYTHON. Read, inspect, & clean data from csv files

IMPORTING & MANAGING FINANCIAL DATA IN PYTHON. Read, inspect, & clean data from csv files IMPORTING & MANAGING FINANCIAL DATA IN PYTHON Read, inspect, & clean data from csv files Import & clean data Ensure that pd.dataframe() is same as csv source file Stock exchange listings: amex-listings.csv

More information

Practical session 3: Machine learning for NLP

Practical session 3: Machine learning for NLP Practical session 3: Machine learning for NLP Traitement Automatique des Langues 21 February 2018 1 Introduction In this practical session, we will explore machine learning models for NLP applications;

More information

Chapter 5 : Informatics Practices. Class XII ( As per CBSE Board) Numpy - Array. New Syllabus Visit : python.mykvs.in for regular updates

Chapter 5 : Informatics Practices. Class XII ( As per CBSE Board) Numpy - Array. New Syllabus Visit : python.mykvs.in for regular updates Chapter 5 : Informatics Practices Class XII ( As per CBSE Board) Numpy - Array New Syllabus 2019-20 NumPy stands for Numerical Python.It is the core library for scientific computing in Python. It consist

More information

Python Crash Course Numpy, Scipy, Matplotlib

Python Crash Course Numpy, Scipy, Matplotlib Python Crash Course Numpy, Scipy, Matplotlib That is what learning is. You suddenly understand something you ve understood all your life, but in a new way. Doris Lessing Steffen Brinkmann Max-Planck-Institut

More information

Python for Data Analysis. Prof.Sushila Aghav-Palwe Assistant Professor MIT

Python for Data Analysis. Prof.Sushila Aghav-Palwe Assistant Professor MIT Python for Data Analysis Prof.Sushila Aghav-Palwe Assistant Professor MIT Four steps to apply data analytics: 1. Define your Objective What are you trying to achieve? What could the result look like? 2.

More information

DATA STRUCTURE AND ALGORITHM USING PYTHON

DATA STRUCTURE AND ALGORITHM USING PYTHON DATA STRUCTURE AND ALGORITHM USING PYTHON Common Use Python Module II Peter Lo Pandas Data Structures and Data Analysis tools 2 What is Pandas? Pandas is an open-source Python library providing highperformance,

More information

Final Exam, Version 3 CSci 127: Introduction to Computer Science Hunter College, City University of New York

Final Exam, Version 3 CSci 127: Introduction to Computer Science Hunter College, City University of New York Final Exam, Version 3 CSci 127: Introduction to Computer Science Hunter College, City University of New York 22 May 2018 1. (a) What will the following Python code print: i. a = "one+two+three+four+five+six"

More information

Assignment4. November 29, Follow the directions on https://www.tensorflow.org/install/ to install Tensorflow on your computer.

Assignment4. November 29, Follow the directions on https://www.tensorflow.org/install/ to install Tensorflow on your computer. Assignment4 November 29, 2017 1 CSE 252A Computer Vision I Fall 2017 1.1 Assignment 4 1.2 Problem 1: Install Tensorflow [2 pts] Follow the directions on https://www.tensorflow.org/install/ to install Tensorflow

More information

Q1. Write code to Import an entire module named as Calculator.py in your program.*1+

Q1. Write code to Import an entire module named as Calculator.py in your program.*1+ KENDRIYA VIDYALAYA, IIT POWAI, MUMBAI REGION 2 nd Unit Test 2018-19 Class 11 th (Eleventh) Subject : Informatics Practices(065) Max.Mark : 50 Time : 1½ hrs. Instructions : (i) All ques. Are compulsory

More information

ARTIFICIAL INTELLIGENCE AND PYTHON

ARTIFICIAL INTELLIGENCE AND PYTHON ARTIFICIAL INTELLIGENCE AND PYTHON DAY 1 STANLEY LIANG, LASSONDE SCHOOL OF ENGINEERING, YORK UNIVERSITY WHAT IS PYTHON An interpreted high-level programming language for general-purpose programming. Python

More information

Series. >>> import numpy as np >>> import pandas as pd

Series. >>> import numpy as np >>> import pandas as pd 7 Pandas I: Introduction Lab Objective: Though NumPy and SciPy are powerful tools for numerical computing, they lack some of the high-level functionality necessary for many data science applications. Python

More information

IST 597 Deep Learning Overfitting and Regularization. Sep. 27, 2018

IST 597 Deep Learning Overfitting and Regularization. Sep. 27, 2018 IST 597 Deep Learning Overfitting and Regularization 1. Overfitting Sep. 27, 2018 Regression model y 1 3 x3 13 2 x2 36x10 import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import

More information

Python and Bioinformatics. Pierre Parutto

Python and Bioinformatics. Pierre Parutto Python and Bioinformatics Pierre Parutto October 9, 2016 Contents 1 Common Data Structures 2 1.1 Sequences............................... 2 1.1.1 Manipulating Sequences................... 2 1.1.2 String.............................

More information

What is Data Science?

What is Data Science? What is Data Science? Data science ~ computer science + mathematics/statistics + visualization Outline of a data science project Harvesting Cleaning Analyzing Visualizing Publishing Actively used Python

More information

COMP 364: Computer Tools for Life Sciences

COMP 364: Computer Tools for Life Sciences COMP 364: Computer Tools for Life Sciences Intro to machine learning with scikit-learn Christopher J.F. Cameron and Carlos G. Oliver 1 / 1 Key course information Assignment #4 available now due Monday,

More information

EPL451: Data Mining on the Web Lab 5

EPL451: Data Mining on the Web Lab 5 EPL451: Data Mining on the Web Lab 5 Παύλος Αντωνίου Γραφείο: B109, ΘΕΕ01 University of Cyprus Department of Computer Science Predictive modeling techniques IBM reported in June 2012 that 90% of data available

More information

The UOB Python Lectures: Part 3 - Python for Data Analysis

The UOB Python Lectures: Part 3 - Python for Data Analysis The UOB Python Lectures: Part 3 - Python for Data Analysis Hesham al-ammal University of Bahrain Small Data BIG Data Data Scientist s Tasks Interacting with the outside world Reading and writing with a

More information

Python for Scientists

Python for Scientists High level programming language with an emphasis on easy to read and easy to write code Includes an extensive standard library We use version 3 History: Exists since 1991 Python 3: December 2008 General

More information

Python Tutorial for CSE 446

Python Tutorial for CSE 446 Python Tutorial for CSE 446 Kaiyu Zheng, David Wadden Department of Computer Science & Engineering University of Washington January 2017 Goal Know some basics about how to use Python. See how you may use

More information

Dhavide Aruliah Director of Training, Anaconda

Dhavide Aruliah Director of Training, Anaconda PARALLEL COMPUTING WITH DASK Understanding Computer Storage & Dhavide Aruliah Director of Training, Anaconda Big Data What is "Big Data"? "Data > one machine" Storage Units: Bytes, Kilobytes, Megabytes,...

More information

maxbox Starter 66 - Data Science with Max

maxbox Starter 66 - Data Science with Max //////////////////////////////////////////////////////////////////////////// Machine Learning IV maxbox Starter 66 - Data Science with Max There are two kinds of data scientists: 1) Those who can extrapolate

More information

Goals: In [1]: import numpy as np. In [2]: from sklearn.svm import SVR. Introduction to the challenge

Goals: In [1]: import numpy as np. In [2]: from sklearn.svm import SVR.   Introduction to the challenge In [1]: import numpy as np import pandas as pd import os import warnings import time warnings.simplefilter("ignore") In [2]: from sklearn.svm import SVR from sklearn.linear_model import SGDRegressor, LinearRegression

More information

pygdf Documentation Release Continuum Analytics

pygdf Documentation Release Continuum Analytics pygdf Documentation Release 0.1.0 Continuum Analytics Aug 28, 2018 Contents: 1 API Reference 1 1.1 DataFrame................................................ 1 1.2 Series...................................................

More information

TypeScript. Часть II. Старков Дима

TypeScript. Часть II. Старков Дима TypeScript Часть II Старков Дима 1 Сегодня Вывод типов Структурная типизация Более сложные типы Обобщенные типы Type Guards 2 TypeScript? Спасет от выстрелов себе в ногу ESNext прямо сейчас Средство против

More information

INTERMEDIATE PYTHON FOR DATA SCIENCE. while loop

INTERMEDIATE PYTHON FOR DATA SCIENCE. while loop INTERMEDIATE PYTHON FOR DATA SCIENCE while loop if-elif-else control.py Goes through construct only once z = 6 if z % 2 == 0 : True print(z is divisible by 2) Executed elif z % 3 == 0 : print(z is divisible

More information

MLXTEND. Mlxtend v Sebastian Raschka

MLXTEND. Mlxtend v Sebastian Raschka MLXTEND Mlxtend v0.4.1 Sebastian Raschka 1 2 CONTENTS Contents 0.0.1 Welcome to mlxtend s documentation!........... 19 0.1 Links.................................. 20 0.2 Examples...............................

More information

EPL451: Data Mining on the Web Lab 10

EPL451: Data Mining on the Web Lab 10 EPL451: Data Mining on the Web Lab 10 Παύλος Αντωνίου Γραφείο: B109, ΘΕΕ01 University of Cyprus Department of Computer Science Dimensionality Reduction Map points in high-dimensional (high-feature) space

More information

NumPy Primer. An introduction to numeric computing in Python

NumPy Primer. An introduction to numeric computing in Python NumPy Primer An introduction to numeric computing in Python What is NumPy? Numpy, SciPy and Matplotlib: MATLAB-like functionality for Python Numpy: Typed multi-dimensional arrays Fast numerical computation

More information

Data Wrangling with Python and Pandas

Data Wrangling with Python and Pandas Data Wrangling with Python and Pandas January 25, 2015 1 Introduction to Pandas: the Python Data Analysis library This is a short introduction to pandas, geared mainly for new users and adapted heavily

More information

Final Exam, Version 1 CSci 127: Introduction to Computer Science Hunter College, City University of New York

Final Exam, Version 1 CSci 127: Introduction to Computer Science Hunter College, City University of New York Final Exam, Version 1 CSci 127: Introduction to Computer Science Hunter College, City University of New York 17 May 2018 1. (a) What will the following Python code print: i. a = "Jan&Feb&Mar&Apr&May&Jun"

More information

MERGING DATAFRAMES WITH PANDAS. Appending & concatenating Series

MERGING DATAFRAMES WITH PANDAS. Appending & concatenating Series MERGING DATAFRAMES WITH PANDAS Appending & concatenating Series append().append(): Series & DataFrame method Invocation: s1.append(s2) Stacks rows of s2 below s1 Method for Series & DataFrames concat()

More information

Problem Based Learning 2018

Problem Based Learning 2018 Problem Based Learning 2018 Introduction to Machine Learning with Python L. Richter Department of Computer Science Technische Universität München Monday, Jun 25th L. Richter PBL 18 1 / 21 Overview 1 2

More information

IMPORTING DATA IN PYTHON. Introduction to other file types

IMPORTING DATA IN PYTHON. Introduction to other file types IMPORTING DATA IN PYTHON Introduction to other file types Other file types Excel spreadsheets MATLAB files SAS files Stata files HDF5 files Pickled files File type native to Python Motivation: many datatypes

More information

Ch.1 Introduction. Why Machine Learning (ML)? manual designing of rules requires knowing how humans do it.

Ch.1 Introduction. Why Machine Learning (ML)? manual designing of rules requires knowing how humans do it. Ch.1 Introduction Syllabus, prerequisites Notation: Means pencil-and-paper QUIZ Means coding QUIZ Code respository for our text: https://github.com/amueller/introduction_to_ml_with_python Why Machine Learning

More information

MLCV 182: Practical session 1 Ron Shapira Weber Computer Science, Ben-Gurion University

MLCV 182: Practical session 1 Ron Shapira Weber Computer Science, Ben-Gurion University MLCV 182: Practical session 1 Ron Shapira Weber Computer Science, Ben-Gurion University Getting Started There are two different versions of Python being supported at the moment, 2.7 and 3.6. For compatibility

More information

Part VI. Scientific Computing in Python. Alfredo Parra : Scripting with Python Compact Max-PlanckMarch 6-10,

Part VI. Scientific Computing in Python. Alfredo Parra : Scripting with Python Compact Max-PlanckMarch 6-10, Part VI Scientific Computing in Python Compact Course @ Max-PlanckMarch 6-10, 2017 63 Doing maths in Python Standard sequence types (list, tuple,... ) Can be used as arrays Can contain different types

More information

sklearn-crfsuite Documentation

sklearn-crfsuite Documentation sklearn-crfsuite Documentation Release 0.3 Mikhail Korobov May 29, 2018 Contents 1 Contents 3 1.1 Install Instructions............................................ 3 1.2 Tutorial..................................................

More information

ENGR (Socolofsky) Week 07 Python scripts

ENGR (Socolofsky) Week 07 Python scripts ENGR 102-213 (Socolofsky) Week 07 Python scripts A couple programming examples for this week are embedded in the lecture notes for Week 7. We repeat these here as brief examples of typical array-like operations

More information

Programming with Python

Programming with Python Programming with Python EOAS Software Carpentry Workshop September 21st, 2016 https://xkcd.com/353 Getting started For our Python introduction we re going to pretend to be a researcher studying inflammation

More information

Python Data representations. Numpy, pandas, sklearn

Python Data representations. Numpy, pandas, sklearn Python Data representations Numpy, pandas, sklearn M X N matrix mn m m n n m x x x x x x x x x X y y y y 2 1 2 22 21 1 12 11 2 1, Matrix with m-samples in n- dimensions and y labels Data Representations

More information

Case study: accessing financial data

Case study: accessing financial data Case study: accessing financial data Prof. Mauro Gaspari: gaspari@cs.unibo.it Methods for accessing databases What methods exist to access financial databases? Basically there are several approaches to

More information

Math 1MP3, final exam

Math 1MP3, final exam Math 1MP3, final exam 23 April 2015 Please write your name and student number on this test and on your answer sheet You have 120 minutes No external aids (calculator, textbook, notes) Please number your

More information

Scientific Computing with Python and CUDA

Scientific Computing with Python and CUDA Scientific Computing with Python and CUDA Stefan Reiterer High Performance Computing Seminar, January 17 2011 Stefan Reiterer () Scientific Computing with Python and CUDA HPC Seminar 1 / 55 Inhalt 1 A

More information

Programming for Engineers in Python

Programming for Engineers in Python Programming for Engineers in Python Autumn 2016-17 Lecture 11: NumPy & SciPy Introduction, Plotting and Data Analysis 1 Today s Plan Introduction to NumPy & SciPy Plotting Data Analysis 2 NumPy and SciPy

More information

HANDS ON DATA MINING. By Amit Somech. Workshop in Data-science, March 2016

HANDS ON DATA MINING. By Amit Somech. Workshop in Data-science, March 2016 HANDS ON DATA MINING By Amit Somech Workshop in Data-science, March 2016 AGENDA Before you start TextEditors Some Excel Recap Setting up Python environment PIP ipython Scientific computation in Python

More information

Clustering to Reduce Spatial Data Set Size

Clustering to Reduce Spatial Data Set Size Clustering to Reduce Spatial Data Set Size Geoff Boeing arxiv:1803.08101v1 [cs.lg] 21 Mar 2018 1 Introduction Department of City and Regional Planning University of California, Berkeley March 2018 Traditionally

More information

Practical example - classifier margin

Practical example - classifier margin Support Vector Machines (SVMs) SVMs are very powerful binary classifiers, based on the Statistical Learning Theory (SLT) framework. SVMs can be used to solve hard classification problems, where they look

More information

An introduction to. Python. Edwin J. Son (National Institute for Mathematical Sciences)

An introduction to. Python. Edwin J. Son (National Institute for Mathematical Sciences) An introduction to Python Edwin J. Son (National Institute for Mathematical Sciences) [link to this slides: https://goo.gl/kotwpz ] [jupyter notebook: https://goo.gl/9m9rmk ] Why Python? The scientist's

More information

NumPy and SciPy. Lab Objective: Create and manipulate NumPy arrays and learn features available in NumPy and SciPy.

NumPy and SciPy. Lab Objective: Create and manipulate NumPy arrays and learn features available in NumPy and SciPy. Lab 2 NumPy and SciPy Lab Objective: Create and manipulate NumPy arrays and learn features available in NumPy and SciPy. Introduction NumPy and SciPy 1 are the two Python libraries most used for scientific

More information

Derek Bridge School of Computer Science and Information Technology University College Cork. from sklearn.preprocessing import add_dummy_feature

Derek Bridge School of Computer Science and Information Technology University College Cork. from sklearn.preprocessing import add_dummy_feature CS4618: Artificial Intelligence I Gradient Descent Derek Bridge School of Computer Science and Information Technology University College Cork Initialization In [1]: %load_ext autoreload %autoreload 2 %matplotlib

More information

windrose Documentation Lionel Roubeyrie & Sebastien Celles

windrose Documentation Lionel Roubeyrie & Sebastien Celles Lionel Roubeyrie & Sebastien Celles Sep 04, 2018 Contents: 1 Install 3 1.1 Requirements............................................... 3 1.2 Install latest release version via pip...................................

More information

Intermediate/Advanced Python. Michael Weinstein (Day 2)

Intermediate/Advanced Python. Michael Weinstein (Day 2) Intermediate/Advanced Python Michael Weinstein (Day 2) Topics Review of basic data structures Accessing and working with objects in python Numpy How python actually stores data in memory Why numpy can

More information

Mock Final Exam CSci 127: Introduction to Computer Science Hunter College, City University of New York

Mock Final Exam CSci 127: Introduction to Computer Science Hunter College, City University of New York Mock Final Exam CSci 127: Introduction to Computer Science Hunter College, City University of New York 15 May 2018 1. (a) What will the following Python code print: i. s = "Ada:)Lovelace:)Grace:)Hopper"

More information

In stochastic gradient descent implementations, the fixed learning rate η is often replaced by an adaptive learning rate that decreases over time,

In stochastic gradient descent implementations, the fixed learning rate η is often replaced by an adaptive learning rate that decreases over time, Chapter 2 Although stochastic gradient descent can be considered as an approximation of gradient descent, it typically reaches convergence much faster because of the more frequent weight updates. Since

More information

STA141C: Big Data & High Performance Statistical Computing

STA141C: Big Data & High Performance Statistical Computing STA141C: Big Data & High Performance Statistical Computing Lecture 1: Python programming (1) Cho-Jui Hsieh UC Davis April 4, 2017 Python Python is a scripting language: Non-scripting language (C++. java):

More information

Python Tutorial for CSE 446

Python Tutorial for CSE 446 Python Tutorial for CSE 446 Kaiyu Zheng, Fanny Huang Department of Computer Science & Engineering University of Washington January 2018 Goal Know some basics about how to use Python. See how you may use

More information

BinaryMatcher2. Preparing the Data. Preparing the Raw Data: 32 rows Binary and 1-Hot. D. Thiebaut. March 19, 2017

BinaryMatcher2. Preparing the Data. Preparing the Raw Data: 32 rows Binary and 1-Hot. D. Thiebaut. March 19, 2017 BinaryMatcher2 D. Thiebaut March 19, 2017 This Jupyter Notebook illustrates how to design a simple multi-layer Tensorflow Neural Net to recognize integers coded in binary and output them as 1-hot vector.

More information

Ch.1 Introduction. Why Machine Learning (ML)?

Ch.1 Introduction. Why Machine Learning (ML)? Syllabus, prerequisites Ch.1 Introduction Notation: Means pencil-and-paper QUIZ Means coding QUIZ Why Machine Learning (ML)? Two problems with conventional if - else decision systems: brittleness: The

More information

CSci 127: Introduction to Computer Science

CSci 127: Introduction to Computer Science CSci 127: Introduction to Computer Science hunter.cuny.edu/csci CSci 127 (Hunter) Lecture 11: tinyurl.com/yb8lcvl7 15 November 2017 1 / 48 Lecture Slip: tinyurl.com/yb8lcvl7 CSci 127 (Hunter) Lecture 11:

More information

Python VSIP API: A first draft

Python VSIP API: A first draft Python VSIP API: A first draft Stefan Seefeld HPEC WG meeting, December 9, 2014 Goals Use cases: Promote VSIP standard to a wider audience (SciPy users) Add more hardware acceleration to SciPy Allow VSIP

More information

1 # Says hello to someone 2 3 s = input() 4 print(f"hello, {s}") input.py

1 # Says hello to someone 2 3 s = input() 4 print(fhello, {s}) input.py 1 # Says hello to someone 3 s = input() 4 print(f"hello, {s}") input.py 1 # A program 3 4 def main(): 5 print("hello, world") 6 7 8 if name == " main ": 9 main() main.py speller/dictionary.py 1 class Dictionary:

More information