Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
394 views

Generating random number of randomly sized Squares/Rectangles using numpy arrays

I made classes to use in generating square/rectangular shapes on a texture. ...
Nyos's user avatar
  • 21
2 votes
1 answer
101 views

Performance issue in python- network creation based on the Euclidean distance with nested for loops is too slow

I want to create a network in which the links are formed based on a similarity metric defined as the Euclidean distance between the nodes. The distance is calculated using socio-demographic features ...
user710's user avatar
  • 21
8 votes
2 answers
507 views

Univariate linear regression from scratch in Python

I am relatively new to machine learning and I believe one of the best ways for me to get the intuition behind most algorithms is to write them from scratch before using tons of external libraries. ...
maufcost's user avatar
  • 379
17 votes
1 answer
590 views

Warhammer: How many of my attacks will succeed?

Me and a couple of mates sometimes play a game called Warhammer. When playing the game you have options of what each model attacks. This can lead to situations where you know if you shoot with 100% of ...
Peilonrayz's user avatar
  • 44.2k
1 vote
1 answer
690 views

Comparison of exponential smoothing and regression on a Lloyds bank's stock price data

What is one way to change it into a program that makes use of OOP concepts? I have always programmed this way and I feel that I would somehow need to improve on it. By the way, I have deliberately ...
Benyam's user avatar
  • 13
6 votes
1 answer
106 views

Gradient Boosting Class/Module using sklearn. (My first Python Module)

This is a follow-up question to My last question. From then on, I think that I have improved quite a lot thanks to a large amount of feedback I received from my last post. This will be the last time I ...
Vera Perrone's user avatar
3 votes
1 answer
2k views

Scoreboard with score evolution plots using classes

I've very recently started using OOP paradigms for the code in my work (academic research). As an exercise I tried coding this quick scoreboard. I'm not interested in improving the 'display' part, I ...
nicoco's user avatar
  • 389
10 votes
2 answers
2k views

A 3-D vector class built on top of numpy.array

I wanted a convenient class to easy access the parameters inside. I am using a lot of math in my game; that's why a wanted to access them through x, ...
Sens4's user avatar
  • 243
12 votes
1 answer
1k views

Parallelizing some model fitting code using multiprocessing

I'm trying to refactor some code for fitting parametric models that are defined symbolically using Theano. My goal is for all models to expose a common interface so that, as far as possible, they can ...
ali_m's user avatar
  • 223