Glowing Python (@JustGlowing) header
Glowing Python (@JustGlowing) profile picture

Tweeting about Python trickeries, Data Visualization and Machine Learning. Half human data scientist, half machine.

Cambridge, UK
Joined December 2010
Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)Photo by Glowing Python (@JustGlowing)
MiniSom will soon have a training method accelerated with numba that provides 10x speed-up
1
148
Playing around with different training algorithms in MiniSom… and this map popped out. Fascinating to see how much the training method shapes the result!
1
1
185
These are the parameters in case someone wants to replicate the experiment: size: 130x130 sigma: 10 learning_rate: 0.5 activation_distance: "euclidean" neighborhood_function: "gaussian" topology: "rectangular" training: train_batch_offlinenum_iteration: 100
64
Nice visualization done using MiniSom. From the paper "Cross-regional impact of land and ocean evaporation on extreme precipitation in North China" sciencedirect.com/science/ar…
1
1
126
🎉 MiniSom 2.3.6 is out! 🆕 Offline batch training is now implemented! Faster & more robust PCA init, better numerical stability, and doc fixes. github.com/JustGlowing/minis… Thanks to @mariajmolina and @lorenzoferre for their contributions! 🙌
2
117
In the mid 70s programming a computer meant using punch cars. It got much easier over time, so easy to the point that we have AI assistants to write code for us! Chances are, it will get even easier in the future. 🔮
94
Using AI to code faster is not bad, relying solely on AI to code will restrict your abilities to build meaningful things.
74
AI has become an essential tool for my coding but I do not consider myself a vibe coder. The reason is simple, 1) I use it build circumscribe snippets, check the logic and adapt them 2) I adapt the unit tests to make sure the code does what it's supposed to
85
📊 Best Python libs for data viz: Matplotlib, Seaborn, Plotly, Altair, Bokeh, Plotnine, Holoviews, Dash, PyViz. Clean plots, interactivity, dashboards — pick your vibe! 🚀
117
🚨PSA for #PySpark users: df.limit(n) is NOT deterministic! ⚠️ It just takes the first n rows from each partition, the final set can vary between runs unless you explicitly orderBy(). If you need consistent results: 👉 df.orderBy("some_col").limit(n) #BigData #SparkTips
120
Tackling class imbalance? Try imbalanced-learn (imblearn) — works seamlessly with #scikitLearn! from imblearn.over_sampling import SMOTE X_res, y_res = SMOTE().fit_resample(X, y) It also supports under/over sampling, pipelines & ensembles. ⚖️ #Python #ML #DataScience
139
Handling missing data in #ML? #scikitLearn gives you several imputers: SimpleImputer → mean/median/mode/constant KNNImputer → use nearest neighbors IterativeImputer → model-based (like MICE) MissingIndicator → flag NaNs Clean data = better models!
67
Got messy numeric data like "N/A", "—", or "??"? Use pd.to_numeric() to convert safely: pd.to_numeric(df["col"], errors="coerce") Non-numeric values become NaN — perfect for cleaning before modeling. 🧹📊 #DataCleaning #Python #ML
101
In PySpark, mapPartitions lets you think bigger than rows. Instead of processing one record at a time, it gives you the whole partition: rdd.mapPartitions(lambda it: [sum(it)]) Fewer function calls, faster execution. Work smarter — one partition at a time.
101
In Python, with is elegance in action. It handles setup and cleanup so you can focus on logic: with open("data.txt") as f: data = f.read() No need to close() — the context takes care of it. Less noise, more clarity.
105
"If the ability to form maps were ubiquitous in the brain, then one could easily explain its power to operate on semantic items: some areas of the brain could simply create and order specialized cells or cell groups in conformity with high-level features and their combinations"
1
101
Quote from "Self-Organized Formation of Topologically Correct Feature Maps", Teuvo Kohonen, 1982
89
Ever needed the Kronecker product in #Python?numpy.kron() is your friend! import numpy as np A = np.array([[1, 2], [3, 4]]) B = np.array([[0, 5], [6, 7]]) np.kron(A, B) Expand matrices in a snap!
88