Skip to content

Instantly share code, notes, and snippets.

View duarteocarmo's full-sized avatar
💭

Duarte OC duarteocarmo

💭
View GitHub Profile
@duarteocarmo
duarteocarmo / updater.py
Created July 15, 2019 14:17
Automatic report generator
import subprocess
import sys
import papermill as papermill
import os
ONEDRIVE_FOLDER = "shared folder"
LOCAL_FOLDER = "local-copy"
BASE_NOTEBOOK = ".ipynb"
# data importing
import py2neo
# data handling
import numpy
import pandas
import scipy.cluster.hierarchy
import scipy.linalg
import math
@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