## Sunday, August 5, 2012

### Random forests for visualizing data

Recently I read about using random forests as a way to visualize data. Here's how it works:
1. Have a data set
2. Create a set of fake data by permuting the columns randomly -- each column will still have the same distribution, but the relationships are destroyed.
3. Train a random forest to distinguish the fake data from the original data.
4. Get a "proximity" measure between points, based on how often the points are in the same leaf node.
5. Embed the points in 2D in such a way as to distort these proximities as little as possible.
I decided to try this in a case where I would know what the outcome should be, as a way of thinking about how it works. So I generated 931 images of diamonds varying in two dimensions:
1. Size
2. Position (only how far left/right)

Then I followed the above procedure, getting this:

Neat! The random forest even picked up on a feature of this space that I wasn't expecting it to: for the same difference in position, small diamonds need to be closer to each other than large diamonds. None of my diamonds have a diameter smaller than 4 pixels, but imagine of the sizes got so small the diamond wasn't even there -- then position wouldn't matter at all of those diamonds.

I set one column of pixels to random values, and the method still worked just as well. (Which makes sense, as the random forest only cares about pixels that help it distinguish between diamonds and non-diamonds.)

A cool technique that I'd love to try some more! For one, I'd like to understand better how it differs from various manifold learning methods. One nice feature is that you could easily use this with a mix of continuous and categorical variables.

Note that starting with Euclidean distance between images (as vectors in R^2500) and mapping points to 2D doesn't seem to produce anything useful:

Code available on github.

1. What method did you use for creating the embedding?

2. Kruskal's Non-metric Multidimensional Scaling -- http://stat.ethz.ch/R-manual/R-patched/library/MASS/html/isoMDS.html

