How to assign different points per answer in Google Forms - google-apps-script

I have created an assessment using google forms. I have a few questions which there is no wrong answer. For example, Question 1 has options A, B, and C. The user can pick any option and still be right. However, I want to assign a different point value for each option. So picking A would give them 1 point, B 2 points, and C 3 points. Is there a way to do that using Forms? When assigning points in the answer key, it looks like I can only assign 1 point value that is used for options A, B, and C.

You could definitely do that with Forms + apps script. But it would be difficult to do with forms alone unless you're using lots of plug-ins.
You could code a scoring system depending on the formResponse and email the results or store them in a sheet.

Related

Is it possible to use topic modeling for a single document

Is it rational to use topic modelling for a single document or to be more precise is it mathematically okay to use LDA-gibbs method for a single document.If so what should be value of k and seed.
Also what is be the role of k and seed for single as well as large set of documents.
K and SEED are variable of the function LDA (in r studio).
Also let me know if I am wrong anywhere in this question.
To tell about my project ,I am trying to find out the main topics which can be used to represent the content of a single document.
I have already tried using k=4,7,10.Part of my question also is what value of k should be better.
It really depends on the document. A document could be a 700 page book or a single sentence. Your k is also going to be dependent on the document I think you mean the number of topics? If your document is the entire Wikipedia corpus 1500 topics might be appropriate if your document is a list of comments about movies then 20 topics might be appropriate. Optimizing that number can be done using the elbow method check out 17.
Seed can be pretty random it's just a leaver so your results can be replicated - it runs if you leave it blank. I would say try it and check your coherence, eyeball your topics and if it looks right then sure you can train an LDA on one document. A single document should process pretty fast.
Here is an example in python of using seed parameters. My data set is 1,048,575 rows note the seed is much higher:
ldamallet = gensim.models.wrappers.LdaMallet(mallet_path, corpus=bow_corpus,
num_topics=20, alpha =.1, id2word=dictionary, iterations = 1000,
random_seed = 569356958)

Searching RL algorithm for specific problem

I have an agent which should react to different inputs I give it. Let 'A->B' stand for the agent's reaction B to an input A.
I want my agent to learn to react differently depending on the history of inputs.
For example, let each 'episode' consists of: 1. Me giving an input. 2. Agent reacting. 3. Me giving another input. 4. Agent Reacting. 5. End of episode.
If there are two possible inputs i1 and i2, and two possible actions a1 and a2, I want my agent to react as follows in all possible episodes (values not so important):
i1->a2, i1->a1; i1->a2, i2->a1; i2->a2, i1->a2; i2->a2, i2->a1;
i.e. I want my agent to react differently to an input in the second step depending on the inputs of both the first and second step.
Question: What would be an appropriate RL algorithm to learn this? In the beginning I wanted to use Q-Learning, but the problem is that my state transitions do not depend on the agent's action. I.e. if it reacts with a1 to i1, the agent doesn't at that point know whether the next 'state' will be i1 or i2.
Help would be greatly appreciated.

In what situation do we use ATTR Function in Tableau?

As the title, why and in what situation do we use ATTR Function in Tableau?
i understand what it is, and its simplest form.
thank you guys.
I know you say you understand what it is in its simplest form, but just for folks who stumble upon this question, I'd also offer this blog post, which gives an example and a "plain English" break-down of this Tableau Knowledge Base article "When to Use the Attribute (ATTR) Function". This same article is also linked to in this older SO question of a similar vein.
In a phrase from the blog post:
It returns a value if it is unique, else it returns *
As another example, this thread discusses ATTR in the context of calculating an average where date is less than the value from another data source.
The typical case is for a tooltip where most of the time there is only one value for a field among all the data rows at the level of detail of the viz, but there are a few exceptions. In that case, you may not want to create new marks by treating the field as a dimension, which would increase the level of detail of the viz. This is so common that Tableau automatically uses ATTR() when you put dimensions on the tooltip shelf.
Other cases are when you are putting a dimension on the detail or row shelves, and want to "debug" the level of detail of your viz. Say, you expect that using A, B, and C as dimensions will cause each mark to have the same value for D. You can use ATTR(D) to concisely show which combinations of A, B, C differ from your expectation.
ATTR is also useful with calculated fields in some cases, say in a IF condition when defining an aggregate calc.

AS3 function producing combinations of array, no duplicates

This sounds like a duplicate question, as there are several questions similar to this, but they don't specifically ask this (or I just haven't found it! :) )
I have an array, this one has two distinct elements, "a" and "b", and a length of four total elements:
var list:Array = ["a","a","b","b"];
I'm looking for all combinations, using all elements, no duplicates.
This should yield:
aabb
abab
abba
bbaa
baba
baab
Searching for a solution for this has given me results similar to these:
a,b,ab,ba,aab,abb,aba, etc
or
a a b b, a a b b, a a b b, etc
Mind you, the application that would ultimately use this function would have two distinct elements, "a" and "b", and a length of 50 total elements:
var list:Array = ["a","a","a","a","a","a","a","a","a","a",
"a","a","a","a","a","a","a","a","a","a",
"a","a","a","a","a",
"b","b","b","b","b","b","b","b","b","b",
"b","b","b","b","b","b","b","b","b","b",
"b","b","b","b","b"]
...so a brute force solution like I used with aabb wouldn't be feasible.
Any help, especially using AS3 code, would be appreciated, even if it is simply pointing me to the right google search :)
Here is a JavaScript answer that might get you started: Permutations in JavaScript? (they're both EcmaScript implementations so converting to ActionScript should only require minor changes)
It doesn't handle the uniqueness requirement, but it might point you in the right direction.
However, there are a few things you might need to consider first. I don't think it will be feasible to pre-compute all unique permutations upfront.
Based on this answer about unique permutations it looks like there are 50! / 25! * 25! = 126,410,606,437,752 unique permutations for 25 a's and 25 b's.
To give an idea how large that number is: if each combination was 1 byte in memory (in practice it will be more than this) then that would be: 126410606437752 bytes = 126,410.6 gigabytes in memory.
Plus, the algorithm for generating the permutations has complexity O(n!) - so it might take far too long, separate to memory constraints, to generate the list of permutations.

How to replicate only the intersection of certain channels in Couchbase Mobile

I have four channels in my application: A, B, C, D. Some application users are only interested in documents contained in both channels A and B only. Also can be expressed as: A ∩ B. Others may be interested in a different combination like: A ∩ B ∩ D.
UPDATE
I don't think the following will work anyway
What has been suggested so far is that I can create a new channel (like A_B and A_B_D) for each combination and then tag the documents that meet the intersection criteria accordingly. But you can see how this could easily get out of hand since with just 4 channels, you end up with 15 combinations (11 extra channels).
Is there a way to do this with channels or perhaps some other feature I have missed in Couchbase?
The assignment of channels to a document is done via the sync function. So a document is not "contained" in a channel, but it may have attributes from which the channels to which it is routed can be derived. Only in the simplest default case, the document's channel attribute will route it to the channel having that value of that attribute.
So what you intend can be achieved by putting statements like
if (doc.areas.includes("A") && doc.areas.includes("B") {
channel("AB");
}
into the sync function. (I renamed the channels attribute to areas to make clear to the reader of the program that these are not the actual channels, but that channels are only derived from combinations of them.)