TGViewer
Machine Learning with Python Machine Learning with Python @codeprogrammer ยท 68.6K subscribers
Post #3769 7.68K
๐—ฃ๐—ฟ๐—ถ๐—ป๐—ฐ๐—ถ๐—ฝ๐—ฎ๐—น ๐—–๐—ผ๐—บ๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐—ถ๐˜€ (๐—ฃ๐—–๐—”)
๐—ง๐—ต๐—ฒ ๐—”๐—ฟ๐˜ ๐—ผ๐—ณ ๐—ฅ๐—ฒ๐—ฑ๐˜‚๐—ฐ๐—ถ๐—ป๐—ด ๐——๐—ถ๐—บ๐—ฒ๐—ป๐˜€๐—ถ๐—ผ๐—ป๐˜€ ๐—ช๐—ถ๐˜๐—ต๐—ผ๐˜‚๐˜ ๐—Ÿ๐—ผ๐˜€๐—ถ๐—ป๐—ด ๐—œ๐—ป๐˜€๐—ถ๐—ด๐—ต๐˜๐˜€

๐—ช๐—ต๐—ฎ๐˜ ๐—˜๐˜…๐—ฎ๐—ฐ๐˜๐—น๐˜† ๐—œ๐˜€ ๐—ฃ๐—–๐—”?
โคท ๐—ฃ๐—–๐—” is a ๐—บ๐—ฎ๐˜๐—ต๐—ฒ๐—บ๐—ฎ๐˜๐—ถ๐—ฐ๐—ฎ๐—น ๐˜๐—ฒ๐—ฐ๐—ต๐—ป๐—ถ๐—พ๐˜‚๐—ฒ used to transform a ๐—ต๐—ถ๐—ด๐—ต-๐—ฑ๐—ถ๐—บ๐—ฒ๐—ป๐˜€๐—ถ๐—ผ๐—ป๐—ฎ๐—น dataset into fewer dimensions, while retaining as much ๐˜ƒ๐—ฎ๐—ฟ๐—ถ๐—ฎ๐—ฏ๐—ถ๐—น๐—ถ๐˜๐˜† (๐—ถ๐—ป๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป) as possible.
โคท Think of it as โ€œ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ป๐—ดโ€ data, similar to how we reduce the size of an image without losing too much detail.

๐—ช๐—ต๐˜† ๐—จ๐˜€๐—ฒ ๐—ฃ๐—–๐—” ๐—ถ๐—ป ๐—ฌ๐—ผ๐˜‚๐—ฟ ๐—ฃ๐—ฟ๐—ผ๐—ท๐—ฒ๐—ฐ๐˜๐˜€?
โคท ๐—ฆ๐—ถ๐—บ๐—ฝ๐—น๐—ถ๐—ณ๐˜† your data for ๐—ฒ๐—ฎ๐˜€๐—ถ๐—ฒ๐—ฟ ๐—ฎ๐—ป๐—ฎ๐—น๐˜†๐˜€๐—ถ๐˜€ and ๐—บ๐—ผ๐—ฑ๐—ฒ๐—น๐—ถ๐—ป๐—ด
โคท ๐—˜๐—ป๐—ต๐—ฎ๐—ป๐—ฐ๐—ฒ machine learning models by reducing ๐—ฐ๐—ผ๐—บ๐—ฝ๐˜‚๐˜๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ฐ๐—ผ๐˜€๐˜
โคท ๐—ฉ๐—ถ๐˜€๐˜‚๐—ฎ๐—น๐—ถ๐˜‡๐—ฒ multi-dimensional data in 2๐—— or 3๐—— for insights
โคท ๐—™๐—ถ๐—น๐˜๐—ฒ๐—ฟ ๐—ผ๐˜‚๐˜ ๐—ป๐—ผ๐—ถ๐˜€๐—ฒ and uncover hidden patterns in your data

๐—ง๐—ต๐—ฒ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—ผ๐—ณ ๐—ฃ๐—ฟ๐—ถ๐—ป๐—ฐ๐—ถ๐—ฝ๐—ฎ๐—น ๐—–๐—ผ๐—บ๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜๐˜€
โคท The ๐—ณ๐—ถ๐—ฟ๐˜€๐˜ ๐—ฝ๐—ฟ๐—ถ๐—ป๐—ฐ๐—ถ๐—ฝ๐—ฎ๐—น ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜ is the direction in which the data varies the most.
โคท Each subsequent component represents the ๐—ป๐—ฒ๐˜…๐˜ ๐—ต๐—ถ๐—ด๐—ต๐—ฒ๐˜€๐˜ ๐—ฟ๐—ฎ๐˜๐—ฒ of variance, but is ๐—ผ๐—ฟ๐˜๐—ต๐—ผ๐—ด๐—ผ๐—ป๐—ฎ๐—น (๐˜‚๐—ป๐—ฐ๐—ผ๐—ฟ๐—ฟ๐—ฒ๐—น๐—ฎ๐˜๐—ฒ๐—ฑ) to the previous one.
โคท The challenge is selecting how many components to keep based on the ๐˜ƒ๐—ฎ๐—ฟ๐—ถ๐—ฎ๐—ป๐—ฐ๐—ฒ they explain.

๐—ฃ๐—ฟ๐—ฎ๐—ฐ๐˜๐—ถ๐—ฐ๐—ฎ๐—น ๐—˜๐˜…๐—ฎ๐—บ๐—ฝ๐—น๐—ฒ

