Skip to content

Instantly share code, notes, and snippets.

View duarteocarmo's full-sized avatar
💭

Duarte OC duarteocarmo

💭
View GitHub Profile
@duarteocarmo
duarteocarmo / libraries.py
Created April 26, 2018 11:20
Extensive library list
from py2neo import Graph
import numpy as np
from pandas import DataFrame
import itertools
import matplotlib.pyplot as plt
import seaborn as sns
import json
import math
import pandas as pd
import plotly
@duarteocarmo
duarteocarmo / index.html
Created March 20, 2018 22:53
Quote Machine
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="outer">
<div class="middle">
<div class="inner">
<div class="quote message">
Quotes are boring.
</div>
<div class="row" id="Middle">
# -*- coding: utf-8 -*-
""" Use DeepMoji to score texts for emoji distribution.
The resulting emoji ids (0-63) correspond to the mapping
in emoji_overview.png file at the root of the DeepMoji repo.
Writes the result to a csv file.
"""
from __future__ import print_function, division
from matplotlib.pyplot import figure, show, savefig, close
from toolbox_02450 import clusterplot
from scipy.cluster.hierarchy import linkage, fcluster, dendrogram
from Project_Clean_data import raw, header, standardize_this
import numpy as np
import seaborn as sns
# select attribute to predict
target_attribute_name = 'Dx'
target_index = list(header).index(target_attribute_name)
import numpy as np
from subprocess import run
import re
import os
import time
from sys import platform
import matplotlib.pyplot as plt
import seaborn as sns
from Project_Clean_data import raw, header, standardize_this
# exercise 11.4.1
import numpy as np
from matplotlib.pyplot import (figure, imshow, bar, title, xticks, yticks, cm,
subplot, show, legend, hold)
from matplotlib.pyplot import (figure, hold, subplot, plot, xlabel, ylabel,
xticks, yticks,legend,show)
from scipy.io import loadmat
from toolbox_02450 import gausKernelDensity
from sklearn.neighbors import NearestNeighbors
from Project_Clean_data import raw, header, standardize_this
@duarteocarmo
duarteocarmo / Project_2_LogisticRegression.py
Created November 14, 2017 08:27
Classification - Logistic Regression
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 12 09:54:58 2017
@author: sviglios
"""
from Project_Clean_data import raw, header, is_binary
from sklearn import cross_validation, tree
import sklearn.linear_model as lm
@duarteocarmo
duarteocarmo / Project_2_DecisionTree.py
Created November 14, 2017 08:25
Classification - Decision Tree
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 11 09:16:48 2017
@author: sviglios
"""
from sklearn import cross_validation, tree
from sklearn.metrics import confusion_matrix
from Project_Clean_data import raw, header, is_binary
@duarteocarmo
duarteocarmo / Final_NeuralNetwork.py
Created November 14, 2017 08:22
Neural Network Regression Problem.
# exercise 8.2.6
from matplotlib.pyplot import figure, plot, subplot, title, show, bar, legend, scatter
import numpy as np
from scipy.io import loadmat
import matplotlib.pyplot as plt
import neurolab as nl
from sklearn import model_selection
from scipy import stats
from Project_Clean_data import raw, header, is_binary
@duarteocarmo
duarteocarmo / 1.txt
Created October 9, 2017 12:03
Output of whole wikipedia query
For the pattern "cat" [0, 16] "are" [2, 6] "to" we found 6363 matches in 0:15:43.31:
['cations are used to']
['cations== arrays are used to']
['cation modalities are audito']
['catalogue == compared to']
['cations are the to']
['cations since they are easy to']
['cations are used to']
['catalan has a shared histo']
['cations) are able to']