How to predict the next value in a table? [closed]

I have a table full of values. I want to know what the next values may be.

PostgreSQL cannot look into the future, but it can guess based on existing data.

I will not install any software or extensions.

I have not hooked this script up to a syringe full of poison which sticks me if it predicts the wrong number, nor will this mechanism be auto-trading on the stock market. I will not sue anyone if it predicts the wrong number. It will be used "for novelty purposes only".

What would be the most likely "algorithm" to stand the best chance of guessing the next value?

If I just do:

SELECT avg(integer_column) FROM table; 

I will get the average number. That seems like a reasonable guess, but it also seems a bit simplistic. It seems like it could do better than that, without getting into some kind of crazy, ultra-complex query.

Would Druidcraft predict the use of the Control Weather spell?

If Druidcraft can predict a location’s weather for the next 24 hours, would it note weird weather caused by Control Weather, such as a sudden storm at midday on an otherwise clear and cloudless day? Or would only naturally occurring weather be predicted?

I predict the matter will come up at our next game session (my friends like to exploit loopholes, but in good fun) so I’m hoping to be prepared for the inevitable. I read the answer to “How reliable is Druidcraft weather prediction?”, but my question is more specific than that question answers.

Predict the next base64 code in an enumnation attack on sequntial integers that have been turned to base64 code

1tL1K/nYW1Q= corresponds to 41154

sR4 ngjRepM= corresponds to 41155

“hint the above code does have a space”

the above codes are base64 and correspond to some string + orderids

I am doing this in .NET

If someone able to crack the series as I am trying to create this in custom code.

I want someone to test this and try to break it, so that I can see the flaw in my code.

The point is that I use the int codes in .Net with a preset string to generate the base64 codes. I am using this to prevent order enumeration attacks, yet have a small identifier instead of ints for order numbers. Do you think this is susceptible to attacks and whether you can work out what the “secret” is to producing the base64 codes to recognise orders, and enumerate them based on existing data I have provided.

I will place a bounty of 100 credits on this if someone can crack this.


How can I predict javascript Math.random method given integers?

I know this is possible because people have mentioned doing it. Given the XorShift128+ algorithm, how can I predict the next numbers given 15 integers generated through Math.floor(Math.random() * (max - min +1) + min). I have tried modifying this script into this, however my code doesn’t work and is stuck solving infinitely. Any help would be appreciated.

How to predict the number of comparisons done by QuickSort if you know the percentage to which the array is pre-sorted?

I’ve noticed that correlating the number of comparisons done by a naive implementation of QuickSort with the percentage of elements that were already sorted gives you a curly-brace-shaped-curve if you use logarithmic scale: Curly-brace-shaped curve So, how can this curly-brace-shaped curve be mathematically described (the red curve represents the behavior of the c++ “sort” function, and it appears much more complicated)? If it can be done precisely, then one can precisely predict how many comparisons QuickSort would do simply by passing through the array, counting the number of elements for which array[i]<array[i+1], and inserting that number into a formula. I’ve tried to find a mathematical formula that approximates that using a genetic algorithm, here is what I ended up with:


Here, ‘f’ signifies the number of comparisons done by QuickSort, ‘n’ signifies the number of elements in the array and ‘s’ signifies the proportion of the elements that are already sorted: it’s -1 if the array is reverse-sorted, 1 if it’s already sorted, and approximately 0 if it’s randomly shuffled.

Can you come up with a better formula?

NZEC error in a simple python code to predict the winner using combinatorial game theory

def calculateMex(Set):          Mex = 0      while Mex in Set:           Mex += 1       return Mex     def calculateGrundy(n,k):         if 0 <= n <= k:          return n        Set = set()      for i in range(1, k+1):           Set.add(calculateGrundy(n - i,k))         return calculateMex(Set)  sys.setrecursionlimit(10000) t=int(input()) while(t>0):     t=t-1     inp=input()     nk=inp.split(' ')     n=int(nk[0])     k=int(nk[1])     a=calculateGrundy(n,k)     if a==0:         print('Dishant')     else:         print('Arpa') 

Constraints: 1 < T < 10^5 and 1 < K < N < 10^18 where T is the no. of test cases; K is the atmost number of coins that can be taken away from a pile and N is the number of coins in the pile initially. Logically the code is working fine.But it gives NZEC error when I try to submit it at a competitive programming platform.I cant figure out the why and how to fix it.Any help would be appreciated.

Dúvida em predict de modelos

Acredito que seja uma dúvida simples, porém em todos os cursos que estou fazendo o instrutor ensina a separar dados de treino e teste de um csv ou alguma base. Porém quero fazer os testes com o input do usuário ao invés disso, mas quando tento, diz que precisa ter o mesmo tamanho que os treinos, não há uma forma de testar só um input?

Exemplo: Meu dataframe

Estou usando a coluna tratamento_5 com o seguinte código

tfidf = TfidfVectorizer(lowercase=False) vetor_tfidf = tfidf.fit_transform(resenha["tratamento_5"]) treino, teste, classe_treino, classe_teste = train_test_split(vetor_tfidf,                                                               resenha["classificacao"],                                                               random_state = 42), classe_treino) acuracia_tfidf = regressao_logistica.score(teste, classe_teste) print(regressao_logistica.predict(teste).tolist()) 

Esse código separa os dados de teste e treino e prediz com os dados de teste.

Porém quero fazer algo com a interação do usuário, ou seja um texto inserido pelo usuário, tentei dessa forma:

vetor_tfidf2 = tfidf.fit_transform(["Esse filme foi muito bom, gostei dos movimentos de ação do inicio até o final do filme"]) treino, teste, classe_treino, classe_teste = train_test_split(vetor_tfidf2,                                                               resenha["classificacao"],                                                               random_state = 42), classe_treino) acuracia_tfidf = regressao_logistica.score(teste, classe_teste) print(regressao_logistica.predict(teste).tolist())  print(vetor_tfidf2.shape) print(resenha['classificacao'].shape) 

Porém me retorna o seguinte erro

ValueError: Found input variables with inconsistent numbers of samples: [1, 49459]

Isso me parece que é porque os dados de treino e teste tem tamanhos diferentes, mas como posso fazer somente com uma frase e não usando o dataframe como tentei?

Is there a software that would scan the ports automatically, then predict if there are any malicious activity going on, on my Win10 PC?

I’ve got this malware(or spyware as Kaspersky detected), from the USB storage device by purely a lack of focus. After scanning and defecting all the drives that are connected to my computer with Kaspersky & Malwarebytes, I still feel unsatisfied that I might be still using a potentially dangerous computer.

I really don’t bother about OS corruption, my only concern is that if there’s someone somewhere leaking out information from my computer or from it’s hardware anyhow.

Is there a way to scan all the ports for malicious activities?