Linked Questions

0 votes
0 answers
34 views

I have a list of choices in python like: choices = ['A', 'B', 'C', 'D'] and a list of probabilities like: probs = [0.5, 0.2, 0.1, 0.1] they're related position-wise, A has a probability of 0.5, ...
David Masip's user avatar
  • 2,581
138 votes
4 answers
70k views

I have a big script in Python. I inspired myself in other people's code so I ended up using the numpy.random module for some things (for example for creating an array of random numbers taken from a ...
Laura's user avatar
  • 1,902
71 votes
4 answers
8k views

I'm using Python to generate images using dashed lines for stippling. The period of the dashing is constant, what changes is dash/space ratio. This produces something like this: However in that image ...
xenoid's user avatar
  • 9,132
8 votes
2 answers
12k views

I am trying to generate random data(integers) with dates so that I can practice pandas data analytics commands on it and plot time series graphs. temp depth acceleration 2019-01-1 ...
NodeSlayer's user avatar
14 votes
1 answer
38k views

I have the following code where I use the Pandas random_state randomState = 123 sampleSize = 750 df = pd.read_csv(filePath, delim_whitespace=True) df_s = df.sample(n=sampleSize, random_state=...
Newskooler's user avatar
  • 4,333
4 votes
3 answers
6k views

I have such code and use Jupyter-Notebook for j in range(timesteps): a_int = np.random.randint(largest_number/2) # int version and i get random numbers, but when i try to move part of code to ...
Vladimir Shebuniayeu's user avatar
1 vote
1 answer
3k views

I used this code, https://datascienceplus.com/evaluation-of-topic-modeling-topic-coherence/, to find topic coherence for a dataset. When I tried this code with the same number of topics, I got new ...
Panda's user avatar
  • 9
6 votes
1 answer
3k views

I am using aws ec2 to train a model for a multi-label classification task. After training , I tested the model on the same machine which gives me good results (accuracy of 90+%). However, after I ...
Vainglory Arcanine's user avatar
3 votes
1 answer
7k views

How can I set numpy.random.seed(0) on a global scale? It seems I have to reset the seed every time I call a np.random function. import numpy as np np.random.seed(0) print(np.random.randint(0,10,2)) ...
Andi's user avatar
  • 5,177
1 vote
2 answers
4k views

What difference does different values of random state makes to the output? For instance, if I set 0 and if I set 100 what difference would it make to the output?
Vikas 's user avatar
  • 61
1 vote
1 answer
4k views

The 'merror' and 'logloss' result from XGB multiclass classification differs by about 0.01 or 0.02 on each run, with the same parameters. Is this normal? I want 'merror' and 'logloss' to be constant ...
Ian Dzindo's user avatar
1 vote
3 answers
2k views

Here is code I wrote to generate a dataframe that contains 4 columns num_rows = 10 df = pd.DataFrame({ 'id_col' : [x+1 for x in range(num_rows)] , 'c1': [randint(0, 9) for x in range(num_rows)], 'c2'...
blue-sky's user avatar
  • 54.3k
0 votes
1 answer
2k views

I want to use LogisticRegression to classify. So, I use RandomizedSearchCV to pick best C params in LogisticRegression. My question is: Why do best_params_ change every time I run this program? I ...
shen ruxuan's user avatar
0 votes
4 answers
541 views

A sample input data frame import pandas as pd df_input = pd.DataFrame([[1.7, 0.2], [0.4, 0.93], [0.05, 0.96], [0.97, 0.68]], columns=["A", "B"]) This example has two columns whereas the real ...
Abhishek Kulkarni's user avatar
1 vote
1 answer
1k views

Following two version code should have given the same output. Looks like np.random.seed need to be called every time. Is it correct? Is there any way to set seed once so that same random number ...
Shiv's user avatar
  • 369

15 30 50 per page