datawhispers package
Submodules
datawhispers.advancedProg module
- datawhispers.advancedProg.PolyCoefficients(x, coeffs)[source]
Returns a polynomial for
xvalues for thecoeffsprovided.The coefficients must be in ascending order (
x**0tox**o).
- class datawhispers.advancedProg.Trend(x, y, ansatz, deg=None)[source]
Bases:
objectTrends Class. Trend objects have values and method attributes.
- datawhispers.advancedProg.add_mnist_num_arrays(num1, num2)[source]
Returns the image of the result and saves it as mnist_result.png
- Parameters:
num1 – np.array of length (784,) or (28,28)
num2 – np.array of length (784,) or (28,28)
- Returns:
Outputs the image
- Raises:
None –
- datawhispers.advancedProg.freeReg(x_in, y_out, ansatz)[source]
Regression with user ansatz. The ansatz is expected to depend on three parameters, a, b, and c. The ansatz is expected to be a string with a symbolic formulation. for instance: ‘a*arctan(b*x_in+c)’.
- Parameters:
x_in – Array with x-values
y – Array with y-values
ansatz –
“linReg”, “polReg”, “trigReg” or “expReg”
- Returns:
coefs
- Raises:
None
- datawhispers.advancedProg.leastSquares(func, x)[source]
Solve a nonlinear least-squares problem with bounds on the variables.
- Parameters:
func – Function which computes the vector of residuals,
fun (with the signature) –
shape (It must allocate and return a 1-D array_like of) –
shape –
residuals (If the argument x is complex or the function fun returns complex) –
:param : :param it must be wrapped in a real function of real arguments: :param as shown at the end of the Examples section.: :param x: Array with x-values
- Returns:
- ndarray, shape (n,)
Solution found.
- cost: float
Value of the cost function at the solution.
- func: ndarray, shape (m,)
Vector of residuals at the solution.
- Return type:
x
- Raises:
None –
- datawhispers.advancedProg.linReg(x_in, y)[source]
Time series linear regression. Returns coefs in polynomial descending order. Coefs computed analytically.
- Args:
x_in: Array with x-values y: Array with y-values
- Returns:
coefs in descending order
- Raises:
None
- datawhispers.advancedProg.make_plot(x, y, y_reg, xticks=[], yticks=[], xlabel='x', ylabel='y', colors=['lightblue', 'black'], name='fig_reg.png')[source]
Outputs a graph for (x and y) and (x and y_reg) and saves it as fig_reg.png
- Parameters:
x – array with x-values
y – array with y-values
y_reg – array with regression y_values
xticks (optional) – list with values to use as x-ticks
yticks (optional) – list with values to use as y-ticks
xlabel (optional) – defualt “x”
ylabel (optional) – defualt “y”
colors (optional) – default [“lightblue”, “black”] scatter=lightblue and line=black
name (optional) – default “fig_reg.png”
- Returns:
Outputs the graph and saves it
- Raises:
None –
- datawhispers.advancedProg.plot_all_regs(x, y, xticks=None, yticks=None)[source]
Returns the regression of all types and saves them as png
- Parameters:
x – array with x-values
y – array with y-values
xticks (optional) – list with values to use as x-ticks
yticks (optional) – list with values to use as y-ticks
- Returns:
Outputs the graphs and saves them
- Raises:
None –
- datawhispers.advancedProg.polReg(x_in, y, deg)[source]
Time series polynomial regression. Returns coefs in polynomial descending order. Coefs computed numerically.
- Parameters:
x_in – Array with x-values
y – Array with y-values
deg –
the degree of the polynomial
- Returns:
coefs in descending order
- Raises:
None
- datawhispers.advancedProg.predict(ansatz, coef, x_in, freeRegAnsatz=None)[source]
Computes the predction for input x_in and the computed corresponding coefficients
- datawhispers.advancedProg.show_mnist_from_array(arr)[source]
Returns the image of the mnist number and saves it as mnist_num.png
- Parameters:
arr – of size (784,) or (28,28) with values from 0 to 255
- Returns:
Outputs the image
- Raises:
None –
datawhispers.datavis module
- datawhispers.datavis.Analyse_Tabelle(df: DataFrame, Zielvariable: str, Anzahl_an_gewünschten_Variablen: Optional[int] = None, Zielvariable_good='', Zielvariable_bad='', Zielvariable_Grenze: int = 0, kategorische_Variablen=[], Numerische_Variablen=[])[source]
Gibt die Tabelle mit den abhängigsten Variablen aus. @param df: Der DataFrame @param Zielvariable: Zielvariable @param Anzahl_an_gewünschten_Variablen (opt.) @param Zielvariable_good: Nur bei KATEGORISCHER Zielvariable @param Zielvariable_bad: Nur bei KATEGORISCHER Zielvariable @param Zielvariable_Grenze: Nur bei NUMERISCHER Zielvariable ;Schwellwert ab wann Gut oder Schlecht sonst Durchschnitt @param kategorische_Variablen: Eingeben einer Liste an kategorischen Variablen, die im Datensatz als numerisch gekennzeichnet sind (opt.) @param numerische_Variablen: Eingeben einer Liste an numerischen Variablen, die im Datensatz als kategorisch gekennzeichnet sind (opt.) @return Tabelle mit Variablen, Kennwerten, Testverfahren
- class datawhispers.datavis.DataVisAnalyse(df, classification_column, good, bad)[source]
Bases:
object- get_T_Test(df=None)[source]
[metrisch] - [kategorisch]
Stellt die unterschiedlichen stat. Abhängigkeiten mit Mittelwert und Standardabweichung visuell dar @self.classification_column: Nur zwei Ausprägungen @return [Variable,p-Wert,t-wert,mü-gut, sigma-gut, mü-schlecht, sigma-schlecht]
- get_corr_table(max: int = 10, df=None)[source]
[numerisch] - [numerisch]
Stellt die stärksten Korrelationen zwischen intervallskalierten Variablen sortiert visuell dar.
Größeres p –> Größere Abhängigkeit @Variabel df: Zugehöriges DataFrame @Variabel max: Maximale Anzahl der Korrelationen
- datawhispers.datavis.Datensatz_bereinigen(df: DataFrame, kategorische_Spalten: list = [], numerische_Spalten: list = [])[source]
Wandelt ‘Numerische Daten’ in Kategorische und anders herum. @return Bereinigter Datensatz als pd.DataFrame
- datawhispers.datavis.T_Test_Rückgabe(df: DataFrame, Zielvariable, Zielvariable_Wert_gut, Zielvariable_Wert_schlecht, Numerische_Grenze, Grafik=False)[source]
[metrisch] - [kategorisch]
Stellt die unterschiedlichen stat. Abhängigkeiten mit Mittelwert und Standardabweichung visuell dar @Zielvariable: Nur zwei Ausprägungen @return [Variable,p-Wert,t-wert,mü-gut, sigma-gut, mü-schlecht, sigma-schlecht]
- datawhispers.datavis.chi_square_all_Rückgabe(df: DataFrame, Zielvariable, Numerische_Grenze)[source]
[kategorisch] - [kategorisch]
Erstellt alle möglichen chi2-Werte und p werte
p<0.05 und chi2 sehr groß –> Signifikant
- datawhispers.datavis.chi_square_einzeln_Rückgabe(df: DataFrame, varname, Zielvariable, Numerische_Grenze=0)[source]
[kategorisch] - [kategorisch]
- datawhispers.datavis.make_scatter_plot(x, y, width: int = 8, height: int = 6, xlabel: str = '', ylabel: str = '', title: str = '', color='gray', filename: str = 'fig.png')[source]
Outputs a scatter plot
- Parameters:
x – array with x-values
y – array with y-values
xticks (optional) – list with values to use as x-ticks
yticks (optional) – list with values to use as y-ticks
xlabel (optional) – str with xlabel
ylabel (optional) – str with ylabel
title (optional) – str with title
color (optional) – str or tuple consisting of rgb values for color
filename (optional) – str with filename or path + filename
- Returns:
Outputs the graph and saves it
- Raises:
None –