-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrandom_forest.html
110 lines (99 loc) · 7.76 KB
/
random_forest.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module random_forest</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>random_forest</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/kobigurk/thesis/code/wf/random_forest.py">/home/kobigurk/thesis/code/wf/random_forest.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="code.html">code</a><br>
<a href="sklearn.ensemble.html">sklearn.ensemble</a><br>
</td><td width="25%" valign=top><a href="sklearn.linear_model.html">sklearn.linear_model</a><br>
<a href="logging.html">logging</a><br>
</td><td width="25%" valign=top><a href="numpy.html">numpy</a><br>
<a href="operator.html">operator</a><br>
</td><td width="25%" valign=top><a href="sklearn.tree.html">sklearn.tree</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="random_forest.html#WaveletsForestRegressor">WaveletsForestRegressor</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="WaveletsForestRegressor">class <strong>WaveletsForestRegressor</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="WaveletsForestRegressor-__init__"><strong>__init__</strong></a>(self, regressor='random_forest', criterion='mse', bagging=0.8, depth=9, trees=5, features='auto', seed=None)</dt><dd><tt>Construct a new '<a href="#WaveletsForestRegressor">WaveletsForestRegressor</a>' <a href="builtins.html#object">object</a>.<br>
<br>
:regressor: Regressor type. Either "rf" or "decision_tree_with_bagging". Default is "rf".<br>
:criterion: Splitting criterion. Same options as sklearn's DecisionTreeRegressor. Default is "mse".<br>
:bagging: Bagging. Only available when using the "decision_tree_with_bagging" regressor. Default is 0.8.<br>
:depth: Maximum depth of each tree. Default is 9.<br>
:trees: Number of trees in the forest. Default is 5.<br>
:features: Features to consider in each split. Same options as sklearn's DecisionTreeRegressor.<br>
:seed: Seed for random operations. Default is 2000.</tt></dd></dl>
<dl><dt><a name="WaveletsForestRegressor-accuracy"><strong>accuracy</strong></a>(self, y_pred, y)</dt><dd><tt>Evaluates accuracy given predictions and actual labels. <br>
<br>
:y_pred: Predictions as vertices on the simplex (preprocessed by 'pred_to_one_hot').<br>
:y: Actual labels.<br>
:return: Accuracy.</tt></dd></dl>
<dl><dt><a name="WaveletsForestRegressor-evaluate_smoothness"><strong>evaluate_smoothness</strong></a>(self, m=1000)</dt><dd><tt>Evaluates smoothness for a maximum of M-terms<br>
<br>
:m: Maximum terms to use. Default is 1000.<br>
:return: Smothness index, n_wavelets, errors.</tt></dd></dl>
<dl><dt><a name="WaveletsForestRegressor-fit"><strong>fit</strong></a>(self, X_raw, y)</dt><dd><tt>Fit non-normalized data to simplex labels.<br>
<br>
:X_raw: Non-normalized features, given as a 2D array with each row representing a sample.<br>
:y: Labels, each row is given as a vertex on the simplex.</tt></dd></dl>
<dl><dt><a name="WaveletsForestRegressor-pred_to_one_hot"><strong>pred_to_one_hot</strong></a>(self, y_pred)</dt><dd><tt>Converts regression predictions to their closest vertices on the simplex</tt></dd></dl>
<dl><dt><a name="WaveletsForestRegressor-predict"><strong>predict</strong></a>(self, X, m=1000, start_m=0, paths=None)</dt><dd><tt>Predict using a maximum of M-terms<br>
<br>
:X: Data samples.<br>
:m: Maximum of M-terms.<br>
:start_m: The index of the starting term. Can be used to evaluate predictions incrementally over terms.<br>
:paths: Instead of computing decision paths for each sample, the method can receive the indicator matrix. Can be used to evaluate predictions incrementally over terms.<br>
:return: Predictions.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-reduce"><strong>reduce</strong></a>(...)</dt><dd><tt><a href="#-reduce">reduce</a>(function, sequence[, initial]) -> value<br>
<br>
Apply a function of two arguments cumulatively to the items of a sequence,<br>
from left to right, so as to reduce the sequence to a single value.<br>
For example, <a href="#-reduce">reduce</a>(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates<br>
((((1+2)+3)+4)+5). If initial is present, it is placed before the items<br>
of the sequence in the calculation, and serves as a default when the<br>
sequence is empty.</tt></dd></dl>
</td></tr></table>
</body></html>