This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0 963 429 1949 2979 1504 206 2976 3095 | |
| 963 0 671 996 2054 1329 802 2013 2142 | |
| 429 671 0 1616 2631 1075 233 2684 2799 | |
| 1949 996 1616 0 1059 2037 1771 1307 1235 | |
| 2979 2054 2631 1059 0 2687 2786 1131 379 | |
| 1504 1329 1075 2037 2687 0 1308 3273 3053 | |
| 206 802 233 1771 2786 1308 0 2815 2934 | |
| 2976 2013 2684 1307 1131 3273 2815 0 808 | |
| 3095 2142 2799 1235 379 3053 2934 808 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def trapezio(k, n, x0, xn, func, f_aux): | |
| h = float((xn - x0)) / (n-1) | |
| xs = np.linspace(x0, xn, n) | |
| summation = func(f_aux, k, x0) + func(f_aux, k, xn) | |
| for idx in range(1, n-1): | |
| summation += 2*func(f_aux, k, xs[idx]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import numpy as np | |
| from sklearn.model_selection import GridSearchCV | |
| from sklearn import metrics | |
| import matplotlib.pyplot as plt | |
| import xgboost as xgb | |
| from xgboost.sklearn import XGBClassifier | |
| df = pd.read_csv('new_train.csv') | |
| print 'number of features', df.shape[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def merge_sort(alist): | |
| ''' | |
| ########### | |
| DIVISAO | |
| ########### | |
| ''' | |
| print 'Splitting ', alist | |
| #Se a lista tiver mais do que um elemento... | |
| if len(alist) > 1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from OpenGL.GL import * | |
| from OpenGL.GLUT import * | |
| from OpenGL.GLU import * | |
| import sys | |
| import copy | |
| from math import cos, sin | |
| from plyfile import PlyData, PlyElement |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Queda livre via Diferenças Finitas | |
| a = -g | |
| x'' = - g | |
| . | |
| . | |
| . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def sigmoid(x): | |
| return 1.0/(1.0+np.exp(-x)) | |
| def sigmoid_prime(x): | |
| return sigmoid(x)*(1-sigmoid(x)) | |
| class neural_net: | |
| def __init__(self, eta, numrounds, hidden_nodes): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import nltk | |
| def ngram(sentence, n): | |
| input_list = nltk.word_tokenize(sentence) | |
| return zip(*[input_list[i:] for i in xrange(n)]) | |
| """ | |
| x = 'Hi, my name is Eric. I work at Syncano and deeply believe all people have the right to freedom' | |
| ngram(x,3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clear() | |
| function[C] = calculaCosseno(a,b) | |
| C = (a'*b)/(norm(a)*norm(b)); | |
| endfunction | |
| function[] = plota(v_i) | |
| t = 0:0.1:5 | |
| v_i = v_i/norm(v_i) | |
| plot(t*v_i(1),t*v_i(2)) | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function[C] = calculaCosseno(a,b) | |
| C = (a'*b)/ (norm(a)*norm(b)); | |
| endfunction | |
| function[] = plota(v_i) | |
| t = 0:0.1:5 | |
| v_i = v_i/norm(v_i) | |
| plot(t*v_i(1),t*v_i(2)) | |
| endfunction |