You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: notebooks/tutorials/3_factset_alphalens_lesson_4/notebook.ipynb
+35-45Lines changed: 35 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,16 @@
13
13
"1. Grouping assets by market cap, then analyzing each cap type individually.\n",
14
14
"2. Writing group neutral strategies.\n",
15
15
"3. Determining an alpha factor's decay rate.\n",
16
-
"4. Dealing with a common Alphalens error named MaxLossExceededError.\n",
17
-
"\n",
18
-
"**All sections of this lesson will use the data produced by the Pipeline created in the following cell. Please run it.**\n",
16
+
"4. Dealing with a common Alphalens error named MaxLossExceededError."
17
+
]
18
+
},
19
+
{
20
+
"cell_type": "markdown",
21
+
"metadata": {},
22
+
"source": [
23
+
"## Grouping By Market Cap\n",
19
24
"\n",
20
-
"**Important note**: Until this lesson, we passed the output of `run_pipeline()` to `get_clean_factor_and_forward_returns()` without any changes. This was possible because the previous lessons' Pipelines only returned one column. This lesson's Pipeline returns two columns, which means we need to *specify the column* we're passing as factor data. Look for commented code near `get_clean_factor_and_forward_returns()` in the following cell to see how to do this."
25
+
"The following code defines a universe and creates an alpha factor within a pipeline. It also returns a classifier by using the quantiles() function. This function is useful for grouping your assets by an arbitrary column of data. In this example, we will group our assets by their market cap, and analyze how effective our alpha factor is among the different cap types (small, medium, and large cap)."
"You can group assets by any classifier, but sector and market cap are most common. The Pipeline in the first cell of this lesson returns a column named `cap_type`, whose values represent the assets market capitalization. All we have to do now is pass that column to the `groupby` argument of `get_clean_factor_and_forward_returns()`\n",
113
101
"\n",
114
-
"**Run the following cell, and notice the charts at the bottom of the tear sheet showing how our factor performs among different cap types.**"
102
+
"**Run the following cell, and notice the charts at the bottom of the tear sheet showing how our factor performs among different cap types.**\n",
103
+
"\n",
104
+
"**Important note**: Until this lesson, we passed the output of `run_pipeline()` to `get_clean_factor_and_forward_returns()` without any changes. This was possible because the previous lessons' Pipelines only returned one column. This lesson's Pipeline returns two columns, which means we need to *specify the column* we're passing as factor data. Look for commented code near `get_clean_factor_and_forward_returns()` in the following cell to see how to do this."
0 commit comments