1: ๐—–๐˜‚๐˜€๐˜๐—ผ๐—บ๐—ฒ๐—ฟ ๐—ฆ๐—ฒ๐—ด๐—บ๐—ฒ๐—ป๐˜๐—ฎ๐˜๐—ถ๐—ผ๐—ป
Imagine youโ€™re working on a project to ๐˜€๐—ฒ๐—ด๐—บ๐—ฒ๐—ป๐˜ customers for a marketing campaign, with data on spending habits, age, income, and location.
โคท Using ๐—ฃ๐—–๐—”, you can reduce these four variables into just ๐˜๐˜„๐—ผ ๐—ฝ๐—ฟ๐—ถ๐—ป๐—ฐ๐—ถ๐—ฝ๐—ฎ๐—น ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜๐˜€ that retain 90% of the variance.
โคท These two new components can then be used for ๐—ธ-๐—บ๐—ฒ๐—ฎ๐—ป๐˜€ clustering to identify distinct customer groups without dealing with the complexity of all the original variables.

๐—ง๐—ต๐—ฒ ๐—ฃ๐—–๐—” ๐—ฃ๐—ฟ๐—ผ๐—ฐ๐—ฒ๐˜€๐˜€ โ€” ๐—ฆ๐˜๐—ฒ๐—ฝ-๐—•๐˜†-๐—ฆ๐˜๐—ฒ๐—ฝ
โคท ๐—ฆ๐˜๐—ฒ๐—ฝ ๐Ÿญ: ๐——๐—ฎ๐˜๐—ฎ ๐—ฆ๐˜๐—ฎ๐—ป๐—ฑ๐—ฎ๐—ฟ๐—ฑ๐—ถ๐˜‡๐—ฎ๐˜๐—ถ๐—ผ๐—ป
Ensure your data is on the same scale (e.g., mean = 0, variance = 1).
โคท ๐—ฆ๐˜๐—ฒ๐—ฝ ๐Ÿฎ: ๐—–๐—ผ๐˜ƒ๐—ฎ๐—ฟ๐—ถ๐—ฎ๐—ป๐—ฐ๐—ฒ ๐— ๐—ฎ๐˜๐—ฟ๐—ถ๐˜…
Calculate how features are correlated.
โคท ๐—ฆ๐˜๐—ฒ๐—ฝ ๐Ÿฏ: ๐—˜๐—ถ๐—ด๐—ฒ๐—ป ๐——๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ผ๐˜€๐—ถ๐˜๐—ถ๐—ผ๐—ป
Compute the eigenvectors and eigenvalues to determine the principal components.
โคท ๐—ฆ๐˜๐—ฒ๐—ฝ ๐Ÿฐ: ๐—ฆ๐—ฒ๐—น๐—ฒ๐—ฐ๐˜ ๐—–๐—ผ๐—บ๐—ฝ๐—ผ๐—ป๐—ฒ๐—ป๐˜๐˜€
Choose the top-k components based on the explained variance ratio.
โคท ๐—ฆ๐˜๐—ฒ๐—ฝ ๐Ÿฑ: ๐——๐—ฎ๐˜๐—ฎ ๐—ง๐—ฟ๐—ฎ๐—ป๐˜€๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป
Transform your data onto the new ๐—ฃ๐—–๐—” space with fewer dimensions.

๐—ช๐—ต๐—ฒ๐—ป ๐—ก๐—ผ๐˜ ๐˜๐—ผ ๐—จ๐˜€๐—ฒ ๐—ฃ๐—–๐—”
โคท ๐—ฃ๐—–๐—” is not suitable when the dataset contains ๐—ป๐—ผ๐—ป-๐—น๐—ถ๐—ป๐—ฒ๐—ฎ๐—ฟ ๐—ฟ๐—ฒ๐—น๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐˜€๐—ต๐—ถ๐—ฝ๐˜€ or ๐—ต๐—ถ๐—ด๐—ต๐—น๐˜† ๐˜€๐—ธ๐—ฒ๐˜„๐—ฒ๐—ฑ ๐—ฑ๐—ฎ๐˜๐—ฎ.
โคท For non-linear data, consider ๐—ง-๐—ฆ๐—ก๐—˜ or ๐—ฎ๐˜‚๐˜๐—ผ๐—ฒ๐—ป๐—ฐ๐—ผ๐—ฑ๐—ฒ๐—ฟ๐˜€ instead.

https://whatsapp.com/channel/0029VaC7Weq29753hpcggW2A ๐Ÿ“ฑ
  • ๐Ÿ‘ 8
  • โค 7
More from @codeprogrammer
  1. Oct 13, 2026https://substack.com/@husseinsheikho?utm_source=share&utm_medium=android&r=3hwnr8 Follow mโ€ฆ
  2. Oct 13, 2026๐Ÿ”– A Comprehensive Resource for Machine Learning Practice The platform offers: ๐Ÿซก 1200+ maโ€ฆ
  3. Oct 12, 2026๐Ÿš€ RESEARCH & DIGITAL SOLUTIONS โ€” YOUR PARTNER IN SUCCESS! Are you a researcher, student,โ€ฆ
  4. Oct 12, 2026"Graph Theory with Applications" is a free textbook that provides a comprehensive introducโ€ฆ
  5. Oct 10, 2026๐Ÿ“š Download 10 Python books for FREE: 1. Think Python โ€” Oโ€™Reilly https://t.co/X7y3pX68IW 2โ€ฆ
  6. Oct 9, 2026One of the key moments when I truly understood how transformers work: ๐Ÿง โœจ "Stop thinking oโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’