code
stringlengths
3
6.57k
click()
self.wait_for_and_switch_to_popup()
self.selenium.find_element_by_link_text('Green Potatoes')
self.assertIn('/band/98/', link.get_attribute('href')
link.click()
self.selenium.switch_to.window(main_window)
self.wait_for_value('#id_supporting_bands', '42,98')
RelatedFieldWidgetSeleniumTests(AdminWidgetSeleniumTestCase)
test_ForeignKey_using_to_field(self)
self.admin_login(username='super', password='secret', login_url='/')
self.selenium.get(self.live_server_url + reverse('admin:admin_widgets_profile_add')
self.selenium.find_element_by_id('add_id_user')
click()
self.wait_for_and_switch_to_popup()
self.selenium.find_element_by_id('id_password')
password_field.send_keys('password')
self.selenium.find_element_by_id('id_username')
username_field.send_keys(username_value)
self.selenium.find_element_by_css_selector(save_button_css_selector)
click()
self.selenium.switch_to.window(main_window)
self.selenium.find_element_by_css_selector('#id_user option[value=newuser]')
self.selenium.find_element_by_id('change_id_user')
click()
self.wait_for_and_switch_to_popup()
self.selenium.find_element_by_id('id_username')
username_field.clear()
username_field.send_keys(username_value)
self.selenium.find_element_by_css_selector(save_button_css_selector)
click()
self.selenium.switch_to.window(main_window)
self.selenium.find_element_by_css_selector('#id_user option[value=changednewuser]')
self.selenium.find_element_by_css_selector(save_button_css_selector)
click()
self.wait_for_text('li.success', 'The profile “changednewuser” was added successfully.')
Profile.objects.all()
self.assertEqual(len(profiles)
self.assertEqual(profiles[0].user.username, username_value)
licence (see the LICENCE.txt)
Christ (maximilianchrist.com)
off (solely based on the p-values)
logging.getLogger(__name__)
left( F_{\\text{target}=1} = F_{\\text{target}=0} \\right)
left( F_{\\text{target}=1} \\neq F_{\\text{target}=0} \\right)
left( T_{\\text{feature}=1} = T_{\\text{feature}=0} \\right)
left( T_{\\text{feature}=1} \\neq T_{\\text{feature}=0} \\right)
independent (e.g. mean and median)
len(set(y)
y.astype(np.float)
X.copy()
pd.DataFrame()
list(set(X.columns)
df_features.set_index('Feature', drop=False)
Pool(n_processes)
pool.map(f, [X[feature] for feature in df_features['Feature']], chunksize=chunksize)
pd.DataFrame(results)
df_features.update(p_values_of_features)
pool.close()
pool.join()
set(df_features.type)
benjamini_hochberg_test(df_features.loc[~(df_features.type == "const")
pd.concat([df_features_bh, df_features.loc[df_features.type == "const"]])
benjamini_hochberg_test(df_features, hypotheses_independent, fdr_level)
astype("bool")
os.path.exists(defaults.RESULT_DIR)
os.mkdir(defaults.RESULT_DIR)
open(os.path.join(defaults.RESULT_DIR, "fs_bh_results.txt")
file_out.write(("Performed BH Test to control the false discovery rate(FDR)
format(fdr_level, hypotheses_independent)
df_features.to_csv(index=False, path_or_buf=file_out, sep=';', float_format='%.4f')
_calculate_p_value(feature_column, y, target_is_binary, test_for_binary_target_real_feature)
len(pd.unique(feature_column.values)
_logger.warning("[test_feature_significance] Feature {} is constant".format(feature_column.name)
pd.Series({"type": "const", "rejected": False}, name=feature_column.name)
len(set(feature_column.values)
target_binary_feature_binary_test(feature_column, y)
target_binary_feature_real_test(feature_column, y, test_for_binary_target_real_feature)
len(set(feature_column.values)
target_real_feature_binary_test(feature_column, y)
target_real_feature_real_test(feature_column, y)
pd.Series({"p_value": p_value, "type": type}, name=feature_column.name)
benjamini_hochberg_test(df_pvalues, hypotheses_independent, fdr_level)
Daniel (2001)
independent (e.g. mean and median)
df_pvalues.sort_values(by="p_value")
len(df_pvalues)
list(range(1, m + 1)
c(k)
c(k)
sum([1.0 / i for i in range(1, k + 1)
zip(K, C)
list(df_pvalues.p_value <= T)
index(False)
execfile()
extensions (or modules to document with autodoc)
sys.path.insert(0, os.path.abspath('.')
Sphinx (named 'sphinx.ext.*')
role (used for this markup: `text`)
titles (such as .. function::)
Pygments (syntax highlighting)