Questions tagged [functions]
7 questions
2
votes
1 answer
Monte Carlo iteration in excel
I'm trying to use Excel to determine the outcomes of hockey games. In the game that I'm simulating, I have each team has a goals for and standard deviation which I call in this function:
(NORM.INV(RAND(), D2, E3)) and (NORM.INV(RAND(), D3, E2))…
user183910
- 21
- 2
1
vote
3 answers
How to use function from other Colab file?
I’m coming from a math background and learning some data science. I am very new to some details of this stuff.
Working with colab, I’m trying to organize my sample simulating functions in such a way that I can reach them even in different…
Paul
- 11
- 1
- 3
1
vote
1 answer
do inner functions have a substantial impact when used in series.apply() in Pandas
In pandas, if I use series.apply() to apply a function with an inner function definition, for example:
def square_times_two(x):
def square(y):
return y ** 2
return square(x) * 2
data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c',…
Alex
- 13
- 3
1
vote
0 answers
Probability notation q(y) and q(Y) and its implication to vector functions
The function in question is (from Appendix B, Proof of proposition 2.1 from Posterior Regularization for Structured Latent Variable Models):
$$q(\textbf{Z}) = \frac{p_{\theta}(\textbf{Z}|\textbf{X})exp(\lambda^T \cdot…
Martin G
- 131
- 3
0
votes
1 answer
Working with functions
What are some good sources for learning how to deal with functions in Python and R. I have used them a lot of times and they can be a bit challenging. I like to write out a plan of what I want done when dealing with functions. Almost similar to…
Salem Abdulkerim
- 3
- 2
0
votes
0 answers
How to define a DataLoader or Loss for a e.g. multivariable functions?
I am trying to write a NN for estimating a f:R^n --> R^m. My problem is how to train network. I mean if I want to define a dataloader, how to attach X \in R^n to its related Y \in R^m ? Because usually we have an integer form labels and not tensor…
Ali.A
- 159
- 8
0
votes
2 answers
Call function from one class in the same class
I have 2 classes model and impute. I am defining a function mode_impute inside impute. Now I want to call mode_impute inside impute. How can I call it? I tried the following:
class impute(model):
def __init__(self):
…
spectre
- 2,223
- 2
- 14
- 37