Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Function names in Python should be in snake_case.
Python :
Python fixed tests could additionally cover this pattern:
())(
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Seems to be a duplicate of the Valid Parentheses kata:
http://www.codewars.com/kata/valid-parentheses
This comment is hidden because it contains spoiler information about the solution
What is
row_index
parameter totfidf()
? It's never explained.Pre-set Python code for this kata is ambiguous. The meaning of
corpus_doc_dicts
parameter tocreate_term_dict_for_corpus
is unclear, and why this method should return a tuple is unclear also.From the kata description it seems logical that the method should return an overall frequency statistic for all documents in corpus, combined together. If that's not so, additional description details would help.
I'm having difficulty following this kata.
The documentation in the code doesn't match with the supplied test case, and no matter what I do I can't get the correct answer.
Is the
create_term_dict_for_corpus(corpus)
method meant to return a tuple([{term:frequency count} * len(corpus)], {term:presence in corpus docs count})
?And based on the usual way of calculating TFIDF, isn't the pre-log denominator '+1'ed so that log(0) never occurs?
Assuming that both of these are true, I get
0.458145365937
but according to the test it should be0.464385618977