我有問題matplotlib.pyplot.scatter。
首先,我需要下載虹膜分類的資料并粘貼標題。
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('seaborn')
%matplotlib inline
df = pd.read_csv('http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data', header = None)
df_names = ['sepal length in cm', 'sepal width in cm', 'petal length in cm', 'petal width in cm', 'class']
df.columns = df_names
df
matplotlib.pyplot.scatter其次,我應該使用以下方式創建資料散點圖:
* for x and y coordinates use sepal length and width respectively
* for size use the petal length
* for alpha (opacity/transparency) use the petal width
* illustrate iris belonging to each class by using 3 distinct colours (RGB for instance, but be creative if you want)
* *some columns will need to be scaled, to be passed as parameters; you might also want to scale some other columns to increase the readability of the illustration.
然后,我找到了這個網站:
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/447255.html
