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
Playing around with different training algorithms in MiniSomโฆ and this map popped out. Fascinating to see how much the training method shapes the result!
Nice visualization done using MiniSom. From the paper "Cross-regional impact of land and ocean evaporation on extreme precipitation in North China" https://t.co/vl7ocbbuc3
๐ MiniSom 2.3.6 is out!
๐ Offline batch training is now implemented!
Faster & more robust PCA init, better numerical stability, and doc fixes.
https://t.co/uupkOc2OfE
Thanks to @mariajmolina and @lorenzoferre for their contributions! ๐
๐ MiniSom now supports batch training with the new method train_batch_offline().
The changes are in the master branch and will soon be released.
https://t.co/uupkOc3m5c
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. ๐ฎ
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
๐จ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
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
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!
Got messy numeric data like "N/A", "โ", or "??"?
Use https://t.co/7LremCtvCj_numeric() to convert safely:
https://t.co/7LremCtvCj_numeric(df["col"], errors="coerce")
Non-numeric values become NaN โ perfect for cleaning before modeling. ๐งน๐
#DataCleaning#Python#ML
Since version 1.7.2, sklearn has the function brier_score_loss which measures the mean squared difference between the predicted probability and the actual outcome.
https://t.co/jWEsYEIxRt
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.
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 = https://t.co/vQwS3FromK()
No need to close() โ the context takes care of it.
Less noise, more clarity.
"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"
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!