Categories
Mastering Development

python function missing 2 required positional arguments: ln1, ln2

def di(l1,l2, ln1, ln2): dlt = (l2-l1) dln = (ln2-ln1) d = dlt * dln return d abc = newdf[[‘l1′,’l2′,’ln1′,’ln2’]] abc.columns Function working without errors. But while working on dataframe, it showing error as di() missing 2 required positional arguments: ln1, ln2 newdf = newdf.withColumn(‘newcolnm’,reduce(di, ( newdf[col] for col in abc.columns ) ))

Categories
Development

How to manipulate the faces of a Rubiks Cube represented by a 2D array to perform face rotations

I am creating a project in C# that solves Rubiks Cubes. It will take the current state of the Rubiks Cube in as an input, and output a series of moves to perform to solve the cube using the designated notation. The Cube is represented by an array of 6 string arrays of length 9: […]

Categories
Development

Variadic template error: ‘In instantiation of’ (gcc 9.2)

I’m learning about variadic template on c++17 on the Jason Turner’s youtube channel then I copy his example code (shown below). In his video he uses the site godbolt.org with the gcc 7. #include <utility> template<typename … B> struct Merged : B … { template<typename … T> Merged(T&& … t) : B(std::forward<T>(t))… {} using B::operator()…; […]

Categories
Development

LNK2001 Unresolved external symbol “public: virtual void …” in C++ Interface class

I have tried using pure virtual methods along with testing others answers on similar issues, but everything has continued to result in the same problem. So I have this class Shape that acts as an interface declaring the virtual void Draw() method. This function is later overridden in three other classes for primitive shapes, and […]

Categories
Artificial Intelligence (AI) Development

Tensorflow neural network – inherent overfitting in certain X and Y distributions?

Really open ended question here… I’m working on a classifier model that is used to predict whether some amount is > x, < -x or >= -x and =< x. I recently added some additional input features that greatly improved the model’s performance when evaluating the training set but only made the results on the […]

Categories
Development

JOOL tree structure

I have a collection of documents: List listDocs. The document has the structure of the form: id, level, aoguid, parentguid, formalname, currstatus . This structure allows you to create a tree structure of addresses. That is: a country – level 1, a city – level 2, a street – level 3, and so on up […]

Categories
Development

in F#, is there a way to scan several arrays at the same time and also access the previous element from one of the array?

I am trying to replicate the following python code: a = (list1 != 0) & (list3.shift() < list2) & (list3 >= list2) so what I need is a function that does something like this pseudo code: (list1, list2, list3) |||> Array.?? (fun l1, l2, l3, l3previous -> l1 <> 0 && l3previous < l2 && […]

Categories
Artificial Intelligence (AI) Development

Neural nets not learning mnist dataset

I tried training a 2 hidden layer network using the mnist dataset, but I am not getting any results. I have tried tuning the learning rate(tried 0.1 and 0.0001) and the number of epochs(tried 10 and 50). I even changed the size of hidden layer from 10 to 250. First i had initialized the weights […]

Categories
Development

Prolog- what causes the out of local stack error in this case?

I have a very simple program where a relation is defined between an AVL tree and a list of elements. I get correct results but after some semicolons I will receive an out of memory error, even for small inputs. The code is not perfect as I am just trying at first to get to […]

Categories
Development

Prolog- what causes the out of local stack error in this case?

I have a very simple program where a relation is defined between an AVL tree and a list of elements. I get correct results but after some semicolons I will receive an out of memory error, even for small inputs. The code is not perfect as I am just trying at first to get to […]