0

I want to know is there any way to see "under the hood" on other python sklearn algorithms. For example, I have created a decision tree classifier using sklearn and have been able to export the exact structure of the tree but would like to also be able to do this with other algorithms, for example KNN classification. Is this possible?

3
  • 3
    Grab your favorite ML-book and read it. In KNN, there is no fitting, and besides optimizing the internal-storage for fast lookups (kd-tree, ball-tree, ...), there is no internal-state. All is done during prediction-time. All the others of course have attributes you can call -> SVMs: support-vectors; LinearModels: coefficients and so on... What's wrong with the docs? Commented Sep 7, 2017 at 11:31
  • @sascha, Thanks for that. That clears it up for me. I will read up on KNN properly and reread the documentation! Commented Sep 7, 2017 at 11:37
  • 1
    For every classifier/regressor there is a API-page like this. The part within attributes is the stuff you can query. Everything else is hidden and not directly supported. Somewhat bigger example: MLP. Commented Sep 7, 2017 at 11:39

1 Answer 1

1

I would recommend looking up this book.

Introduction to Machine Learning with Python A Guide for Data Scientists by Andreas C. Müller, Sarah Guido

The book has code written to visualise various outputs for Machine Learning algorithms.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.