<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Filippo Valle on Medium]]></title>
        <description><![CDATA[Stories by Filippo Valle on Medium]]></description>
        <link>https://medium.com/@filippovalle?source=rss-cbc83485b57b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*X1mUY1gUIENON6v8qxpVQw.jpeg</url>
            <title>Stories by Filippo Valle on Medium</title>
            <link>https://medium.com/@filippovalle?source=rss-cbc83485b57b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 01:23:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@filippovalle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Heaps’ law in text chats]]></title>
            <link>https://filippovalle.medium.com/heaps-law-in-text-chats-99104a7aac00?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/99104a7aac00</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[linguistics]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 10:21:01 GMT</pubDate>
            <atom:updated>2026-11-23T10:21:01.573Z</atom:updated>
            <content:encoded><![CDATA[<h4>The well-known linguistics in our chats</h4><p>Today I will talk about another statistical law of language, and show that it also hides in our chats.</p><p>In linguistics, Heaps’ law is an empirical law which describes the number of distinct words in a document as a function of the document’s length. The longer you write, the more new words you use, but new words appear more and more slowly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*c3HZIQD2jsf_47L40xBq4Q.png" /><figcaption>Heaps’law in texts. Credits: Wikipedia (<a href="https://en.wikipedia.org/wiki/User:The_Anome">The Anome</a>, <a href="https://commons.wikimedia.org/wiki/File:Heaps_law_plot.png">Heaps law plot</a>, <a href="https://en.wikipedia.org/wiki/en:GNU_Free_Documentation_License">GFDL</a>)</figcaption></figure><p>The law is usually attributed to Harold Stanley Heaps, although Gustav Herdan described it earlier, which is why it is also called Herdan’s law [1, 2]. Under mild assumptions, Heaps’ law is asymptotically equivalent to Zipf’s law for the frequencies of individual words in a text. In other words, how the vocabulary grows can be derived from how often each word is used [3].</p><p>Some time ago I analysed Zipf’s law in WhatsApp</p><p><a href="https://filippovalle.medium.com/zipfs-law-in-whatsapp-ec47c8c38a97">Zipf’s law in WhatsApp</a></p><p>and found that it emerges in our chats. If Zipf is there, Heaps should be there too. Let’s check.</p><h4>A little bit of math</h4><p>All the considerations will be based on two variables:</p><p>- the size <strong>M</strong>, the total number of words written so far in a chat;<br>- the number of distinct words <strong>h</strong>, the number of different words that appear in those <strong>M</strong> words.</p><p><strong>h</strong> can never be larger than <strong>M</strong>, and in principle it is bounded by the size of the dictionary (although chats happily add names, slang and emoji to it).</p><p>Heaps’ law states that <strong>h</strong> grows sub-linearly with <strong>M</strong>:</p><p>h(M) = K · M^β, with 0 &lt; β &lt; 1.</p><p>In English corpora the exponent β is typically between 0.4 and 0.6.</p><p>The link with Zipf is simple to state. If the frequency of the word of rank decays as r^−α with α &gt; 1, then the vocabulary grows with exponent β ≈ 1/α [3]. A steeper Zipf means a slower-growing vocabulary.</p><p>On a log-log plot the law becomes a straight line, log(h) = log (K) + β log <strong>M</strong>, so β is just the slope.</p><h4>Get the data</h4><p>As in the previous post, export one of your WhatsApp chats (<a href="https://faq.whatsapp.com/1180414079177245">instructions here</a>) and apply the same preprocessing: remove special characters and punctuation, and put a space between words and emoji.</p><h4>Count the new words</h4><p>This time the order of the words matters. We read the chat message by message, and every time we see a word we have never seen before, *h* increases by one. After each message we record the pair (*M*, *h*).</p><pre>function heaps(chat_file=&quot;_chat.txt&quot;)<br> seen = Set{String}()<br> M = 0<br> sizes = Int[]<br> distinct = Int[]<br> open(chat_file, &quot;r&quot;) do io<br> while !eof(io)<br> message = readline(io)<br> for word in preprocess(message)<br> M += 1<br> push!(seen, word)<br> end<br> push!(sizes, M)<br> push!(distinct, length(seen))<br> end<br> end<br> return sizes, distinct<br>endj</pre><p>preprocess is the same function used for Zipf’s law: it returns the list of cleaned words of a message.</p><h4>Estimate the exponent</h4><p>Since the law is a straight line in log-log scale, a linear fit gives the exponent.</p><pre>using Statistics<br>function fit_heaps(sizes, distinct)<br> keep = sizes .&gt; 0<br> x = log.(sizes[keep])<br> y = log.(distinct[keep])<br> beta = cov(x, y) / var(x)<br> K = exp(mean(y) - beta * mean(x))<br> return beta, K<br>end</pre><p>A simple least-squares fit is enough to get an idea; the first few messages, where every word is new, can be dropped to avoid biasing the slope.</p><h4>Your chats follow Heaps’ law</h4><p>Plotting <strong>h</strong> versus <strong>M</strong> in log-log scale for different chats gives, again, straight lines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*zVXd3X2f4pYlyHbdrZyDRw.png" /><figcaption>Emergence of Heaps’ law in different chats of Whatsapp. Image by Author.</figcaption></figure><p>Every chat has its own slope: some conversations keep introducing new words, others settle quickly into a familiar vocabulary. Yet all of them grow sub-linearly, exactly as Heaps’ law predicts.</p><h4>Conclusions</h4><p>Zipf’s law tells us how often we use each word; Heaps’ law tells us how quickly we run out of new ones. They are two faces of the same statistics, and both emerge in something as ordinary as a WhatsApp chat. These laws are not specific to language either: the same signatures appear, for example, in the genes expressed by single cells [4].</p><h4>The code</h4><p>A GitHub repository with the code is available</p><p><a href="https://github.com/fvalle1/whatsanalyser](https://github.com/fvalle1/whatsanalyser).">https://github.com/fvalle1/whatsanalyser</a></p><h4>References</h4><p>[1] H. S. Heaps, *Information Retrieval: Computational and Theoretical Aspects*, Academic Press (1978).</p><p>[2] G. Herdan, *Type-Token Mathematics*, Mouton (1960).</p><p>[3] L. Lü, Z.-K. Zhang, T. Zhou, *Zipf’s Law Leads to Heaps’ Law: Analyzing Their Relation in Finite-Size Systems*, PLoS ONE 5(12): e14139 (2010).</p><p>[4] S. Lazzardi, F. Valle, A. Mazzolini, A. Scialdone, M. Caselle, M. Osella, *Emergent Statistical Laws in Single-Cell Transcriptomic Data* (2021) bioRxiv. [TODO: replace with the journal version if published.]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99104a7aac00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Confidence intervals]]></title>
            <link>https://filippovalle.medium.com/confidence-intervals-1fd8f44d84fe?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fd8f44d84fe</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[math]]></category>
            <category><![CDATA[error]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 10:16:01 GMT</pubDate>
            <atom:updated>2026-11-09T10:16:01.532Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zNaIP5mKZI77Z1ED" /><figcaption>Photo by <a href="https://unsplash.com/@amyshamblen?utm_source=medium&amp;utm_medium=referral">Amy Shamblen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Quantify the uncertainty</h4><p>Every measurement comes with an error bar. In papers, in dashboards, in the news: a number and two little whiskers around it, often labelled “95% CI”. Today I will try to explain what those bars actually mean, because the most common interpretation is wrong, and simulate it in a few lines of Python.</p><h4>Experiments and gaussians</h4><p>Imagine we want to measure a quantity whose true value is μ. We cannot see μ directly; we can only run an experiment and collect *n* noisy measurements x₁, …, xₙ. If the noise is Gaussian with standard deviation σ, our best estimate of μ is the sample mean</p><p>x̄ = (x₁ + … + xₙ) / n</p><p>and the uncertainty on x̄ is the standard error of the mean</p><p>SE = s / √n</p><p>where *s* is the standard deviation measured on the sample. Note the √n: to halve the error you need four times as many measurements.</p><p>A 95% confidence interval is then</p><p>x̄ ± t · SE</p><p>where *t* is the 97.5% quantile of a Student’s t distribution with n − 1 degrees of freedom. For large *n* it tends to the familiar 1.96 of the Gaussian; for small samples it is larger, because we are also uncertain about σ itself.</p><p>Let’s run one experiment with 10 measurements, true value μ = 10 and σ = 2.</p><pre>import numpy as np<br>from scipy import stats<br>rng = np.random.default_rng(42)<br>mu, sigma = 10., 2.<br>n = 10<br>x = rng.normal(mu, sigma, size=n)<br>mean = x.mean()<br>sem = x.std(ddof=1) / np.sqrt(n)<br>t = stats.t.ppf(0.975, df=n-1)<br>print(f&quot;mean = {mean:.2f}, 95% CI = [{mean - t*sem:.2f}, {mean + t*sem:.2f}]&quot;)</pre><p>SciPy can also do it in one line with `stats.t.interval(0.95, df=n-1, loc=mean, scale=sem)`, which gives the same interval.</p><p>In this simulation we can check whether the interval contains the true value 10. In a real experiment we would never know.</p><h4>Meaning of those bars</h4><p>They represent the probability that the confidence interval contains the true value.</p><p>Often we hear that there is a 95% probability that the true value is contained in the bar. That is NOT TRUE. The true value is unknown, but it is fixed: it cannot move. Once the experiment is done, the interval we computed either contains μ or it does not. There is nothing random left.</p><p>What is random is the interval. If we repeated the whole experiment many times, each time we would get a different sample, a different mean and a different interval. The 95% refers to this procedure: 95% of the intervals built this way contain the true value.</p><p>We can check it by simulating 10,000 experiments.</p><pre>n_experiments = 10000<br>samples = rng.normal(mu, sigma, size=(n_experiments, n))<br>means = samples.mean(axis=1)<br>sems = samples.std(axis=1, ddof=1) / np.sqrt(n)<br>low, high = means - t*sems, means + t*sems<br>contains = (low &lt; mu) &amp; (mu &lt; high)<br>print(f&quot;fraction of intervals containing mu: {contains.mean():.3f}&quot;)</pre><p>The fraction comes out very close to 95%, exactly what was promised. Let’s plot the first 100 intervals.</p><h4>Conclusions</h4><p>A 95% confidence interval is a statement about the method, not about a single interval: if you repeat the experiment many times, 95% of the intervals you build contain the true value. The true value does not move; the intervals do.</p><p>If you want a statement like “there is a 95% probability that μ is in this range”, you need a different tool: a Bayesian credible interval, which treats μ itself as a random variable with a prior. That’s maybe a story for another post.</p><h4>References</h4><p>1. Neyman, J. Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability. (1937) Philosophical Transactions of the Royal Society A, 236, 333–380.<br>2. Hoekstra, R.; Morey, R. D.; Rouder, J. N.; Wagenmakers, E.-J. Robust misinterpretation of confidence intervals. (2014) Psychonomic Bulletin &amp; Review, 21, 1157–1164. [TODO: verify citation details]<br>3. SciPy documentation, `scipy.stats.t`: <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.t.html">https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.t.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fd8f44d84fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I am also on substack now]]></title>
            <link>https://filippovalle.medium.com/i-am-also-on-substack-now-2b968f6aaa35?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b968f6aaa35</guid>
            <category><![CDATA[substack]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 11:48:10 GMT</pubDate>
            <atom:updated>2026-11-02T11:53:37.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9MUUHfqiZSnJNd5o" /><figcaption>Photo by <a href="https://unsplash.com/@wvrede?utm_source=medium&amp;utm_medium=referral">Wolfgang Vrede</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>I’m starting a Substack following my course on AI safety</strong></p><p>If you read me here, you know I like taking things apart to see how they work: neural networks, clustering algorithms, the odd Arduino. I am a researcher in complex systems, and that background keeps pulling me toward one question: what does AI safety look like when you treat these systems as complex systems?</p><p>That’s what my new Substack is about. Expect posts on how AI behaves, why it sometimes surprises us, and what that means for making it safe.</p><p>It’s free, and I’d love to have you there:</p><p><a href="https://filippovalle.substack.com/">https://filippovalle.substack.com</a></p><p>If there’s something about AI you’d like me to dig into, tell me. The publication is new, so early readers get to shape it.</p><p>Thanks for reading!</p><p>Filippo</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b968f6aaa35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi-omics topic modeling]]></title>
            <link>https://filippovalle.medium.com/multi-omics-topic-modeling-ac108d9f5c6?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac108d9f5c6</guid>
            <category><![CDATA[topic-modeling]]></category>
            <category><![CDATA[single-cell-multiomics]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 08:11:01 GMT</pubDate>
            <atom:updated>2026-10-20T08:11:01.539Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IF5_ohKqcRJUaIeP" /><figcaption>Photo by <a href="https://unsplash.com/@jentheodore?utm_source=medium&amp;utm_medium=referral">Jen Theodore</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>When genes are not the only words in the dictionary</h4><p>In a previous post I discussed the use of a technique called topic modeling as a powerful tool to extend Natural Language Processing to cancer research.</p><p><a href="https://filippovalle.medium.com/topic-models-for-cancer-research-5eac9db193c3">Topic models for cancer research</a></p><p>Today I will show how the same idea can be pushed one step further: what if a sample is described not by one kind of word, but by several?</p><h4>A quick recap</h4><p>In the network approach to topic modeling [3], documents and words are the two sides of a bipartite network. Each document is linked to the words it contains, and the weight of a link is the number of times the word appears. Finding communities in this network with a hierarchical stochastic block model (hSBM) is equivalent to doing topic modeling: groups of documents are clusters, groups of words are topics.</p><p>In cancer research the documents are patient samples and the words are genes, weighted by their expression. In [2] we used this to recover breast and lung cancer subtypes from TCGA transcriptomic data.</p><h4>Multiomics</h4><p>Gene expression is only one layer of what happens in a cell. The same samples can be measured in many other ways: microRNAs (small RNAs that regulate the expression of genes after transcription), copy number variations, methylation and so on. Each of these is called an *omics*, and combining them is what people call multi-omics.</p><p>The question is simple: how do we put all these layers in the same model, without squeezing everything into a single giant matrix?</p><h4>From bipartite to tripartite</h4><p>The network picture makes the answer quite natural. Samples stay in the centre and every omics becomes a new branch of nodes connected to them.</p><p>With genes and microRNAs we get a tripartite network:</p><p>- links only go from samples to genes and from samples to microRNAs;<br>- there are no links inside a branch or between two branches;<br>- weights are the expression levels in each layer.</p><p>We called this model triSBM, and its general version, with any number of branches, nSBM [1]. Adding copy number variations as a fourth branch gives tetraSBM.</p><p>Each branch takes part in the inference at the same time, without any reweighting, and gets its own topic structure. So the output is one set of sample clusters plus gene-topics *and* microRNA-topics, at several levels of the hierarchy. The fit minimises the description length of the network with an MCMC, using graph-tool, and we kept the best of several runs.</p><h4>The data</h4><p>We tested the model on breast cancer samples from TCGA [1]. For each sample we took the expression of the most variable protein-coding genes and microRNAs; for tetraSBM we added the genes with a high copy number.</p><h4>Code</h4><p>The model is available in the nsbm package, which you can install with conda:</p><pre>conda install -c conda-forge nsbm</pre><p>The input is one table per omics, with features on the rows and the same samples on the columns. Here is the example from the repository, reduced to the tripartite case with random data (think of words as genes and keywords as microRNAs):</p><pre>from nsbm import nsbm<br>import pandas as pd<br>import numpy as np<br>df = pd.DataFrame(<br>index = [&quot;w{}&quot;.format(w) for w in range(1000)],<br>columns = [&quot;doc{}&quot;.format(d) for d in range(250)],<br>data = np.random.randint(1, 100, 250000).reshape((1000, 250)))<br>df_key_list = []<br>## keywords<br>df_key_list.append(<br> pd.DataFrame(<br> index = [&quot;keyword{}&quot;.format(w) for w in range(100)],<br> columns = [&quot;doc{}&quot;.format(d) for d in range(250)],<br> data = np.random.randint(1, 10, (100, 250)))<br>)<br>model = nsbm()<br>model.make_graph_multiple_df(df, df_key_list)<br>model.fit(n_init=1, B_min=50, verbose=False)<br>model.save_data()</pre><p>Adding more omics is just a matter of appending more tables to `df_key_list`. A couple of things to check in your data: every node needs at least one link, and there should be no duplicate names.</p><h4>Does the extra layer help?</h4><p>To measure how well the sample clusters match the known breast cancer subtypes we used the normalised mutual information (NMI), the same family of scores I described in the V measure post.</p><p><a href="https://medium.com/data-science/v-measure-an-homogeneous-and-complete-clustering-ab5b1823d0ad">V measure: an homogeneous and complete clustering</a></p><p>Adding microRNAs improves the classification: normal and tumour samples separate better, and most of the gain comes from distinguishing Luminal A from Luminal B, two subtypes that are notoriously hard to tell apart [1].</p><p>More data is not always better, though. Adding copy number variations (tetraSBM) lowered the NMI with the subtypes, so this layer seems less informative for this specific task.</p><h4>Topics that mean something</h4><p>A good model should not only classify, it should explain. Some of the microRNA-topics turned out to be biologically meaningful [1]:</p><p>- one topic is dominated by microRNAs from the chr14q32 locus, a region already associated with cancer;<br>- patients with a stronger presence of this topic have a lower survival probability;<br>- another topic is enriched in microRNAs from chr19q13.</p><p>This is the nice part of topic models: the same structure that splits samples into clusters also tells you *which* words, here genes and microRNAs, are responsible for the split.</p><h4>Conclusions</h4><p>The network formulation of topic models is not limited to texts, and not even to a single kind of word. Every omics that can be written as a bag of words becomes a new branch, and the model integrates all of them in one inference. On breast cancer, adding microRNAs to gene expression improved subtype classification and highlighted microRNA groups linked to survival.</p><p>The same idea also works at the single-cell level. In a follow-up work [4] we treated protein-coding genes and long non-coding RNAs as two separate layers to cluster breast cancer cells, and the integrated model distinguished drug-sensitive from drug-resistant cells better than a single layer.</p><h4>Links</h4><p>- The nsbm package: [github.com/fvalle1/nsbm](<a href="https://github.com/fvalle1/nsbm">https://github.com/fvalle1/nsbm</a>)<br>- The analysis of the paper: [github.com/BioPhys-Turin/keywordTCGA](<a href="https://github.com/BioPhys-Turin/keywordTCGA">https://github.com/BioPhys-Turin/keywordTCGA</a>)</p><h4>References</h4><p>[1] Valle F., Osella M., Caselle M.; Multiomics topic modeling for breast cancer classification. Cancers 2022, 14(5) 1150. [doi:10.3390/cancers14051150](<a href="https://doi.org/10.3390/cancers14051150">https://doi.org/10.3390/cancers14051150</a>)</p><p>[2] Valle F., Osella M., Caselle M.; A topic modeling analysis of TCGA breast and lung cancer transcriptomic data. Cancers 2020, 12(12) 3799. [doi:10.3390/cancers12123799](<a href="https://doi.org/10.3390/cancers12123799">https://doi.org/10.3390/cancers12123799</a>)</p><p>[3] Gerlach M. et al.; A network approach to topic models. Science Advances, 2018, 4(7).</p><p>[4] Malagoli G., Valle F., Barillot E., Caselle M., Martignetti L.; Identification of interpretable clusters and associated signatures in breast cancer single-cell data: a topic modeling approach. Cancers 2024, 16(7) 1350. [doi:10.3390/cancers16071350](<a href="https://doi.org/10.3390/cancers16071350">https://doi.org/10.3390/cancers16071350</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac108d9f5c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[topicpy: a Python package for topic modeling]]></title>
            <link>https://filippovalle.medium.com/topicpy-a-python-package-for-topic-modeling-d169dff3459c?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d169dff3459c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[pypi]]></category>
            <category><![CDATA[topic-modeling]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 12:25:24 GMT</pubDate>
            <atom:updated>2026-10-19T12:25:24.945Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NHUPHT9quwcWoXRW" /><figcaption>Photo by <a href="https://unsplash.com/@szolkin?utm_source=medium&amp;utm_medium=referral">Sergey Zolkin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>What to do after the topic model has finished running</h4><p>During my PhD I spent a lot of time running topic models on gene expression data. In a previous post,</p><p><a href="https://filippovalle.medium.com/topic-models-for-cancer-research-5eac9db193c3">Topic models for cancer research</a></p><p>I explained the idea: samples are documents, genes are words, and the expression level of a gene plays the role of the number of times a word appears in a text.</p><p>Running the model is only half of the work. Once it has finished you are left with a folder of tables, and you still need to answer the interesting questions. Do the clusters match the known tissues or cancer subtypes? Are the topics enriched in some biological function? Does one algorithm do better than another?</p><p>I found myself writing the same functions again and again, so at some point I collected them in a package: <em>topicpy</em>. Today I will show what it does and how to use it.</p><h4>Install</h4><p>topicpy is on PyPi</p><p><a href="https://pypi.org/project/topicpy/">Client Challenge</a></p><p>It depends on pandas, scikit-learn, seaborn, gseapy and TensorFlow (used to compute topic distinctiveness for LDA).</p><p>Note that the `converter` module downloads the gene name table from genenames.org when it is imported, so `import topicpy` needs an internet connection.</p><h4>The input format</h4><p>topicpy reads the output of [hSBM](<a href="https://github.com/martingerlach/hSBM_Topicmodel">https://github.com/martingerlach/hSBM_Topicmodel</a>), the hierarchical stochastic block model that treats the sample–gene matrix as a bipartite network. The same format is produced by the `lda` module of the package, so any method can be plugged in as long as it writes the same files.</p><p>Everything lives in one directory:</p><pre>my_analysis/<br>├── files.dat # metadata: one row per sample<br>└── topsbm/<br> ├── topsbm_level_0_clusters.csv # samples in each cluster<br> ├── topsbm_level_0_topics.csv # genes in each topic<br> ├── topsbm_level_0_topic-dist.csv<br> ├── topsbm_level_0_word-dist.csv<br> └── … # one set per hierarchy level</pre><p>`files.dat` is a plain csv whose index is the sample name and whose columns are the labels we want to compare with, for example tissue, subtype or disease type:</p><p>```<br>file_name,primary_site,secondary_site<br>sample_1,Breast,Breast — Mammary Tissue<br>sample_2,Lung,Lung<br>…<br>```</p><p>The name of the subfolder (`topsbm` here) is the `algorithm` argument of most functions, so results from different methods can sit side by side in the same directory.</p><h4>What is inside</h4><p>The package is a collection of small modules:</p><p>- `hsbmpy`: read the model output, compare clusters with the labels, plot.<br>- `lda`: a wrapper around scikit-learn’s `LatentDirichletAllocation` that saves its output in the same format as hSBM.<br>- `geneontology`: gene set enrichment of each topic with [gseapy](<a href="https://github.com/zqfang/gseapy">https://github.com/zqfang/gseapy</a>).<br>- `hypergeom`: hypergeometric tests between two partitions of the same genes.<br>- `tableanalyser`: mean–variance and other scaling laws of an RNA-Seq table.<br>- `gtex`, `TCGA_files`, `converter`: helpers for GTEx and TCGA metadata and for Ensembl ID ↔ gene symbol conversion.</p><h4>Does the clustering make sense?</h4><p>The first question is usually whether the clusters found by the model agree with what we already know about the samples. The natural score here is the V measure (or normalised mutual information), which I explained in [V measure: an homogeneous and complete clustering](<a href="https://filippovalle.medium.com/v-measure-an-homogeneous-and-complete-clustering-ab5b1823d0ad">https://filippovalle.medium.com/v-measure-an-homogeneous-and-complete-clustering-ab5b1823d0ad</a>).</p><p>`get_scores` computes homogeneity, completeness and V measure at every level of the hierarchy and for every label:</p><pre>from topicpy.hsbmpy import get_scores<br>scores = get_scores(&quot;my_analysis&quot;, labels=[&quot;primary_site&quot;, &quot;secondary_site&quot;], algorithm=&quot;topsbm&quot;)<br>scores[&quot;primary_site&quot;][&quot;V&quot;] # V measure, one value per level<br>scores[&quot;primary_site&quot;][&quot;xl&quot;] # number of clusters at each level</pre><p>Since the number of clusters changes from one level to the next, the scores are naturally plotted against the number of clusters. A useful baseline is the same score computed after shuffling the labels, which `get_scores_shuffled` does for you. If you ran more than one algorithm in the same directory, you can collect their scores in one dictionary and draw them together:</p><pre>import matplotlib.pyplot as plt<br>from topicpy.hsbmpy import add_score_lines, customize_metric_plot<br>scores = {<br> &quot;hsbm&quot;: get_scores(&quot;my_analysis&quot;, [&quot;primary_site&quot;], algorithm=&quot;topsbm&quot;)[&quot;primary_site&quot;],<br> &quot;lda&quot;: get_scores(&quot;my_analysis&quot;, [&quot;primary_site&quot;], algorithm=&quot;lda&quot;)[&quot;primary_site&quot;],<br>}<br>fig, ax = plt.subplots(figsize=(18, 12))<br>add_score_lines(ax, scores, labels=[&quot;hsbm&quot;, &quot;lda&quot;])<br>customize_metric_plot(ax, scores[&quot;hsbm&quot;][&quot;xl&quot;])</pre><p>If you prefer another metric, `get_scores` accepts any function from `sklearn.metrics` through the `metric` argument.</p><p>For a full report in one call there is `clusteranalysis`. It loops over levels and labels and saves, as pdf files in the algorithm folder, the composition of each cluster, heatmaps and the same plots for shuffled labels:</p><pre>from topicpy.hsbmpy import clusteranalysis<br>clusteranalysis(&quot;my_analysis&quot;, [&quot;primary_site&quot;, &quot;secondary_site&quot;], algorithm=&quot;topsbm&quot;)</pre><h4>Running LDA with the same output</h4><p>To compare hSBM with a classic method, the `lda` class extends scikit-learn’s `LatentDirichletAllocation` with a `full_analysis` method. It reads `mainTable.csv` (genes on the rows, samples on the columns), fits one model per requested number of topics and writes clusters, topics and distributions in an `lda` folder, ready for the functions above:</p><pre>from topicpy.lda import lda<br>model = lda(verbose=1, n_jobs=8)<br>model.full_analysis(&quot;my_analysis&quot;, xl=[5, 10, 20])</pre><p>Each sample is assigned to the topic with the highest weight, so that LDA also produces a clustering. Topics are ranked by how distinctive each gene is, measured with the Kullback–Leibler divergence between topics.</p><h4>What are the topics about?</h4><p>A topic is a list of genes, so the obvious next step is a gene set enrichment test. `topic_analysis` converts the Ensembl IDs to gene symbols, queries [Enrichr](<a href="https://maayanlab.cloud/Enrichr/">https://maayanlab.cloud/Enrichr/</a>) through gseapy for each topic, and saves the significant terms as csv files:</p><pre>from topicpy.geneontology import topic_analysis<br>topic_analysis(&quot;my_analysis&quot;, l=1, algorithm=&quot;topsbm&quot;)</pre><p>For a single list of genes you can call `get_ontology_df(genes)` directly. By default it tests GO, KEGG, Human Phenotype Ontology and GTEx tissue gene sets, among others.</p><h4>Comparing two partitions of genes</h4><p>Sometimes you want to know whether the topics found by one method overlap with the gene modules found by another, for example hSBM against [WGCNA](<a href="https://doi.org/10.1186/1471-2105-9-559">https://doi.org/10.1186/1471-2105-9-559</a>). The `hypergeom` module does a hypergeometric test for every pair of groups:</p><pre>import pandas as pd<br>from topicpy.hypergeom import parameters_for_hypergeometric, build_map, plot_map<br># index: gene, value: the group the gene belongs to<br>topics = pd.read_csv(&quot;hsbm_gene_topics.csv&quot;, index_col=0).squeeze()<br>modules = pd.read_csv(&quot;wgcna_gene_modules.csv&quot;, index_col=0).squeeze()<br>df_cmap = build_map(*parameters_for_hypergeometric(topics, modules))<br>plot_map(df_cmap, first_name=&quot;hSBM&quot;, last_name=&quot;WGCNA&quot;)</pre><p>The map shows −log10 of the P-value for each pair, so a dark cell marks a topic and a module that share more genes than expected by chance.</p><h4>Conclusions</h4><p>topicpy is not a topic model. It is the toolbox I used around topic models, so that the same analysis can be repeated on a new dataset, or with a new algorithm, by changing one folder name. It grew together with my research, so some functions are quite specific to GTEx and TCGA data, but the scoring, enrichment and comparison parts work with any clustering of samples and any grouping of genes.</p><p>If you use it and something breaks, issues and pull requests are welcome.</p><h4>Code</h4><ul><li><a href="https://github.com/fvalle1/topicpy">GitHub - fvalle1/topicpy: Python package for topic modelling</a></li><li><a href="https://topicpy.readthedocs.io/en/latest/">Welcome to topicpy&#39;s documentation! - topicpy 0.2.0 documentation</a></li><li><a href="https://pypi.org/project/topicpy/">Client Challenge</a></li></ul><h4>References</h4><p>- Gerlach M., Peixoto T. P., Altmann E. G. *A network approach to topic models*. Science Advances (2018). [doi:10.1126/sciadv.aaq1360](<a href="https://doi.org/10.1126/sciadv.aaq1360">https://doi.org/10.1126/sciadv.aaq1360</a>)<br>- Valle F., Osella M., Caselle M. *A Topic Modeling Analysis of TCGA Breast and Lung Cancer Transcriptomic Data*. Cancers (2020). [doi:10.3390/cancers12123799](<a href="https://doi.org/10.3390/cancers12123799">https://doi.org/10.3390/cancers12123799</a>)<br>- Valle F., Osella M., Caselle M. *Multiomics Topic Modeling for Breast Cancer Classification*. Cancers (2022). [doi:10.3390/cancers14051150](<a href="https://doi.org/10.3390/cancers14051150">https://doi.org/10.3390/cancers14051150</a>)<br>- Valle F., Caselle M., Osella M. *Exploring the latent space of transcriptomic data with topic modeling*. NAR Genomics and Bioinformatics (2025). [doi:10.1093/nargab/lqaf049](<a href="https://doi.org/10.1093/nargab/lqaf049">https://doi.org/10.1093/nargab/lqaf049</a>)<br>- Rosenberg A., Hirschberg J. *V-Measure: A Conditional Entropy-Based External Cluster Evaluation Measure*. EMNLP-CoNLL (2007).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d169dff3459c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chat with your GPX]]></title>
            <link>https://filippovalle.medium.com/chat-with-your-gpx-882ae54a11f2?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/882ae54a11f2</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[gpx]]></category>
            <category><![CDATA[chat]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 17:41:01 GMT</pubDate>
            <atom:updated>2026-10-06T17:41:01.556Z</atom:updated>
            <content:encoded><![CDATA[<h4>A simple MCP server for touching the grass</h4><p>An open-source assistant that answers questions about your Komoot activities using statistics computed from the raw GPS data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i6zlSylyRGz385AlS4xehw.png" /></figure><p>I have logged hikes, runs, and bike rides on Komoot for years. The app shows distance and elevation for each tour, but answering broader questions is harder: which month did I climb the most, how does my pace on recent hikes compare with last year, how much total elevation have I accumulated? I wanted to ask these questions in plain language, so I built chatGPX.</p><h3>What it does</h3><p>chatGPX is a small web app. You log in with your Komoot account, the app downloads your tours as GPX files, and you can chat with an LLM that has access to that data. The goal is to make past outings easier to review and to plan the next one with a clearer picture of what you have already done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKGtnYYHpiv9LZVWUELo9w.png" /></figure><h3>How it is built</h3><p>The core is an MCP (Model Context Protocol) server that exposes the activity data as tools:</p><p>- list_activities and read_activity for browsing tours and reading raw GPX<br>- get_activity_stats for per-activity figures<br>- get_stats_summary for totals and monthly breakdowns<br>- summarize and an optional generate_activity_video for summaries and short flyover clips from a self-hosted Cosmos3-Nano server</p><p>A chat backend connects to this server and passes its tools to the LLM as function calls. It works with any OpenAI-compatible provider that supports tool calling, configured through environment variables. Syncing relies on the open-source KomootGPX library, included as a git submodule. The web app is a small server with a static frontend, and everything runs with “docker compose up — build”.</p><p>The MCP server can also run over streamable-http, so any other MCP client can use the same tools without the web app.</p><p>Try it</p><p><a href="https://github.com/fvalle1/chatgpx">GitHub - fvalle1/chatGPX</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=882ae54a11f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hierarchical clustering in Tensorflow]]></title>
            <link>https://filippovalle.medium.com/hierarchical-clustering-in-tensorflow-af51368e19fd?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/af51368e19fd</guid>
            <category><![CDATA[hopfield-network]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Thu, 04 Dec 2025 12:52:09 GMT</pubDate>
            <atom:updated>2025-12-04T12:52:09.569Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dZSePnlZjWAiGPr4" /><figcaption>Photo by <a href="https://unsplash.com/@edvardr?utm_source=medium&amp;utm_medium=referral">Edvard Alexander Rølvaag</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>The most famous algorithm with the most famous framework</h4><h4>Distances</h4><pre>def distance(data, name=&quot;distances&quot;):<br>    return tf.map_fn(lambda A: tf.map_fn(lambda B: tf.norm(A-B), data), data, name = name)</pre><h4>Linkage</h4><pre>def get_linkage(first, second, name=&quot;linkage&quot;):<br>    return tf.reduce_mean([first, second], axis=0, name=name)</pre><h3>Algorithm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*emAroY3f3-eMA__nbC20Bw.png" /><figcaption>Image by Author.</figcaption></figure><h4>Minimal distance</h4><pre>actual_minimums = tf.sort(tf.sort(tf.where(tf.equal(tf.reduce_min(nddistances),distances)), axis=1), axis=0, name=&quot;assignements&quot;)[0]</pre><h4>New position</h4><p>The position of the newly created point is estimated by the linkage function.</p><pre>new_pos = get_linkage(new_data[actual_minimums[0]],new_data[actual_minimums[1]], name=”linkage”)</pre><h4>Z matrix</h4><p>In order to compare the results with other approaches, we can build a <strong>Z-matrix</strong>. It contains N rows (with N the number of points) with four entries: <strong>original cluster A</strong>, <strong>original cluster B</strong>, <strong>distance</strong> and <strong>new cluster</strong>.</p><pre>Z.append(tf.stack([original_cluster_indexes[0], original_cluster_indexes[1], min_distance, current_size],0).numpy())</pre><h3>Output</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*7pKGqgXtGeUk6kM4qnJJ2g.png" /><figcaption>Image by Author.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*0_AGg_anKQ7Mwgme0IhD4Q.png" /><figcaption>Image by Author.</figcaption></figure><h3>Code</h3><p>Go and run hierarchical clustering with this new tool on GitHub.</p><p><a href="https://github.com/fvalle1/hierarchical_clustering_tensorflow">GitHub - fvalle1/hierarchical_clustering_tensorflow: Hierarchical clustering in tensorflow</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af51368e19fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apple Home controls Arduino]]></title>
            <link>https://filippovalle.medium.com/apple-home-controls-arduino-3acd7e021650?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3acd7e021650</guid>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[home]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Wed, 05 Nov 2025 12:46:01 GMT</pubDate>
            <atom:updated>2025-11-05T12:46:01.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xjCPC1A_JnB6NdBS" /><figcaption>Photo by <a href="https://unsplash.com/@insolitus?utm_source=medium&amp;utm_medium=referral">Rowan Heuvel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>A domotic approach to IoT</h4><p>I will use a Python API to control an Arduino</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYBjmJ9E4UWH5ezOWToeLA.jpeg" /></figure><p>I have looked at <a href="https://homebridge.io/">homebridge.io</a> and its <a href="https://www.npmjs.com/package/homebridge-web-switch">Web switch plugin</a></p><pre>&quot;accessories&quot;: [<br>{<br> &quot;accessory&quot;: &quot;WebSwitch&quot;,<br> &quot;name&quot;: &quot;Switch&quot;,<br> &quot;apiroute&quot;: &quot;http://localhost&quot;<br>}<br>]</pre><h3>API</h3><p>Flask app</p><pre>from flask import Flask<br>app = Flask(__name__)</pre><pre># all the code here</pre><pre>app.run(host=&quot;0.0.0.0&quot;)</pre><p>Receive requests</p><pre>@app.route(&quot;/setStatus/{state}&quot;)<br>def get_state(state):<br>    set_arduino_status(state)</pre><p>Serial communication</p><pre>print(list(serial.tools.list_ports.comports())) </pre><pre>port = serial.Serial(&quot;/dev/ttyACM0&quot;,9600) <br>#wait Arduino to reset<br>time.sleep(3)</pre><p>Write to serial</p><pre>def set_arduino_status(state):<br>    port.write(state)</pre><h4>Arduino code</h4><pre>void doStuff(char msg){<br>  switch (msg){<br>    case &#39;0&#39;:<br>      led.turnOff();<br>      break;<br>    case &#39;1&#39;:<br>      led.turnOn();<br>      break;<br>    default:<br>      break;<br>  }<br>}</pre><pre>void serialEvent() {<br>  while (Serial.available()) {<br>    // get the new byte:<br>    char inChar = (int)Serial.read();<br>    //Serial.write(inChar);<br>    <br>    doStuff(inChar);<br>  }<br>}</pre><p>Controls from Apple Home</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*-xMQGfofNmTaog-UEkB9Mw.png" /></figure><h3>This seems familiar, right?</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FonZ4KMM94yI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DonZ4KMM94yI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FonZ4KMM94yI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d91e08ca599939212ed635ed03bacf2e/href">https://medium.com/media/d91e08ca599939212ed635ed03bacf2e/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3acd7e021650" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install e/os on a Samsung Galaxy]]></title>
            <link>https://filippovalle.medium.com/install-e-os-on-a-samsung-galaxy-7105679d0a03?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7105679d0a03</guid>
            <category><![CDATA[samsung]]></category>
            <category><![CDATA[eos]]></category>
            <category><![CDATA[google-play-services]]></category>
            <category><![CDATA[lineageos]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Fri, 03 Oct 2025 10:39:41 GMT</pubDate>
            <atom:updated>2025-10-03T10:40:55.234Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*avi585gtFnzfCLgX" /><figcaption>Photo by <a href="https://unsplash.com/@purzlbaum?utm_source=medium&amp;utm_medium=referral">Claudio Schwarz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>A complete, fully “deGoogled”, mobile ecosystem</h4><p>Today we will install /e/os on a samsung galaxy</p><h3><a href="https://e.foundation/e-os/">https://e.foundation</a></h3><h4>ODIN</h4><p>We need a tool called ODIN to flash the mobile phone</p><p><a href="https://odindownload.com/">Download Odin 3.13.1 - Samsung Odin download with ROM Flashing Tool</a></p><h4>Install a new SO on your phone</h4><p>Enable Developer setting by tapping 7 times the Build number in Settings-&gt;About Phone</p><h4>Reboot in Download mode</h4><ol><li>Turn off the phone. Hold volume up and down simultaneously while connecting phone to USB-C cable (which is connected to your computer)</li><li>Read the text and long hold volume up to unlock bootloader. That will erase your phone so backup stuff before.</li><li>After factory reset, you have to connect to the internet and turn on developer options once again. Wait a while until you see that “OEM unlocking” option appears and it’s greyed out.</li></ol><h4>TWRP</h4><p>Using ODIND we need to flash TWRP into the mobile phone.<br>Download the image for your phone from <a href="https://twrp.me/">https://twrp.me/</a></p><p>Use ODIN to flash it to your phone. Be careful <strong>disable auto-reboot</strong> from the options tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-aszzoDkiK_Ayb21B_hlw.png" /><figcaption>Screenshot of ODIN. Image by Author.</figcaption></figure><h4>Error validating data</h4><p>At this point I felt into an “Error validating data”. But thanks to <a href="https://xdaforums.com/t/resolving-error-validating-footer-issue-and-disabling-encryption-on-the-galaxy-a10.4657647/">this guide</a> I flashed the correct file and I was back on track.</p><h4>Reboot in Recovery mode</h4><ol><li>Turn off the phone and connect to computer while holding volume up and power. This time short press volume up to enter download mode</li><li>You will enter TWRP. Go to wipe — format data and write yes. After that go to reboot and click reboot to recovery again</li></ol><h4>Use TWRP to flash the OS</h4><p>My Samsung Galaxy A40 unfortunately was not a supported device, but I found a compatible file made by the community: <a href="https://community.e.foundation/t/unofficial-builds-samsung-galaxy-a10-a20-a30-a40-a10-a10dd-a20-a20e-a30-a30s-a40-series-with-exynos-7885-chipset-for-e-os-u/66086/14">https://community.e.foundation/t/unofficial-builds-samsung-galaxy-a10-a20-a30-a40-a10-a10dd-a20-a20e-a30-a30s-a40-series-with-exynos-7885-chipset-for-e-os-u/66086/14</a></p><ol><li>Transfer <em>e-3.0-t-20240514-UNOFFICIAL-a40e.zip</em> to phone storage.</li><li>Install zip and reboot.</li></ol><h4>/e/os finally running</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*HRVp9LXcfVSt8QK5hWPM9g.jpeg" /><figcaption>Lock screen of /e/os. Image by Author.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*E9zt6S0TD0fp4xTw5JKXLQ.jpeg" /><figcaption>Settings of /e/os. Image by author.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*-d1IAIwodQff1zerAG2B0A.jpeg" /><figcaption>Details in Settings. Image by Author.</figcaption></figure><h4>F-droid</h4><p><a href="https://f-droid.org/">F-Droid - Free and Open Source Android App Repository</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*DR6GeYMIPZhAE_qgWbPN7A.jpeg" /><figcaption>F-droid. Image by author.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7105679d0a03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Se l’IA è altamente energivora distribuiamo lo sforzo computazionale]]></title>
            <link>https://filippovalle.medium.com/se-lia-%C3%A8-altamente-energivora-distribuiamo-lo-sforzo-computazionale-6847d66bb042?source=rss-cbc83485b57b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6847d66bb042</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[energia]]></category>
            <dc:creator><![CDATA[Filippo Valle]]></dc:creator>
            <pubDate>Thu, 19 Jun 2025 07:45:22 GMT</pubDate>
            <atom:updated>2025-06-19T07:45:22.369Z</atom:updated>
            <content:encoded><![CDATA[<p>Questo saggio è stato scritto per il numero N. 529–531 gennaio-marzo 2025 — Anno 46° Nuova Serie della rivista Tempo presente (<a href="https://tempopresenterivista.altervista.org/e-uscito-il-numero-529-531-di-tempo-presente-dedicato-monograficamente-al-tema-focus-intelligenza-artificiale-lenigma-della-singolarita-e-le-leve-umane-per-la-conoscenza/">http://tempopresenterivista.eu</a>)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.canva.com%2Fdesign%2FDAGqx7L0CtM%2FTm4b1MWIdqMwtramnFEzOg%2Fview%3Fembed%26meta&amp;display_name=Canva&amp;url=https%3A%2F%2Fwww.canva.com%2Fdesign%2FDAGqx7L0CtM%2FTm4b1MWIdqMwtramnFEzOg%2Fview&amp;image=https%3A%2F%2Fstatic.canva.com%2Fstatic%2Fimages%2Ffb_cover-1.jpg&amp;type=text%2Fhtml&amp;schema=canva" width="605" height="851" frameborder="0" scrolling="no"><a href="https://medium.com/media/ede6724e4cdddc61528a5b8ae68c63b0/href">https://medium.com/media/ede6724e4cdddc61528a5b8ae68c63b0/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6847d66bb042" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>