[scikit-learn] R user trying to learn Python

C W tmrsg11 at gmail.com
Sun Jun 18 12:02:06 EDT 2017


Dear Scikit-learn,

What are some good ways and resources to learn Python for data analysis?

I am extremely frustrated using this thing. Everything comes after a dot!
Why would you type the sam thing at the beginning of every line. It's not
efficient.

code 1:
y_sin = np.sin(x)
y_cos = np.cos(x)

I know you can import the entire package without the "as np", but I see
np.something as the standard. Why?

Code 2:
model = LogisticRegression()
model.fit(X_train, y_train)
model.score(X_test, y_test)

In R, everything is saved to a variable. In the code above, what if I
accidentally ran model.fit(), I would not know.

Code 3:
from sklearn import linear_model
reg = linear_model.Ridge (alpha = .5)
reg.fit ([[0, 0], [0, 0], [1, 1]], [0, .1, 1])

In the code above, sklearn > linear_model > Ridge, one lives inside the
other, it feels that there are multiple layer, how deep do I have to dig in?

Can someone explain the mentality behind this setup?

Thank you very much!

M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170618/8f724045/attachment.html>


More information about the scikit-learn mailing list