See also questions close to this topic

I've some trouble understanding how the GridsearchCV really works, in combination with a self defined transformator.

What I want to achieve?
I want to implement a Transformer/Estimator, which allows switching between some methods depending on a parameter, because I want to include these different methods inside the gridsearch.

Example: I have a self defined Transformer called Scaler(), which either chooses MinMaxScaler or StandardScaler. (just for simplicity)

I have set cv=2. I would expect it like this.
1. Instatiate all the Transformers
2. set the parameters according the the Gridsearch
3. pass the train-fold through the pipline
4. pass the test-fold through the pipline
5. repeat
So I would have expect 8 calls to the tranformer method because we need one for the train and one for the test fold. Because of cv=2 we do this 2 times and because we are defining two different values for feature_range inside the paramgrid, we have to multiply it with 2, therefore 8. Whats wrong?

But why are there so many calls of my Scaling class?
How can this order of logs be explained?
Why is the fully sequence at the end transformed?

I for some reason can not manage to find a reasonable way to rescale the plot color to the current camera setting through the python api.
Is there any way where i can just get a vtkDoubleArray of the currently viewed data from which i can call GetRange() to update my DataMapper?
A simplified version of my current code looks something like this:

I am using python3 and I have a time data format like '01-FEB-17' and I need to parse it with datetime.strptime. Does anyone know which format is the correct for this? I tried '%d-%b-%Y', '%d-%m-%Y',... and none of them worked.

And i have a problem with list AllIngredients. I pasted here all method for better understanding my problem. I have in database a table with ingredients for drinks. My methods divide them by string Type (Alcohol, Juice or Addition). First method don't use list AllIngredients yet, because there are only Alcohols. In second method user can choose on checklist juices (of course also alcohols on first and additions on third method). Later list of alcohols and list of juices are going to AllIngredients[0] and AllIngredients[1]. This is list of lists. Third method works similarly: user choose additions, list is going to AllIngredients[2]. On views every elements are forwarded by hidden inputs, so I have all previous data in every method. And here I have problem: when I entered to FinalDrinks (fourth method) in AllIngredients[1] I always have "Cola"! Whatever I choose (I have in database three juices: cola, orange juice and water), always in FinalDrinks I have a cola (cola id = 2). When I choose two or three drinks, cola is always first. Even if I choose orange juice and water, I have cola and orange juice.

I checked it by breakpoints, the problem is in the end of third method. I set two breakpoints: one on line "AllIngredients.Add(additions);" in third method - here everything is still OK, second at the beginning of for in FinalDrinks - here in AllIngriedients[1] I have cola.

Interestingly, I used similar methods, with alcohols and additions everything works correct. I haven't any idea what can I broke between end of the third method and beginning of the fourth.

But this View don't change anything in AllIngredients[1]. What's curious, in identical way I'm sending data between First & Second Step, Second & Third and when I for tests display all ingredients in FinalDrinks, I also everything have correct.

EDIT 2:
I maked more breakpoints and I discover another think: in View also everything with list AllIngredients[1] is OK. I set last breakpoint on for with Model[2] in View and here in AllIngredients[1] is water, clicked continue, stop again on "{" FinalDrinks method in controller and... have a f**king cola! Why?! In the meanwhile I have only button to send form.

I'm trying to do a list compression with nested for loops. The kicker is I have an action inside the if that I can't get to run with things nested. This function is supposed to take 2 lists of dicts(patients), compare them and return people that are on either or the other but not both. As you can see by my hashtag in the original I'm not 100% sure how I got that one to work. q1L and q2L are provided from an absent function here, however, it is a tuple that has the larger list on the left smaller on the right.

This is the code I'm working on

I have been working on a game and I need to call a function on the value of the key 'sides' (similar to 'onclick="rollDice(6)"'). I've tried using mustache interpolation and also v-binding, but I cannot seem to return anything other than NaN or undefined.

Question 1
I have a config file written by a program which I want to overwrite the values by running a script in terminal.

The config file is laid out like so (there is probably a name for this format, but I don't know what it is):

name_1 = "value1"
name_2 = "value2"
...

The extra spaces I believe are what is causing the issue when I try to read the values in my script file as I get the error "command not found" for each name.

Is there anyway I can include this file in my bash script so it understand that each line is a variable?

Question 2
How can I overwrite values of single lines in that file with the same formatting? The quotation marks in the config file have me confused, as well as the space before and after the = symbol.

So I'm working on an assignment for a data structures class, and one question is to create a put(key, value) method for an AVLTree. I know I have to adding the balancing method, but right now I'm just on the actual insertion. I want the function to work where you can create a tree and type newTree.put(key value) and have it work. Right now I have

However, the recursive aspect of put just discounts the root, and creates a new tree of just one parent and that node as one child. Is this the right way to go about this, or is there an easier way? Also, if I do it this way, how do you recurse left and right in this method?