Questions tagged [minmax]

This tag apparently is used as a synonym for "minimax", which seems more appropriate and is better maintained; I would suggest introduction of a tag synonym.

272 questions
1
vote
2 answers

std::minmax_element comparer for a vector with std::optional is incorrect

I have a struct within a struct of std::optionals, and I am trying to find the minimum and maximum value within the struct. However, using std::minmax_element seems to be inaccurate, and I've had to split the comparison function and use…
Brinck
  • 69
  • 4
1
vote
1 answer

TicTacToe MinMax logic problem, why does the method return the wrong move?

MinMax algo returns a completely illogical move (does not counter player) >.< Hey, I have some logic error in the getBestMove method of MinMax class implementation. I think everything looks ok. I do a test in GameRunner and it takes the correct…
reizorwins
  • 13
  • 2
1
vote
2 answers

How to remove time dependancy on Max and Min Dates in Date Picker in datetime mode?

In my project, I have to set minimum and maximum dates in DateTimePicker. Although it has both date and time components, I just want to select min and max dates and not min and max time. So, for example, if minimumDate is 19 December 2022, the user…
1
vote
0 answers

Threshold optimization in unlabeled data

I am using a pretrained model that gives me an zero-shot output of three probabilities for three classes(day, night, and aerial photos), I need to find the threshold that maximizes the value of one class (day) and minimizes the other two, to label…
1
vote
1 answer

minmax algorithm with tictactoe, wrong decision

I have this code written in Dart that implements the minmax algorithm, With a tic-tac-toe, the computer is playing as "O" and trying to maximize the score, but I get some wrong decision like this, it says (look at the top, the first is the move…
haitham
  • 77
  • 1
  • 10
1
vote
1 answer

Non-empty subsets from HackerEarth exercises

Actually, I am doing an exercise from HackerEarth. The exercise is pretty simple: I have to use a min-max algorithm but I have some struggles when I use the readLine method from the variable BufferReader. I cannot figure out why but my min variable…
IlCorsaroNero
  • 351
  • 1
  • 10
1
vote
1 answer

Using MinMaxScaler on arrays and getting scaling parameters for later use: missing values

I have this issue when trying to use sklearn.preprocessing.MinMaxScaler on a large array and obtaining the scaling parameters to do "redo" the normalization after handling the array for a while. The issue I have is that after doing my…
Boston
  • 13
  • 4
1
vote
1 answer

Tron lightcycles AI in Prolog

I have the problem to write the AI to game(like tron lightcycles). I write all the graphics and movements on C using ncurses. Now i need to write the bot's ai on the prolog. I'm using swi prolog. I save the current game field(all matrix), current…
nub
  • 474
  • 1
  • 7
  • 16
1
vote
2 answers

Maximum number irrespective of sign from positive and negative numbers in a list

I want to find the maximum number from a list that has both positive, negative number and irrespective of sign. For example: arr = [2,3,-6,5] ## output: -6 arr = [2,3,6,-5] ## output: 6 I've the following code which is working: def max_number(l): …
user3503711
  • 1,623
  • 1
  • 21
  • 32
1
vote
2 answers

Removing people from a dataframe in R if their results don't span a specific period of time

Dataset of blood results: id result date A1 80 01/01/2006 A1 70 02/10/2006 A1 61 01/01/2007 A1 30 01/01/2008 A1 28 03/06/2008 B2 40 01/01/2006 B2 30 …
tacrolimus
  • 500
  • 2
  • 12
1
vote
1 answer

Using minmax() functions in CSS grid

I have a grid with 2 columns x 2 rows. All of them are set in minmax() size. Can I ask why the element with class show doesn't take the full size of the grid even though I set all other elements (hide class) in the grid to width 0 and height 0.…
1
vote
2 answers

We need to create function minmax that takes integer array and a lambda expression as arguments and returne minimum or maximum based on lambda passed

Iam new to programing and trying my best but now I'm stucK on this. Please help. We need to create function minmax that takes integer array and a lambda expression as arguments and return minimum or maximum based on lambda passed fun main(args:…
ばらす
  • 11
  • 1
1
vote
0 answers

How to use min max scaler on numpy array in pyspark environment?

Here is the way I could do using sklearn minmax_scale, however sklearn can not be able to integrate with pyspark. Is there anyway, I could use an alternate way in spark for minmax scaling on an array? Thanks. for i, a in…
data_coder
  • 97
  • 8
1
vote
0 answers

Tic Tac Toe Game using Min-Max Algorithm

I added these 3 variable to make operation of finding the winner in O(1) time. private final int[] rowSum, colSum; private int diagSum; private int revDiagSum; rowSum array contains sum of each row in n * n board, similary colSum contains column…
tusharRawat
  • 719
  • 10
  • 24
1
vote
1 answer

Understanding negamax with transposition tables

Note: I understand how min-max works and I understand alpha beta pruning Even if you can only answer one of my questions below I would be infinitely appreciative No matter how much I try look at it and research I just cannot understand tranposition…