This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- KOReader user patch to add all ebooks found on device to the Favorites collection | |
function find_files(directory, file_extensions) | |
local result = {} | |
-- Helper function to recursively search for files | |
local function search_files(dir) | |
for file in io.popen('ls -1 "' .. dir .. '"'):lines() do | |
local path = dir .. '/' .. file | |
local file_extension = file:match("^.+(%..+)$") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# © 2020 dagrha. GPLv3.0 | |
def linear_regression(df, x_col, y_col): | |
from sklearn.linear_model import LinearRegression | |
from sklearn.metrics import r2_score | |
x = df[(df[x_col].notnull()) &(df[y_col].notnull())][x_col].values.reshape(-1, 1) | |
y = df[(df[x_col].notnull()) &(df[y_col].notnull())][y_col].values.reshape(-1, 1) | |