run following code with
d8 --trace-ic --allow-natives-syntax --trace-maps index.js
const N = 100000;
class Component {
run following code with
d8 --trace-ic --allow-natives-syntax --trace-maps index.js
const N = 100000;
class Component {
const startT1 = Date.now(); | |
const N = 10000; | |
let f = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Gandalf', b: 'The Grey' }; | |
let f2 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Jack', b: 'Sparrow' }; | |
let f3 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Charles', b: 'Xavier' }; | |
let f4 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Frodo', b: 'Baggins' }; | |
let f5 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Legolas', b: 'Thranduilion' }; | |
let f6 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Indiana', b: 'Jones' }; |
eval(` | |
const startT1 = Date.now(); | |
const N = 10000; | |
let f = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Gandalf', b: 'The Grey' }; | |
let f2 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Jack', b: 'Sparrow' }; | |
let f3 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Charles', b: 'Xavier' }; | |
let f4 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Frodo', b: 'Baggins' }; | |
let f5 = { tmp: 3, tmp2: 3, tmp3: 3, tmp4: 3, tmp5: 3, a: 'Legolas', b: 'Thranduilion' }; |
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+ |
LABEL_COLUMN = 'total_cases' | |
NUMERIC_COLUMNS = ['year', | |
'weekofyear', | |
'ndvi_ne', | |
'ndvi_nw', | |
'ndvi_se', | |
'ndvi_sw', | |
'precipitation_amt_mm', | |
'reanalysis_air_temp_k', | |
'reanalysis_avg_temp_k', |
import pandas as pd | |
from sklearn.preprocessing import StandardScaler, MinMaxScaler | |
from data_info import cols_to_norm, cols_to_scale | |
def preproc_data(data, norm_cols=cols_to_norm, scale_cols=cols_to_scale, train_scale=None): | |
""" | |
:param data: Dataframe | |
:param norm_cols: List<string> | |
:param scale_cols: List<string> | |
:param train_scale: Dataframe | |
:return: Tuple(Dataframe, Dataframe) |
if norm_cols: | |
# Normalize temp and percipation | |
new_data[norm_cols] = StandardScaler().fit(train_scale[norm_cols]).transform(new_data[norm_cols]) |
if scale_cols: | |
# Scale year and week no but within (0,1) | |
new_data[scale_cols] = MinMaxScaler(feature_range=(0, 1)).fit(train_scale[scale_cols]).transform( | |
new_data[scale_cols]) |
unnormalized_train_data = extract_data(path_to_train_file) | |
normalized_train_data, train_scale = preproc_data(unnormalized_train_data, norm_cols, scale_cols) | |
// Create and train model | |
unnormalized_test_data = extract_data(path_to_test_file) | |
normalized_test_data, _ = preproc_data(unnormalized_test_data, norm_cols, scale_cols, train_scale) |
def plot_confusion_matrix(cm, class_names=class_names): | |
""" | |
Returns a matplotlib figure containing the plotted confusion matrix. | |
Args: | |
cm (array, shape = [n, n]): a confusion matrix of integer classes | |
class_names (array, shape = [n]): String names of the integer classes | |
""" | |
figure = plt.figure(figsize=(8, 8)) | |
plt.imshow(cm, interpolation='nearest', cmap=plt.cm.Blues) |