Example inputs:
Variable | Value |
---|---|
key | the shared secret key here |
message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
const str1 = 'This is an example to test cosine similarity between two strings'; | |
const str2 = 'This example is testing cosine similatiry for given two strings'; | |
// | |
// Preprocess strings and combine words to a unique collection | |
// | |
const str1Words = str1.trim().split(' ').map(omitPunctuations).map(toLowercase); | |
const str2Words = str2.trim().split(' ').map(omitPunctuations).map(toLowercase); | |
const allWordsUnique = Array.from(new Set(str1Words.concat(str2Words))); |
Example inputs:
Variable | Value |
---|---|
key | the shared secret key here |
message | the message to hash here |
Reference outputs for example inputs above:
| Type | Hash |
from __future__ import division | |
import json | |
import lightgbm as lgb | |
import pandas as pd | |
import numpy as np | |
from sklearn.metrics import mean_squared_error | |
from sklearn.linear_model import LogisticRegression | |
# load or create your dataset | |
print('Load data...') |
from sklearn.model_selection import cross_val_score | |
cross_val_score(model, X, y=None, scoring=None, cv=None, n_jobs=1) | |
"""参数 | |
--- | |
model:拟合数据的模型 | |
cv : k-fold | |
scoring: 打分参数-‘accuracy’、‘f1’、‘precision’、‘recall’ 、‘roc_auc’、'neg_log_loss'等等 | |
""" | |
# 检验曲线 |
from sklearn.preprocessing import StandardScaler | |
#标准化,返回值为标准化后的数据 | |
StandardScaler().fit_transform(iris.data) | |
from sklearn.preprocessing import MinMaxScaler | |
#区间缩放,返回值为缩放到[0, 1]区间的数据 | |
MinMaxScaler().fit_transform(iris.data) | |
from sklearn.preprocessing import Normalizer | |
#归一化,返回值为归一化后的数据 |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
// 读取文件 文件每一行是空格分隔开的图片像素值 每行1000个值 | |
int main() | |
{ | |
ifstream infile_feat(loadFeatList); //加载数据文件路径,获取到流对象infile_feat |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
//must be a power of two so when B fit this: A % B == A &(B - 1) | |
#define RING_SIZE (32U) | |
#define RING_MASK (RING_SIZE - 1) | |
//将普通索引转换成ring_buf的索引 |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int getIndex(char *tp, char ch) { | |
if (tp == NULL || !ch) | |
return -1; | |
int tp_len = strlen(tp); | |
for (int i = 0; i < tp_len; i++) { | |
if (ch == tp[i]) { |