Simplified code. Removed to_frame().
This commit is contained in:
@@ -221,8 +221,8 @@
|
||||
" random=333, risky=0,\n",
|
||||
" color='red', name='Regression Line' ):\n",
|
||||
" df = self.devs # .sort_values(by = self.key2)\n",
|
||||
" X = df[self.key_x].to_frame()\n",
|
||||
" y = df[self.key_y].to_frame()\n",
|
||||
" X = df[[self.key_x]]\n",
|
||||
" y = df[[self.key_y]]\n",
|
||||
"\n",
|
||||
" # not recommended\n",
|
||||
" # carries risk of model training on sorted order\n",
|
||||
@@ -270,8 +270,8 @@
|
||||
"\n",
|
||||
" def run_log_regression(self, color='pink', nodraw=True):\n",
|
||||
" df = self.devs\n",
|
||||
" X = df[self.key_x].to_frame().sort_values(by=self.key_x)\n",
|
||||
" y = df[self.key_y].to_frame().sort_values(by=self.key_y)\n",
|
||||
" X = df[[self.key_x]].sort_values(by=self.key_x)\n",
|
||||
" y = df[[self.key_y]].sort_values(by=self.key_y)\n",
|
||||
"\n",
|
||||
" X_log = np.log(X)\n",
|
||||
" x_fit = np.linspace(1, 40, len(y)).reshape(-1, 1)\n",
|
||||
|
Reference in New Issue
Block a user