Using Sckit-Learn
1. Install scikit-learn
conda install scikit-learn
2. General Form
- every algorithm is exposed in scikit-learn via an 'Estimator'
- First you'll import the model, the general form is :
-from sklearn.{family} import {Model}
- Estimator parameters : All the parameters of an estimator can be set when it is instantiated
- It will have suitable valuesmodel = LinearRegression(normalize=True) print(model)
3. Available in all Estimators
model.fit()
: fit training data
- for supervised learning applications , this accepts two arguments : the data x and the labels y (e.g.model.fit(x,y)
)
- for unsupervised learning applications, this accepts only a single argument (e.g.model.fit(x)
)
4. Available in supervised estimators
model.predict_proba()
: returns the probability that a new observation has each categorical label. In this case, the label with the highest probability is returned bymodel.predict()
model.score()
: for classification or regression problems, scores are between 0 and 1 (larger score = better fit)
5. Available in unsupervised estimators
model.predict()
: predict labels in clustering algorithmsmodel.transform()
: given an unsupervised model, transform new data into the new basis. This also acceptsx_new
, returns the new representation of the data based on the unsuprvised modelmodel.fit_transform()
: for some estimators. which efficiently performs a fit and transform on the same input data
Author And Source
이 문제에 관하여(Using Sckit-Learn), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@dougieduk/Using-Sckit-Learn저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)