kind of big changes here: we can now inspect & see the most positive and negative words for a trained svm, to help tune the value C. then there is also the UI for setting value C in the SVM. Finally the value of C I adjusted to default to 0.01 (was 0.1 before) because the results and the weights look more sensible based on manual inspection. We need some dataset of people libraries in order to potentially cross-validate a good value C automatically. For now there are not enough active users of the site that such a thing could be attempted and succeed. Doing my best now just by eyeballing

This commit is contained in:
Andrej Karpathy
2021-12-08 00:17:37 -08:00
parent 6be574a0fe
commit 33b2b018ab
7 changed files with 99 additions and 40 deletions
+30
View File
@@ -0,0 +1,30 @@
'use strict';
const Word = props => {
const p = props.word;
// word, weight, idf
return (
<div class='rel_word'>
<div class='rel_word_weight'>{p.weight.toFixed(2)}</div>
{/* <div class='rel_word_idf'>{p.idf.toFixed(2)}</div> */}
<div class="rel_word_txt">{p.word}</div>
</div>
)
}
const WordList = props => {
const lst = props.words;
const words_desc = props.words_desc;
const wlst = lst.map((jword, ix) => <Word key={ix} word={jword} />);
return (
<div>
<div>{words_desc}</div>
<div id="wordList" class="rel_words">
{wlst}
</div>
</div>
)
}
ReactDOM.render(<WordList words={words} words_desc={words_desc} />,
document.getElementById('wordwrap'));