Calculate robust regression between the columns of X and y
Parameters: | X : pandas.DataFrame
y : pandas.DataFrame
verbose : bool, optional
|
---|---|
Returns: | out_I : pandas.Series
out_S : pandas.Series
out_T : pandas.Series
out_P : pandas.Series
|
See also
Apply R calculation method on each column of X versus the values of y
Parameters: | X : pandas.DataFrame
y : pandas.Series
method : function, optional
|
---|---|
Returns: | r_coefficients : pandas.Series
p_values : pandas.Series
|
See also
X and y are dataframes, returns slope, t-value and p-value of robust regression
Parameters: | X : pandas.DataFrame
y : pandas.DataFrame
verbose : bool, optional
|
---|---|
Returns: | slope : pandas.Series
|
See also
Calcualte distance correlation between the columns of two dataframes
Parameters: | X : pandas.DataFrame
y : pandas.DataFrame
verbose : bool, optional
|
---|---|
Returns: | dc : pandas.Series
dr : pandas.Series
dvx : pandas.Series
dvy : pandas.Series
|
See also
Calculate correlation (“R-value”) between two vectors
Parameters: | s_1 : pandas.Series
s_2 : pandas.Series
method : function, optional
min_items : int, optional
|
---|---|
Returns: | r_value : float
p_value : float
|
Notes
If too few items overlap, return (np.nan, np.nan)
Calculate a GradientBoostingRegressor on predictor and target variables
Parameters: | x : numpy.array
y : numpy.array
verbose : bool, optional
|
---|---|
Returns: | classifier : sklearn.ensemble.GradientBoostingRegressor
|
Calculate distance correlation between two vectors
Uses the distance correlation package from: https://github.com/andrewdyates/dcor
Parameters: | x : numpy.array
y : numpy.array
|
---|---|
Returns: | dc : float
dr : float
dvx : float
dvy : float
|
Calculate an ExtraTreesRegressor on predictor and target variables
Parameters: | x : numpy.array
y : numpy.array
n_estimators : int, optional
n_tries : int, optional
verbose : bool, optional
|
---|---|
Returns: | classifier : sklearn.ensemble.ExtraTreesRegressor
oob_scores : numpy.array
|
Calculate robust linear regression
Parameters: | x : numpy.array
y : numpy.array
|
---|---|
Returns: | intercept : float
slope : float
t_statistic : float
p_value : float
|
Get the linear regression slope of x and y
Parameters: | x : numpy.array
y : numpy.array
|
---|---|
Returns: | slope : float
|
get events that have not been started yet. generator sets started to True before returning an event
Parameters: | mongodb : pymongo.Database
|
---|
Calculate spearman correlations between dataframes A and B
Parameters: | A : pandas.DataFrame
B : pandas.DataFrame
axis : int
|
---|---|
Returns: | correlations : pandas.DataFrame
|
Notes
Use “applymap” to get just the R- and p-values of the resulting dataframe
>>> import pandas as pd
>>> import numpy as np
>>> A = pd.DataFrame(np.random.randn(100).reshape(5, 20))
>>> B = pd.DataFrame(np.random.randn(55).reshape(5, 11))
>>> correls = spearmanr_dataframe(A, B)
>>> correls.shape
(11, 20)
>>> spearman_r = correls.applymap(lambda x: x[0])
>>> spearman_p = correls.applymap(lambda x: x[1])
Calculate spearman r (with p-values) between two pandas series
Parameters: | x : pandas.Series
y : pandas.Series
|
---|---|
Returns: | r_value : float
p_value : float
|