Hướng dẫn python cheat sheet data science - python khoa học dữ liệu gian lận

Như bạn có thể đã biết, tôi đã tạo ra Python và R Cheat Sheets dành riêng cho những người mới bắt đầu với khoa học dữ liệu hoặc cho những người cần trợ giúp thêm khi làm việc về các vấn đề khoa học dữ liệu.

Bây giờ bạn có thể tìm thấy tất cả chúng ở một nơi trên cộng đồng Datacamp.

Bạn có thể tìm thấy tất cả các tấm cheat ở đây.here.

Tóm lại, đây là những tấm cheat khoa học dữ liệu mà chúng tôi đã thực hiện và chia sẻ với cộng đồng cho đến bây giờ:

Điều cơ bản

  • Python cơ bản
  • Bảng cheat đại số tuyến tính Scipy

Thao tác dữ liệu

  • Tờ Cheat cơ bản Numpy
  • Gấu trúc cơ bản
  • Bảng điều khiển dữ liệu gấu trúc
  • XTS Cheat Sheet
  • Data.Table Cheat Sheet (Cập nhật!)
  • Tidyverse Cheat Sheet

Học máy, học sâu, dữ liệu lớn

  • SCIKIT-LEARN SHATION
  • Keras Cheat Sheet
  • Bảng cheat pyspark rdd
  • Pyspark Sparksql Sheet

Trực quan hóa dữ liệu

  • Matplotlib cheat tờ
  • Biển gian lận seeborn
  • Bokeh Cheat Sheet (Cập nhật!)

Ide

  • Tờ giấy gian lận máy tính xách tay Jupyter

Tận hưởng và cảm thấy thoải mái để chia sẻ!

PS. Bạn có thấy một bảng gian lận khoa học dữ liệu khác mà bạn muốn giới thiệu không? Hãy cho chúng tôi biết ở đây!here!

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

# 2. Nhập thư viện và mô -đun

Nhập khẩu Asnpnumpy asnp

IMPREPPANDAS ASPDpandas aspd

Fromsklearn.model_selection Nhập khẩuTrain_Test_Splitsklearn.model_selection importtrain_test_split

FromskLearn Nhập trísklearn importpreprocessing

Fromsklearn.Ensemble ImprTrandomforestreatoryorsklearn.ensemble importRandomForestRegressor

Fromsklearn.Pipeline Nhập trí_pipelinesklearn.pipeline importmake_pipeline

Fromsklearn.model_selection Nhập trí nghiên cứusklearn.model_selection import GridSearchCV

Fromsklearn.Metrics nhập khẩusklearn.metrics importmean_squared_error,r2_score

Nhập khẩuJOblibjoblib

# 3. Tải dữ liệu rượu vang đỏ.

dataset_url='https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv'= 'https://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-red.csv'

data=pd.read_csv(dataset_url,sep=';')=pd.read_csv(dataset_url,sep=';')

# 4. Chia dữ liệu thành các bộ đào tạo và kiểm tra

y=data.quality= data.quality

X=data.drop('quality',axis=1)=data.drop('quality',axis=1)

X_train,X_test,y_train,y_test=train_test_split(X,y,,X_test,y_train,y_test= train_test_split(X,y,

                                                    test_size=0.2,test_size=0.2,

                                                    random_state=123,random_state=123,

                                                    stratify=y)stratify=y)

# 5. Khai báo các bước tiền xử lý dữ liệu

pipeline=make_pipeline(preprocessing.StandardScaler(),=make_pipeline(preprocessing.StandardScaler(),

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; RandomForestRestyor (n_estimators = 100,RandomForestRegressor(n_estimators=100,

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; Random_state = 123))random_state=123))

# 6. Tuyên bố Hyperparameter để điều chỉnh

hyperparameters={'randomforestregressor__max_features':['auto','sqrt','log2'],={'randomforestregressor__max_features':['auto','sqrt','log2'],

                  'randomforestregressor__max_depth':[None,5,3,1]}'randomforestregressor__max_depth': [None,5,3,1]}

# 7. Mô hình điều chỉnh bằng đường ống xác thực chéo

clf=GridSearchCV(pipeline,hyperparameters,cv=10)=GridSearchCV(pipeline,hyperparameters, cv=10)

clf.fit(X_train,y_train).fit(X_train,y_train)

# 8. Tái trang bị trên toàn bộ bộ đào tạo

# Không cần mã bổ sung nếu clf.refit == true (mặc định là đúng)

# 9. Đánh giá đường ống mô hình trên dữ liệu kiểm tra

pred=clf.predict(X_test)= clf.predict(X_test)

print(r2_score(y_test,pred))(r2_score(y_test,pred))

print(mean_squared_error(y_test,pred))(mean_squared_error(y_test,pred))

# 10. Lưu mô hình cho sử dụng trong tương lai

joblib.dump(clf,'rf_regressor.pkl').dump(clf,'rf_regressor.pkl')

# To Load: clf2 = joblib.load ('rf_reforyor.pkl'))

Có một tấm cheat Python?

Hơn nữa, pythoncheatsheet.org bao gồm các chức năng, cấu trúc dữ liệu, danh sách, JSON, điều khiển lưu lượng, bộ, vòng lặp, gỡ lỗi, yaml, lớp dữ liệu, trình quản lý bối cảnh, và nhiều hơn nữa. Vì nó bao gồm hầu hết mọi thứ về Python, nó là một tờ cheat hoàn chỉnh cho cả người mới bắt đầu và các nhà phát triển có kinh nghiệm.Pythoncheatsheet.org covers functions, data structures, lists, JSON, flow control, sets, loops, debugging, YAML, data classes, context manager, and a lot more. Since it covers almost everything about Python, it is a complete cheat sheet for both beginner and experienced developers.

Python có dễ dàng cho khoa học dữ liệu không?

R được xây dựng đặc biệt cho số liệu thống kê và toán học, nhưng có một số gói tuyệt vời giúp sử dụng cực kỳ dễ sử dụng cho khoa học dữ liệu.Ngoài ra, nó có một cộng đồng trực tuyến rất hỗ trợ.Python là một ngôn ngữ lập trình toàn diện tốt hơn.Kỹ năng Python của bạn có thể chuyển sang nhiều ngành khác.there are some amazing packages that make it incredibly easy to use for data science. Additionally, it has a very supportive online community. Python is a better all-around programming language. Your Python skills are transferable to many other disciplines.

Bảng cheat trong phân tích dữ liệu là gì?

Nó có thể là một hình ảnh của phân tích dữ liệu hoặc hiểu biết mô hình.Dù đó là gì, bảng gian lận có thể có ích.Những gì bạn nhận được: Đó là một cái nhìn tổng quan tốt về các biểu đồ được sử dụng trong trực quan hóa dữ liệu.a visualization of data analysis or model insights. Whichever it is, the cheat sheet could come in handy. What you get: It's a good overview of the graphs used in data visualization.

Python để phân tích dữ liệu có khó khăn không?

Có thể mất từ năm đến 10 tuần để tìm hiểu lập trình Python để phân tích dữ liệu, mặc dù điều này phụ thuộc vào số lượng kinh nghiệm bạn có với ngôn ngữ lập trình và phát triển web.Nói chung, mặc dù, Python có thể được coi là rất thân thiện với người mới bắt đầu, vì nó được biết đến với khả năng đọc và dễ sử dụng.Python can be considered very beginner-friendly, as it is known for its readability and ease of use.