Questions tagged [evaluation]

Anything related to evaluation of expressions, i.e. the process used to determine the value of expressions in a running program.

What is it?

Evaluation is about rules, algorithms and strategies used for the evaluation of expressions or the computation of evaluation functions.

Related tags

  • The tag may be used more specifically for the execution or invocation of evaluations.
  • For more specific questions use tags such as for example

See also:

1334 questions
5
votes
3 answers

Using a list of symbols in data.table's 'by'

I want to write a function outer_fun(), which does some things and also calls another function inner_fun(). All arguments from outer_fun() are passed to inner_fun(). inner_fun() does some calculations on a data.table (which is an argument to both…
der_grund
  • 1,898
  • 20
  • 36
5
votes
2 answers

Early stopping with Pycaret? Overfitting with Catboost and XGBoost

I'm comparing the performance of Catboost, XGBoost and LinearRegression in Pycaret. Catboost and XGBoost are untuned. So far I see that Catboost and XGBoost are overfitting. For linear regression train/test-score is train R2: 0.72, test R2: 0.65 Is…
Tldr
  • 177
  • 1
  • 11
5
votes
1 answer

How can I use dplyr across() programmatically on no variables?

Issue: I want to use across() programmatically so that if, e.g. NULL or an empty string is passed to it, the function won't fail. This is possibly using scoped variants of functions such as group_by_at(), but I'd like to make it work neatly (i.e.…
wurli
  • 2,314
  • 10
  • 17
5
votes
0 answers

Evaluate JavaScript AST directly

I maintain doctest. The library uses an ECMAScript parser (Esprima) to extract comments from a JavaScript source file, then identifies “doctests” within these comments. For example: 'use strict'; // identity :: a -> a // // > identity (42) // …
davidchambers
  • 23,918
  • 16
  • 76
  • 105
5
votes
3 answers

How to evaluate the code provided by user?

I need to process some user-provided code on the server using PHP. The code is about to cover some very basic programming capabilities, for example: variables, literals, (preferably) functions, and some associated operations. An option is to use the…
user13324009
5
votes
1 answer

Normalizing functions without actually applying it in Haskell

I would like to evaluate a function to its normal form without applying it, for example, \n -> n + sum [1..100] should be evaluated to \n -> n + 5050 But there's no NFData instance for functions, which is reasonable since we cannot obtain the…
Poscat
  • 565
  • 3
  • 15
5
votes
1 answer

How to evaluate unsupervised anomaly detection

I am trying to solve a regression problem by predicting a continuous value using machine learning. I have a dataset which composed of 6 float columns. The data come from low price sensors, this explain that very likely we will have values that can…
5
votes
1 answer

How to calculate the accuracy for multilabel classification with tf.metrics?

I want to train multilabel classification model with tensorflow (tf.estimator.Estimator). I need to output the accuracy when do evaluating. But it seem not work with the following code: accuracy = tf.metrics.accuracy(labels=labels,…
tidy
  • 4,747
  • 9
  • 49
  • 89
5
votes
2 answers

Partial evaluation/specialization with LLVM-gcc or gcc

I am interestent in (partial) compile-time evaluation for c/c++ (not with template parameters like in c++). Lets consider the following case (taken from [1]): double mypower(double x, int n) { int i; double ret = x; for (i = 1; i < n; i++) { …
Niggler88
  • 51
  • 2
5
votes
2 answers

simulate Lazy in Java8

I wrote the following code to simulate Lazy in Java: import java.util.function.Supplier; public class Main { @FunctionalInterface interface Lazy extends Supplier { Supplier init(); public default T get() {…
5
votes
4 answers

Why 3 +++ 5 works in Python

In [476]: 3 + 5 Out[476]: 8 In [477]: 3 +++++++++++++++++++++ 5 Out[477]: 8 In [478]: 3 + + + + + + + + + + + 5 Out[478]: 8 In [479]: 3 +++ --- +++ --- +++ 5 Out[479]: 8 Why there is no SyntaxError: invalid syntax or TypeError: bad operand type…
Leo Howell
  • 71
  • 6
5
votes
1 answer

Why does (list 'quote 'x) evaluate to 'x and not ('x) or (quote 'x)?

I'm trying to learn LISP and was going through a code example where something similar to the following code is used: (list 'quote 5) This evaluates to '5 in the REPL. I expected it to evaluate to ('5) or (quote 5) I'm trying this out in the CLISP…
levrach
  • 53
  • 4
5
votes
3 answers

What is the C++ way of handling a framework to call functions of different types from a script?

I have tried different approaches and asked several specific questions regarding sub-problems of my requirement here. But my solution doesn't really work as expected, so I am taking a step back and ask here from a more general perspective. Please…
Matthias
  • 9,817
  • 14
  • 66
  • 125
5
votes
1 answer

C++ Expression Evaluation: What Happens "Under The Hood"?

I'm still learning C++. I'm trying to understand how evaluation is carried out, in a rather step-by-step fashion. So using this simple example, an expression statement: int x = 8 * 5 - 5; This is what I believe happens. Please tell me how far off…
5
votes
2 answers

In R, exactly what causes an object of type name (or symbol) to be evaluated?

After running: x <- as.name("aa") aa <- 2 in R, why doesn't (x) return 2? And why doesn't x <- as.name("aa") aa <- 3 get(get(x)) return 3? I know get() expects a string, but I don't understand why it doesn't evaluate x, find the string…
andrewH
  • 2,281
  • 2
  • 22
  • 32