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
""" | |
A drop-in extension of Python’s built-in datetime that adds: | |
Timezone awareness & conversions | |
Auto-localization, to_utc(), to_local(), to_timezone() | |
Human-friendly arithmetic | |
Add/subtract timedelta, seconds, dict-style offsets | |
Business-day support |
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
class SmartDateTimeMixin: | |
""" | |
Mixin providing additional datetime functionality: | |
arithmetic operations, timezone conversions, business day calculations, | |
human-readable diffs, and common utilities. | |
""" | |
str_format: str = "%Y-%m-%d %H:%M:%S" | |
default_tz = get_localzone() | |
def _make_tz_aware(self, dt: datetime) -> datetime: |
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
from sklearn.linear_model import LogisticRegression | |
from sklearn.neighbors import KNeighborsClassifier | |
from sklearn.model_selection import StratifiedKFold, cross_validate | |
from sklearn.ensemble import VotingClassifier | |
import pandas as pd | |
from IPython.display import display | |
def cross_validation(estimator, model_name, X, y, n_splits=5, random_state=None): | |
# definir metricas aqui (Se for métrica personalizada deverá utilizar `make_score`. Consultar docs do sklearn) |
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
#include <iostream> | |
#include <chrono> | |
#include <cmath> | |
using namespace std; | |
using namespace std::chrono; | |
string func1(const string &nome) { | |
int someVar = 1; | |
for (int i = 0; i < 1e7; i++) { |
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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <cstdlib> | |
#include <chrono> | |
using namespace std; | |
using namespace std::chrono; | |
int tamanhoArquivo(fstream& arq) |
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 compute_log_loss(predicted, actual, eps=1e-14): | |
""" Computes the logarithmic loss between predicted and | |
actual when these are 1D arrays. | |
:param predicted: The predicted probabilities as floats between 0-1 | |
:param actual: The actual binary labels. Either 0 or 1. | |
:param eps (optional): log(0) is inf, so we need to offset our | |
predicted values slightly by eps from 0 or 1. | |
""" |