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
""" | |
Stratified K-Fold implementation | |
""" | |
def stratified_k_fold(arr, k=None, class_ratio=.5): | |
if k == None: | |
return None | |
number_elements_fold = len(arr) // k | |
folds = [[]] * k |
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 time | |
import random | |
comparison_num = 0 | |
class Quick(object): | |
def particao(self, a, ini, fim): | |
global comparison_num | |
comparison_num += 1 | |
pivo = a[fim-1] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 inspect import signature | |
def get_params_len(fn): return len(signature(fn).parameters) | |
def curry(fn): | |
fn_params_len = get_params_len(fn) | |
temp_params = [] |
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 <vector> | |
using namespace std; | |
vector<int> numbers; | |
typedef struct node { | |
struct node *left; | |
struct node *rigth; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
public class Main { | |
public static void main(String[] args){ | |
Process processo1 = new Process("Processo1"); | |
Process processo2 = processo1.fork("Processo2"); | |
System.out.println("Processo 1 UID: " + processo1.getOwner()); | |
System.out.println("Processo 2 UID: " + processo2.getOwner()); | |
System.out.println("Data de criação do Processo 1: " + processo1.getCreationDateTime()); | |
System.out.println("Data de criação do Processo 2: " + processo1.getCreationDateTime()); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 tensorflow as tf | |
import numpy as np | |
X_train, X_test = np.load('X_train.npy'), np.load('X_test.npy') | |
Y_train, Y_test = np.load('Y_train.npy'), np.load('Y_test.npy') | |
Y_train, Y_test = tf.keras.utils.to_categorical(Y_train, num_classes=4), tf.keras.utils.to_categorical(Y_test, num_classes=4) | |
features_num = len(X_train[0]) | |
l1 = 50 |