laptop commit linear regression
This commit is contained in:
parent
5df01c9b41
commit
f01edb9559
@ -53,7 +53,7 @@ def read_words(input_path):
|
|||||||
return vocabulary
|
return vocabulary
|
||||||
|
|
||||||
def train(vocabulary,input_train,expected_train):
|
def train(vocabulary,input_train,expected_train):
|
||||||
learning_rate=0.000001
|
learning_rate=0.00001
|
||||||
#learning_precision=0.0000001
|
#learning_precision=0.0000001
|
||||||
words_vocabulary={}
|
words_vocabulary={}
|
||||||
with open(input_train,encoding='utf-8') as input_file, open(expected_train,encoding='utf-8') as expected_file:
|
with open(input_train,encoding='utf-8') as input_file, open(expected_train,encoding='utf-8') as expected_file:
|
||||||
@ -65,7 +65,7 @@ def train(vocabulary,input_train,expected_train):
|
|||||||
iteration=0
|
iteration=0
|
||||||
loss_sum=0.0
|
loss_sum=0.0
|
||||||
error=10.0
|
error=10.0
|
||||||
max_iteration=len(vocabulary) + 1000
|
max_iteration=len(vocabulary) + 1000
|
||||||
for i in vocabulary['count'].keys():
|
for i in vocabulary['count'].keys():
|
||||||
weights[i]=random.uniform(-0.01,0.01)
|
weights[i]=random.uniform(-0.01,0.01)
|
||||||
# delta>learning_precision and
|
# delta>learning_precision and
|
||||||
|
2258
dev-0/out.tsv
2258
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
2128
test-A/out.tsv
2128
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user