Persistent Homology | Introduction & Python Example Code

  Рет қаралды 15,675

Shaw Talebi

Shaw Talebi

Күн бұрын

Пікірлер: 56
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
More in this series 👇 - Introduction to TDA: kzbin.info/www/bejne/nKGvZpmDoq97p80 - Mapper: kzbin.info/www/bejne/hJ2wo6l5jtGChbM
@aberobwohl
@aberobwohl 4 ай бұрын
Fascinating video on applying persistent homology to market analysis! I noticed two potential data leakage issues that could affect the results: In the initial data preparation (around line 29), the log-returns are calculated using future prices: r = np.log(np.divide(P[1:],P[:len(P)-1])). This means each return uses the next day's price, which wouldn't be known at the time. In the Wasserstein distance calculation loop (around line 46), the second time window r[i+w+1:i+(2*w)+1] uses future data that wouldn't be available at the prediction time. To fix these, you could calculate returns using only past data and adjust the second window to r[i+1:i+w+1]. These changes would ensure the analysis only uses information available at each point in time. Great work exploring these advanced techniques! Looking forward to seeing more.
@ShawhinTalebi
@ShawhinTalebi 4 ай бұрын
Thanks for the notes! I'll need to revisit this work to confirm there are no leaks as well as apply it to other time series.
@yxoxz
@yxoxz 2 жыл бұрын
Best video on persistent homology for a newbie like me
@masonholcombe3327
@masonholcombe3327 Жыл бұрын
For real
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Glad it was helpful!
@AmirhosseinHaydarzadehFakhraba
@AmirhosseinHaydarzadehFakhraba 6 күн бұрын
Very helpful and simple to understand, thanks a lot Shaw!!🙏🙏🙏🙏
@acerbic-piglet
@acerbic-piglet Жыл бұрын
Excellent video. Well organized, presented, and explained. As a mathematician, I have one small nitpick. At 2:58, you use the torus/coffee mug as an example of H_1 = 1. In most mathematical settings, a mathematician referring to a torus as a space would really mean the *surface* of a donut. The surface of a donut, a torus, is actually very different from a simple cycle. H_1(T) has rank 2, and H_2(T) has rank 1. Some refer to this as a "Solid Torus" but solid tori usually do not come up much. Honestly, this is a very common mishap that probably is us mathematician's fault for using the "donut coffee mug" meme too often and calling them tori without getting into the weeds of what is meant.
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Thanks for pointing that out. I'm clearly not a mathematician 😂, but I see why it's important to distinguish between a "solid torus" and a torus.
@ging995
@ging995 2 жыл бұрын
Love it! Great way to explain it sensei Shawhin!
@ShawhinTalebi
@ShawhinTalebi 2 жыл бұрын
Thanks appreciate it! I’m glad it was clear
@ifycadeau
@ifycadeau 2 жыл бұрын
Yay!! Love this series
@ShawhinTalebi
@ShawhinTalebi 2 жыл бұрын
Thanks for watching!
@user-wr4yl7tx3w
@user-wr4yl7tx3w 4 ай бұрын
Great content. Fascinating.
@benedicttiu2919
@benedicttiu2919 Жыл бұрын
Love all your videos on data, so well explained and makes complex topics so simple to understand! Thanks so much!!! 🔥
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Thanks for watching! Glad they were helpful 😁
@chefmemesupreme
@chefmemesupreme 9 ай бұрын
Friendly intro, i recommend having a practical full proven useful example in hand as well
@ShawhinTalebi
@ShawhinTalebi 9 ай бұрын
Glad it was accessible. This took me a long time to wrap my head around 😅
@TheTessatje123
@TheTessatje123 Жыл бұрын
Thanks! Great video. When you've computed the homology groups (H0, H1, H2) of all data points over increasing values for ε (a ball around points) 7:03, how do you plot them in the persistance diagram 8:52? Does each point represent a connected component (H0), loop (H1) or enclosed surface (H2)? If its on the diagonal then it is born and dies relatively shortly after each other? And in the code example you are only considering one homology group, so either H0, H1 or H2 12:10?
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Hi Tessa, thanks for the questions. 1) In the persistence diagram, each point represents a different "hole". Connected components are blue points, loops are orange, and voids are in green. This is shown in the legend in the bottom right hand corner of the plot. 2) Yes, exactly. So those features are typically regarded as noise 3) For the example, I am actually considering H0, H1, and H2. We can see this from the input argument maxdim=2 in Rips() (1st line in 12:10). For more details check out the Class definition here: github.com/scikit-tda/ripser.py/blob/master/ripser/ripser.py Hope that helps!
@TheTessatje123
@TheTessatje123 Жыл бұрын
@@ShawhinTalebi Hey! Yes, this really helps, thanks a lot! It's interesting to see how topology/homology gets practical use ;-)
@elyasheidari9473
@elyasheidari9473 2 жыл бұрын
Thanks Shawhin!
@ShawhinTalebi
@ShawhinTalebi 2 жыл бұрын
Thank you for watching!
@neurotrader888
@neurotrader888 11 ай бұрын
Great video series. Nice job.
@ShawhinTalebi
@ShawhinTalebi 11 ай бұрын
Thanks, glad you like them!
@KongQuestCo
@KongQuestCo Жыл бұрын
You did a great job explaining a complex topic👏👏👏👏
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Thanks, glad it helped!
@yjhbsk
@yjhbsk 2 ай бұрын
great video! but i dont understand the part where u mention to ignore the blue topological feature at 8:25. can u rephrase your sentence?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
Good question. The blue features represent the birth/death of fully connected components (which are basically clusters in this example). That blue point at the top-left corner of the plot represents the cluster of all data points, which doesn't tell us much about the data's shape.
@training7574
@training7574 9 ай бұрын
Fascinating and beautiful, thanks. But there will always be some pattern in data. The question is whether past structures help predict future ones. And would we understand why some past structure leads the real world changes? Practically all indicators in technical analysis rely on some kind of causal hypothesis that would help explain its predictive success (if such there be....)
@ShawhinTalebi
@ShawhinTalebi 9 ай бұрын
This is an important question and where I feel the "art of data science" comes in. Data science requires a unique blend of technical understanding and domain expertise to distinguish which patterns are signal (i.e. helpful) vs noise (i.e. not helpful).
@rythemofgermay5590
@rythemofgermay5590 10 ай бұрын
really helpful
@ShawhinTalebi
@ShawhinTalebi 10 ай бұрын
Glad it helped :)
@yongdahuang5188
@yongdahuang5188 2 жыл бұрын
Thanks.
@ShawhinTalebi
@ShawhinTalebi 2 жыл бұрын
My pleasure!
@CarlosPalmaArzubialde
@CarlosPalmaArzubialde Жыл бұрын
Thanks!
@ShrutiBhatporia
@ShrutiBhatporia 8 ай бұрын
Thanks for the video. Could you draw any parallels between mapper and PH diagrams? For example, would cover in mapper be similar to ε?
@ShawhinTalebi
@ShawhinTalebi 8 ай бұрын
Perhaps I haven't thought about it deeply enough, but from my experience it feels the approaches have very little (if any) overlap.
@kirekadan
@kirekadan 9 ай бұрын
You need to write an article in the medium about persistent homology.
@ShawhinTalebi
@ShawhinTalebi 9 ай бұрын
It exists! medium.datadriveninvestor.com/persistent-homology-f22789d753c4?sk=c0925c51c31f5136abf362829c755146
@kirekadan
@kirekadan 9 ай бұрын
I love it@@ShawhinTalebi
@felixmartinez5056
@felixmartinez5056 Жыл бұрын
Thank you for the video. I have a question, when you plot the persistance diagram what are the units that the birth and death axes use?
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Good question! The units depend on your dataset because the axes have units of a "distance" in the N-dimensional space defined by your variables. A trivial example is if we have 3 variables, say, x, y, and z positions in a 3D grid in units of cm, the the axes would also have units of cm. However, if the 3 variables were something like: weight, height, and top speed (like a car) then the units wouldn't be very meaningful.
@felixmartinez5056
@felixmartinez5056 Жыл бұрын
@@ShawhinTalebi Thank you!
@kieserel
@kieserel Жыл бұрын
Is there any meaning behind using days as points, instead of using series of prices itself as points? It seems kinda weird that when calculating persistent homologies we're growing radii of balls centered around points in time
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
Good question. While it it does depend strongly on context, applying persistent homology to a raw time series may not be informative. A simple thing one can do, however, is increase the dimensionality of the data through a time delay embedding.
@arvoli2596
@arvoli2596 2 жыл бұрын
Nice nice nice
@ShawhinTalebi
@ShawhinTalebi 2 жыл бұрын
🙌🙌
@kurokane528
@kurokane528 Жыл бұрын
Is there a paper or a resource for the last example?
@ShawhinTalebi
@ShawhinTalebi Жыл бұрын
The example here is unpublished work, but it was inspired by this paper: arxiv.org/abs/1703.04385
@younique9710
@younique9710 4 ай бұрын
Thank you for that great video! One quick question I have is, how many data points at least should we have for the analysis for a reliable result?
@ShawhinTalebi
@ShawhinTalebi 4 ай бұрын
I am not aware of any formal technique for determining sample size (persistent homology is more art than science), so it probably varies from use case to use case.
@younique9710
@younique9710 4 ай бұрын
@@ShawhinTalebi Thank you for your comment!
The Mapper Algorithm | Overview & Python Example Code
13:50
Shaw Talebi
Рет қаралды 13 М.
Topological Data Analysis (TDA) | An introduction
7:42
Shaw Talebi
Рет қаралды 19 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 53 МЛН
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 5 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
Introduction to Persistent Homology
8:46
Matthew Wright
Рет қаралды 19 М.
Applied topology 8: An introduction to persistent homology
11:41
Applied Algebraic Topology Network
Рет қаралды 9 М.
FTDA : INTRO to TOPOLOGICAL DATA ANALYSIS
5:38
Prof Ghrist Math
Рет қаралды 12 М.
Introduction to Persistent Homology
8:46
Matthew Wright
Рет қаралды 54 М.
Multimodal Embeddings: Introduction & Use Cases (with Python)
24:38
Building Better Predictive Models Using Topology
24:02
Symphony Sensa
Рет қаралды 16 М.
I Tried 50 Data Analyst Courses. Here Are Top 5
8:41
Stefanovic
Рет қаралды 129 М.
Gunnar Carlsson: "Topological Modeling of Complex Data"
54:42
Joint Mathematics Meetings
Рет қаралды 21 М.
TDA Mapper Part 1:  Introduction
8:12
Isabel K. Darcy
Рет қаралды 3,5 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 53 МЛН