evaluation

Does anyone know how to generate AUC/Roc Area based on the predition?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 17:21:33
I know the AUC/ROC area ( http://weka.wikispaces.com/Area+under+the+curve ) in weka is based on the e Mann Whitney statistic ( http://en.wikipedia.org/wiki/Mann-Whitney_U ) But my doubt is, if I've got 10 labeled instances (Y or N, binary target attribute), by applying an algorithm (i.e. J48) onto the dataset, then there are 10 predicted labels on these 10 instances. Then what exactly should I use to calculate the AUC_Y, AUC_N, and AUC_Avg? Use the prediction's ranked label Y and N or the actual label (Y' and N')? Or I need to calculate the TP rate and FP rate? Can anyone give me a small

Evaluating Expression at Runtime

强颜欢笑 提交于 2019-12-04 11:18:46
I have a C# Console Application project. I have a logical expression that is stored in database as nvarchar. For example, the stored expression is: ((34 > 0) || (US == ES)) && (4312 = 5691) While my application running, I want to retrieve the expression and evaluate it so that the result will be true or false. How can I do it at runtime? Here's a rather unusual solution, involving JScript: Create a JScript class with the following code: public class JsMath { public static function Eval(expression:String) : Object { return eval(expression); } } Compile it into a DLL: jsc /target:library /out

Deferred evaluation in python

不打扰是莪最后的温柔 提交于 2019-12-04 11:09:16
问题 I have heard of deferred evaluation in python (for example here), is it just referring to how lambdas are evaluated by the interpreter only when they are used? Or is this the proper term for describing how, due to python's dynamic design, it will not catch many errors until runtime? Or am I missing something entirely? 回答1: Dietrich's answer is a good one, but I just want to add that the simplest form of deferred evaluation is the if statement: if True: x = 5 else: x = y # huh? what is y? This

When is my Haskell expression evaluated?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 07:59:42
If I define λ> data Bar = Bar Int deriving Show λ> data Foo = Foo Bar deriving Show and λ> let foo = trace "foo" Foo (trace "bar" Bar 100) λ> let two = trace "two" 2 λ> let g (Foo x) y = y then I think I understand why I get λ> g foo two foo two 2 But if I then repeat this, I get λ> g foo two two 2 and I don't understand why foo appears not to have been evaluated for the second invocation of g , especially since it is clearly not (yet) somehow already available, as I can verify with λ> foo Foo bar (Bar 100) though — again, to my confusion — repeating the previous gives λ> foo Foo (Bar 100) Why

C++ Beginner Infinite Loop When Input Wrong Data Type and Help Evaluate My Code

拥有回忆 提交于 2019-12-04 05:05:45
问题 I have an assignment to create a menu-based program to calculate area of several shapes using user-defined function. My code creates an infinite loop when a user input a char instead of a number. What should I do? Also, I would like if someone could evaluate my code, Is there anything I should change or modify? I'm still new to C++. Input: 1. a 2. j #include <iostream> #include <cmath> using namespace std; float Circle(double r1); float Rectangle(double length, double width); float Triangle

Resolving symbols in a Common Lisp list

大兔子大兔子 提交于 2019-12-04 04:23:50
问题 Suppose I have a function CL-USER> (defun trimmer (seq) "This trims seq and returns a list" (cdr (butlast seq))) TRIMMER CL-USER> (trimmer '(1 2 3 VAR1 VAR2)) (2 3 VAR1) CL-USER> Notice how, due to QUOTE, VAR1 and VAR2 are not resolved. Suppose I want to resolve the symbols VAR1 and VAR2 to their values - is there a standard function to do this? 回答1: Do not use quote to create a list with variables; use list instead: CL-USER> (trimmer (list 1 2 3 var1 var2)) (2 3 value-of-var1) (where value

Evaluating MongoDB-like JSON Queries in PHP

坚强是说给别人听的谎言 提交于 2019-12-04 00:40:16
问题 Consider the following (rather complicated) query expressed in this JSON object: { "name": "Kindle Fire", "sale": true, "price": { "$gt": 199, "$lt": 264 }, "price.vat": { // bogus, just to show $a['price.vat'] == $a['price']['vat'] "$lte": 1.2 }, "$or": { "qty": { "$gt": 30 }, "eta": { "$or": { "$lt": 3, "$gt": 30 } } }, "countriesAvailable": { "$in": [ "US", "CA" ] } } Objective I want to parse that JSON so that it evaluates to the PHP equivalent of (where $a is my target data): $a['name']

In R, evaluate expressions within vector of strings

偶尔善良 提交于 2019-12-03 19:36:43
问题 I wish to evaluate a vector of strings containing arithmetic expressions -- "1+2", "5*6", etc. I know that I can parse a single string into an expression and then evaluate it as in eval(parse(text="1+2")) . However, I would prefer to evaluate the vector without using a for loop. foo <- c("1+2","3+4","5*6","7/8") # I want to evaluate this and return c(3,7,30,0.875) eval(parse(text=foo[1])) # correctly returns 3, so how do I vectorize the evaluation? eval(sapply(foo, function(x) parse(text=x)))

Printing out Haskell's evaluation (rewriting) steps for educational/learning purposes. Is it possible?

梦想的初衷 提交于 2019-12-03 15:11:27
问题 I describe this question by using an example from a book. In Simon Thompson's book "HASKELL the craft of functional programming" on page 82 (see images below) are shown the evaluation steps for fac 4 . QUESTION: Is it possible to use some tool or some "Haskell debugger" that would write out the evaluation steps that GHCi uses when it would evaluate the value of fac 4 ? Preferably in a human readable format, for educational and learning purposes. It would be also good to have some automatic

Cluster quality measures

不想你离开。 提交于 2019-12-03 14:36:28
Does Matlab provide any facility for evaluating clustering methods? (cluster compactness and cluster separation. ....) Or is there any toolbox for it? Not in Matlab, but ELKI (Java) provides a dozen or so cluster quality measures for evaluation. Matlab provides Silhouette index and there is a toolbox CVAP: Cluster Validity Analysis Platform for Matlab. Which includes following validity indexes: Davies-Bouldin Calinski-Harabasz Dunn index R-squared index Hubert-Levin (C-index) Krzanowski-Lai index Hartigan index Root-mean-square standard deviation (RMSSTD) index Semi-partial R-squared (SPR)