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
# When processing Sequence Tagging problems, | |
# An accuracy func which is too strict is not convergence-friendly. | |
# This Func is the solution of a naive leetcode problem LCS (Largest Common Subsequence), | |
# Original All-Correct-Or-Nothing accuracy function takes 7x times long to achieve certain accuracy. | |
def LCS(p,l): | |
if len(p)==0: | |
return 0 | |
P = np.array(list(p)).reshape((1,len(p))) | |
L = np.array(list(l)).reshape((len(l),1)) |
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 | |
import pandas as pd | |
import numpy.random as nr | |
# Read In | |
DF = pd.read_csv('train.csv',sep=',',header=0) | |
for i in xrange(28): | |
DF[str(i)] = DF['Target'].map(lambda x: int(str(i) in x.split(' '))) | |
value_counts = DF.ix[:,2:].apply(np.sum, axis=0) |
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 | |
import pandas as pd | |
import bottleneck as bn | |
# Read And Count | |
trainDF = pd.read_csv('train.csv',sep=',',header=0) | |
lenTrain = len(trainDF) | |
valDF = pd.read_csv('submission.csv',sep=',',header=0) | |
lenVal = len(valDF) | |
trainFold = pd.read_csv('train_5fold_20181219.csv',sep=',',header=0) |
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
```mermaid | |
flowchart | |
A("是真的吗") --> |"SERP i.e. Perplexity"| B["是什么"] | |
A --> |"Deep (re)Search i.e. ODR/Grok3"| C("为什么") | |
A -->|"科学观 i.e. 卡尔-波普尔"| D("如何重现或证伪") | |
B --> |"专家网络 i.e. 微信/LinkedIn"| B1("行业专家觉得是什么") | |
C --> |"Think i.e. R1"| C1("逻辑观点") | |
C --> |"Multi Agent i.e. MGX/Camel"| C2("博弈观点") | |
D --> |"直觉"| D1("重现解构") | |
D --> |"Deep (re)Search i.e. ODR/Grok3"| D2("反例") |