3. Multidimensional scaling is typically a very bad way of visualizing high-dimensional data. I think one of the best algorithms for visualizations like these is t-SNE (http://homepage.tudelft.nl/19j49/t-SNE.html).

4. Neat, thanks.

5. That method is great! Thanks.

6. I also use visual materials for my papersowl review, they always help more to render the idea of your information.

7. it is an interesting Article, i read this post that was very nice and useful thanks for sharing it.
Data Science training in Chennai | Data Science Training Institute in Chennai | Data Science Course in Chennai

8. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
Java Training in Chennai
Java Training in Coimbatore
Java Training in Bangalore

9. waiting for you upcoming data.
kitchen and bath remodeling tallahassee fl

10. Superb post shared.
smoke damage services tampa

11. I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
Cyber Security Projects for Final Year

JavaScript Training in Chennai

Project Centers in Chennai

JavaScript Training in Chennai

12. פוסט מעניין, משתף עם העוקבים שלי. תודה.
קבוצת גבאי פייסבוק

13. what a beautiful post you shared.

שער כניסה

14. This comment has been removed by the author.

15. Good blog!!! It is more impressive... thanks for sharing with us...
123movie

16. what a beautiful post you shared.
123 movie

17. פוסט נחמד. חייב לשתף עם העוקבים שלי.
מגש אירוח מתוקים

18. מזל שנתקלתי בכתבה הזאת. בדיוק בזמן
טבעות אירוסין מיוחדות

19. This comment has been removed by the author.

20. הדעות שלי קצת חלוקות בעניין הזה אבל ללא ספק כתבת מעניין מאוד.
שולחן פינת אוכל

21. הדעות שלי קצת חלוקות בעניין הזה אבל ללא ספק כתבת מעניין מאוד.
עיצוב עצמות לחיים

22. As we look back upon 2015, we would like to acknowledge those who have helped us shape our business. Thanks for a great year, and we wish you all the best as you embark on 2016.
go123movies

23. Your topic is very nice and helpful to us … Thank you for the information you wrote.

Learn Hadoop Training from the Industry Experts we bridge the gap between the need of the industry. Bangalore Training Academy provide the Best Hadoop Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
Big Data Analytics Training in Bangalore
Tableau Training in Bangalore
Data Science Training in Bangalore
Workday Training in Bangalore

24. הדעות שלי קצת חלוקות בעניין הזה אבל ללא ספק כתבת מעניין מאוד.
אטרקציות לחתונה

25. הייתי חייבת לפרגן, תודה על השיתוף.
משטח פעילות לתינוק

26. מעולה. תודה על הכתיבה היצירתית.
השקעה בנדל"ן בארה"ב

27. thanks for sharing.
gold elephant jewelry

28. מעולה. תודה על הכתיבה היצירתית.
בלוק עץ עם תמונה

29. Very nice post.

123movie

30. Informative post.

123 movie

31. תודה על השיתוף. מחכה לכתבות חדשות.
מערכת מצלמות אבטחה

32. I am definitely playing your internet site.
You really have a few terrific perception and remarkable testimonies.

33. Appreciate you taking the time in sharing these particulars. www.azsprinklerrepairmiami.com/downtown

34. Your article is very informative.
global asset management seoul

35. הייתי חייבת לפרגן, תודה על השיתוף.
חברת שיווק באינטרנט

36. פוסט נחמד. חייב לשתף עם העוקבים שלי.
מזרן פעילות

Thanks for the post. It was very interesting and meaningful. I really appreciate it! Keep updating stuffs like this. If you are looking for the Advertising Agency in Chennai | Printing in Chennai , Visit Inoventic Creative Agency Today..

38. פוסט מרענן במיוחד. לגמרי משתף.
השקעה בנדלן בישראל

39. Thanks for explaining the ways to visualize data. It was informative and helped me to get a clear understanding on this topic. Keep posting. Awaiting for your next blog.

Mobile App Development Company in Chennai

40. Thanks for updating this information.
global asset management korea

41. Thank you so much for ding the impressive job here, everyone will surely like your post.
keto diet pills amazon

43. Thank you for your post.this post give me lots of advise it is very useful for me.
Eyelash extensions

44. This is a nice work. I have loving reading your post first time. thanks for this post.
best mattress uk

45. I will be interested in more similar topics. i i will be always checking your blog thanks
wireless backup cameras for cars

46. אין ספק שהפוסט הזה דורש שיתוף. תודה.
https://canvi.co.il

אינטרקום עם מצלמה

48. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one.
genf20 plus walmart

49. awesome post.

50. Thank you so much for ding the impressive job here, everyone will surely like your post.
https://phentermineguides.com/phenq-amazon/

51. What to do during mold remediation procedures
mold remediation

52. thanks for giving us go through info.Fantastic nice. I appreciate this post.
roof repairs

53. I would also motivate just about every person to save this web page for any favorite assistance to assist posted

54. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information...genf20 plus

Spoken English & Communication Coaching Classes Training in Chennai | Certification | Online Courses

German Classes in Chennai | Certification | Language Learning Online Courses | GRE Coaching Classes in Chennai | Certification | Language Learning Online Courses | TOEFL Coaching in Chennai | Certification | Language Learning Online Courses | Spoken English Classes in Chennai | Certification | Communication Skills Training

56. Hi it's very informative blog and i learnt more from this post,
Thanks to share with us and keep more updates,

angular js training in chennai

angular js training in porur

full stack training in chennai

full stack training in porur

php training in chennai

57. Lovely pictures, awesome these are looking so funny interesting but professional and artistic pics.

Global Asset Management Korea

58. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
workday studio online training
best workday studio online training
top workday studio online training

59. I appreciate your post. Thanks for posting.
garagedoorprosontario.ca

60. Hi I m Harry Thomas working with Cash App Help. We work towards making the customer experience of making payments through Cash App simple and easier. Contact us for any type of query. https://hearthis.at/cashapphelps/

61. מאמר מצוין נהניתי מכל רגע של קריאה

בריכות שחיה ביתיות

62. Quite entertaining indeed and greatly appreciated!Thank you! I truly like it.

Kald Gart Garage Doors Calgary

63. When you are trading within the Crypto Era Pro market, you'll be able to trade anonymously. The currency isn't tied to any particular country and there are even no rules designed for it. Even small businesses are using bitcoins as a result of there's no transaction fee concerned in the exchange. If you've got some savings, you can invest that money to shop for bitcoins and to achieve profit as a result of the worth of this digital currency is predicted to go up
https://www.cryptoerapro.com/

64. The market places where digital currencies are exchanged are known as Crypto Era Pro exchanges. They're the places where folks get and sell bitcoins by using the currencies of their respective countries. You simply want a wallet software, open an account, and then get bitcoins from the cash you have in your account so as to become ready for the exchanges. Folks are even transferring digital currencies through their Smartphones. There are mobile apps on the market for this purpose. You'll be able to either purchase bitcoins from on-line exchanges or get them from special ATMs.

Mining is another possibility employed in the digital currency market. It's a method in which traders have to resolve mathematical puzzles to win bitcoins. It's a robust and time taking method, but if you get it right then you will win 25 bitcoins. This can simply happen in 10 minutes.
https://www.cryptoerapro.com/

65. Great and nice blog thanks sharing
Garage Door Repair Bethel Park

66. אם כי אני לא מסכים עם כל מה שנכתב, מאמר מעניין
החזר בלו

67. Wow! Such an amazing and helpful post this is. I really really love it. I hope that you continue to do your work like this in the future also.

Python Training In Pune
python training institute in pune

68. חשבתי שאתקל בסתם עוד מאמר שטחי. טעיתי.
https://gooddog.co.il/