-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSKL08-Estimators.tex
50 lines (39 loc) · 1.41 KB
/
SKL08-Estimators.tex
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
50
\documentclass[SKL-MASTER.tex]{subfiles}
\textbf{Estimators objects: Fitting data:}\\The core object of scikit-learn is the estimator object. All estimator objects expose a \texttt{fit} method, that takes as input a dataset (2D array):
<pre>
\begin{verbatim}
>>> estimator.fit(data)
\end{verbatim}
\end{framed}
Suppose \texttt{LogReg} and \texttt{KNN} are (shorthand names for) scikit-learn estimators.
<pre>
\begin{verbatim}
>>> # Supervised Learning Problem
>>> LogReg.fit(SAheartFeat, SAheartTarget)
>>>
>>> # Unsupervised Learning Problem
>>> KNN.fit(IrisFeat)
\end{verbatim}
\end{framed}
\newpage
----------------------%
\textbf{Estimator parameters:}\\
All the parameters of an estimator can be set when it is instanciated, or by modifying the corresponding attribute:
<pre>
\begin{verbatim}
>>> estimator = Estimator(param1=1, param2=2)
>>> estimator.param1
\end{verbatim}
\end{framed}
----------------------%
% % \subsubsection{Retrieving Estimator parameters:}
\textbf{Retrieving Estimator parameters:}\\
* When data is fitted with an estimator, parameters are estimated from the data at hand.
* All the estimated parameters are attributes of the estimator object ending by an underscore:
<pre>
\begin{verbatim}
>>> estimator.estimated_param_
\end{verbatim}
\end{framed}
%========================================================================%
\end{document}