Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between scikit-learn and tensorflow? Is it possible to use them together?

I cannot get a satisfying answer to this question. As I understand it, TensorFlow is a library for numerical computations, often used in deep learning applications, and Scikit-learn is a framework for general machine learning.

But what is the exact difference between them, what is the purpose and function of TensorFlow? Can I use them together, and does it make any sense?

like image 362
RKCZ Avatar asked Apr 15 '20 15:04

RKCZ


People also ask

Is TensorFlow compatible with sklearn?

Scikit Learn is a new easy-to-use interface for TensorFlow from Google based on the Scikit-learn fit/predict model.

Should I use scikit-learn or TensorFlow?

Scikit-Learn's generality makes it useful for comparing entirely different types of machine learning models against each other; TensorFlow's specialization enables under-the-hood optimizations, making it easier and more efficient to compare different TensorFlow and neural network models.

What should I learn first scikit-learn or TensorFlow?

Start with Scikit-Learn. It's easier to learn compared to Tensorflow. After you get some knowledge of ML using Scikit, learning Tensorflow will be easier.

Can we use both keras and TensorFlow?

Keras was adopted and integrated into TensorFlow in mid-2017. Users can access it via the tf. keras module. However, the Keras library can still operate separately and independently.


1 Answers

Your understanding is pretty much spot on, albeit very, very basic. TensorFlow is more of a low-level library. Basically, we can think of TensorFlow as the Lego bricks (similar to NumPy and SciPy) that we can use to implement machine learning algorithms whereas Scikit-Learn comes with off-the-shelf algorithms, e.g., algorithms for classification such as SVMs, Random Forests, Logistic Regression, and many, many more. TensorFlow really shines if we want to implement deep learning algorithms, since it allows us to take advantage of GPUs for more efficient training. TensorFlow is a low-level library that allows you to build machine learning models (and other computations) using a set of simple operators, like “add”, “matmul”, “concat”, etc.

Makes sense so far?

Scikit-Learn is a higher-level library that includes implementations of several machine learning algorithms, so you can define a model object in a single line or a few lines of code, then use it to fit a set of points or predict a value.

Tensorflow is mainly used for deep learning while Scikit-Learn is used for machine learning.

Here is a link that shows you how to do Regression and Classification using TensorFlow. I would highly suggest downloading the data sets and running the code yourself.

https://stackabuse.com/tensorflow-2-0-solving-classification-and-regression-problems/

Of course, you can do many different kinds of Regression and Classification using Scikit-Learn, without TensorFlow. I would suggesting reading through the Scikit-Learn documentation when you have a chance.

https://scikit-learn.org/stable/user_guide.html

It's going to take a while to get through everything, but if yo make it to the end, you will have learned a ton!!! Finally, you can get the 2,600+ page user guide for Scikit-Learn from the link below.

https://scikit-learn.org/stable/_downloads/scikit-learn-docs.pdf

like image 106
ASH Avatar answered Oct 07 '22 16:10

ASH