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.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 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 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 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. | |
""" |