This file contains 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
names = [ | |
'A', 'A#', 'B', 'C', 'C#', 'D', | |
'D#', 'E', 'F', 'F#', 'G', 'G#' | |
] | |
name2int = { n:i for i, n in enumerate(names) } | |
class Note(object): | |
def __init__(self, name, major=True) -> None: | |
super().__init__() |
This file contains 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
corr = train.corr(method='spearman') | |
mask = np.zeros_like(corr) | |
mask[np.triu_indices_from(mask)] = True | |
fig, ax = plt.subplots() | |
ax.figure.set_size_inches(10, 10) | |
sns.heatmap(corr, ax=ax, annot=True, mask=mask, fmt='.2f', cbar=False, square=True, cmap=plt.cm.Blues, center=0) |
This file contains 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
1 Physical GPUs, 1 Logical GPU | |
> Preprocessing Spotify dataset. This process may take several hours. | |
>> Checking if the Spotify MPD is already preprocessed. | |
>> Preprocessed version was found. Skipping stage. | |
> Loading Spotify MPD dataset. | |
>> Dataset loaded. | |
> Splitting dataset | |
>> Sampling 10% of dataset | |
>> Splitting sample with 20% for testing | |
>> Creating Vocab. |
This file contains 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
> Preprocessing Spotify dataset. This process may take several hours. | |
>> Checking if the Spotify MPD is already preprocessed. | |
>> Preprocessed version was found. Skipping stage. | |
> Loading Spotify MPD dataset. | |
>> Dataset loaded. | |
> Splitting dataset | |
>> Sampling 1% of dataset | |
>> Splitting sample with 20% for testing | |
>> Creating Vocab. | |
> Building tensorflow datasets. |
This file contains 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
# (C) Júlio Guedes | |
# ATAL 2019.2 | |
letters = input() | |
hello = "hello" | |
pointer = 0 | |
for l in letters: | |
if pointer < len(hello): | |
if (l == hello[pointer]): |
This file contains 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
dtree_parameters = { | |
'max_depth': [12, 24, 36, 50], | |
'min_samples_leaf': [5, 10, 15, 25], | |
'max_features': ['sqrt', 'log2', None], | |
'max_leaf_nodes': [50, 100, 175, 250] | |
} | |
decision_tree_model = DTree() | |
decision_tree = GSearchCV(decision_tree_model, dtree_parameters, cv=5, n_jobs=-1, scoring=acc, verbose = 10) | |
decision_tree.fit(rntr, ry_train) | |
best_tree = decision_tree.best_estimator_ |
This file contains 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
from sklearn.metrics import confusion_matrix | |
from sklearn.utils.multiclass import unique_labels | |
import itertools | |
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', | |
cmap=plt.cm.get_cmap('Blues'), figsize=None, savefig=None): | |
# Função importada dos exemplos do SKLearn | |
if normalize: | |
cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis] |
This file contains 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
cidade | semana | tmedia | tmax | tmin | chuva | mes | ano | |
---|---|---|---|---|---|---|---|---|
Campina Grande | 1992-12-27T00:00:00Z | 26.133333333333333 | 30.4 | 20.7 | 0 | 12 | 1992 | |
Campina Grande | 1993-01-03T00:00:00Z | 26.11904761904762 | 32.4 | 19.3 | 0 | 1 | 1993 | |
Campina Grande | 1993-01-10T00:00:00Z | 25.766666666666666 | 32.2 | 19.7 | 0 | 1 | 1993 | |
Campina Grande | 1993-01-31T00:00:00Z | 25.74 | 32 | 19.9 | 0.4 | 1 | 1993 | |
Campina Grande | 1993-02-07T00:00:00Z | 26.314285714285713 | 32.7 | 19.6 | 0.3 | 2 | 1993 | |
Campina Grande | 1993-02-14T00:00:00Z | 26.285714285714285 | 32.7 | 20 | 0 | 2 | 1993 | |
Campina Grande | 1993-02-21T00:00:00Z | 26.47142857142857 | 32.3 | 20.4 | 4.9 | 2 | 1993 | |
Campina Grande | 1993-02-28T00:00:00Z | 26.566666666666666 | 32.3 | 21.2 | 0 | 2 | 1993 | |
Campina Grande | 1993-10-31T00:00:00Z | 25.766666666666666 | 32.1 | 19 | 0 | 10 | 1993 |
This file contains 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 | |
# (C) Júlio Barreto | |
# 22/09/2018 | |
''' | |
Script to monitor any website's HTML changes | |
''' | |
import urllib2, smtplib | |
from getpass import getpass | |
from time import sleep |
This file contains 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 React from 'react'; | |
import { View } from 'react-native'; | |
import { Input } from 'react-native-elements'; | |
type Props = { | |
placeholder: string, | |
value: string, | |
onChangeText: () => void, | |
errors: string, | |
password: boolean |
NewerOlder