Icon

kn_​forum_​49209_​python_​ppscore_​pps

KNIME forum question - Python Predictive Power Score Implementation in Python

KNIME forum question - Python Predictive Power Score Implementation in Python
https://forum.knime.com/t/python-script-adaptation/49209/9?u=mlauber71

in the subfolder /data/ there is a Jupyter notebook
kn_forum_49209_python_ppscore_pps.ipynb

conda activate py3_knime_tconda install -n py3_knime_t -c conda-forge ppscore KNIME forum question - Python Predictive Power Score Implementation in Pythonhttps://forum.knime.com/t/python-script-adaptation/49209/9?u=mlauber71in the subfolder /data/ there is a Jupyter notebookkn_forum_49209_python_ppscore_pps.ipynb import knime_io as knio# This example script creates an output table containing randomly drawn integers using numpy and pandas.import pandas as pdimport numpy as npimport ppscore as ppsdf = pd.DataFrame()df["x"] = np.random.uniform(-2, 2, 1_000_000)df["error"] = np.random.uniform(-0.5, 0.5, 1_000_000)df["y"] = df["x"] * df["x"] + df["error"]knio.output_tables[0] = knio.write_table(df) import pandas as pdimport numpy as npimport ppscore as ppsmat = pps.score(input_table_1, "x", "y")output_table_1 = pd.DataFrame.from_dict(mat, orient='index',columns=['values']).transpose().applymap(str)output_table_2 = pd.DataFrame.from_dict(mat, orient='index', columns=['values']).applymap(str) Genes_to_correlate.tableNode 2py3_knime_tNode 4Genes_to_correlate.tableGenes_to_correlate.parquetGenes_to_correlate.parquetresults.xlsx"results_transposed"results.xlsx"results_column" Table Reader Python Script Conda EnvironmentPropagation Python Script(Labs) Table Writer Parquet Writer Parquet Reader Excel Writer Excel Writer conda activate py3_knime_tconda install -n py3_knime_t -c conda-forge ppscore KNIME forum question - Python Predictive Power Score Implementation in Pythonhttps://forum.knime.com/t/python-script-adaptation/49209/9?u=mlauber71in the subfolder /data/ there is a Jupyter notebookkn_forum_49209_python_ppscore_pps.ipynb import knime_io as knio# This example script creates an output table containing randomly drawn integers using numpy and pandas.import pandas as pdimport numpy as npimport ppscore as ppsdf = pd.DataFrame()df["x"] = np.random.uniform(-2, 2, 1_000_000)df["error"] = np.random.uniform(-0.5, 0.5, 1_000_000)df["y"] = df["x"] * df["x"] + df["error"]knio.output_tables[0] = knio.write_table(df) import pandas as pdimport numpy as npimport ppscore as ppsmat = pps.score(input_table_1, "x", "y")output_table_1 = pd.DataFrame.from_dict(mat, orient='index',columns=['values']).transpose().applymap(str)output_table_2 = pd.DataFrame.from_dict(mat, orient='index', columns=['values']).applymap(str) Genes_to_correlate.tableNode 2py3_knime_tNode 4Genes_to_correlate.tableGenes_to_correlate.parquetGenes_to_correlate.parquetresults.xlsx"results_transposed"results.xlsx"results_column"Table Reader Python Script Conda EnvironmentPropagation Python Script(Labs) Table Writer Parquet Writer Parquet Reader Excel Writer Excel Writer

Nodes

Extensions

Links