Scikit-Learn


Example  With the example given below, we can download  iris dataset



Yüklə 1,92 Mb.
Pdf görüntüsü
səhifə18/124
tarix23.02.2023
ölçüsü1,92 Mb.
#101394
1   ...   14   15   16   17   18   19   20   21   ...   124
sklearn

Example 
With the example given below, we can download 
iris dataset
in the form of a Pandas 
DataFrame with the help of python 
seaborn
library.
import seaborn as sns 
iris = sns.load_dataset('iris') 
iris.head() 
Output
 
sepal_length sepal_width petal_length petal_width
species 
0 5.1 3.5
1.4 0.2 setosa 
1 4.9 3.0
1.4 0.2 setosa 
2 4.7 3.2
1.3 0.2 setosa 
3 4.6 3.1 1.5 0.2 setosa 
4 5.0 3.6 1.4 0.2 setosa 
From above output, we can see that each row of the data represents a single observed 
flower and the number of rows represents the total number of flowers in the dataset. 
Generally, we refer the rows of the matrix as samples. 
On the other hand, each column of the data represents a quantitative information 
describing each sample. Generally, we refer the columns of the matrix as features. 
Data as Feature Matrix 
Features matrix may be defined as the table layout where information can be thought of 
as a 2-D matrix. It is stored in a variable named 
X
and assumed to be two dimensional 
3.
 
Scikit-Learn — Data Representation


Scikit-Learn
14 
with shape [n_samples, n_features]. Mostly, it is contained in a NumPy array or a Pandas 
DataFrame. As told earlier, the samples always represent the individual objects described 
by the dataset and the features represents the distinct observations that describe each 
sample in a quantitative manner. 
Data as Target array 
Along with Features matrix, denoted by X, we also have target array. It is also called label. 
It is denoted by y. The label or target array is usually one-dimensional having length 
n_samples. It is generally contained in NumPy 

Yüklə 1,92 Mb.

Dostları ilə paylaş:
1   ...   14   15   16   17   18   19   20   21   ...   124




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə