Saravanan666/pypi-org huggingface dataset:
Package: kernax
Kernax: regularized Stein thinningimportjaximportjax.numpyasjnprng_key=jax.random.PRNGKey(0)x=jax.random.normal(rng_key,(1000,2))fromjax.scipy.statsimportmultivariate_normaldeflogprob_fn(x):returnmultivariate_normal.logpdf(x,mean=jnp.zeros(2),cov=jnp.eye(2))score_fn=jax.grad(logprob_fn)score_values=jax.vmap(score_fn,0)(x)fromkernax.utilsimportmedian_heuristiclengthscale=jnp.array([median_heuristic(x)])fromkernaximportSteinThinningstein_fn=SteinThinning(x,score_values,lengthscale)indices=stein_fn(100)fromkernaximportlaplace_log_p_softpluslog_p=jax.vmap(score_fn,0)(x)laplace_log_p_values=laplace_log_p_softplus(x,score_fn)fromkernaximportRegularizedSteinThinningreg_stein_fn=RegularizedSteinThinning(x,log_p,score_values,laplace_log_p_values,lengthscale)indices=reg_stein_fn(100)DocumentationDocumentation is available atreadthedocs.ContributingThis code is not meant to be an evolving library. However, feel free to create issues and merge requests.Install guidePyPIpip install kernaxCondaA conda package will soon be available on the conda-forge channel.From sourceTo install from source, clone this repository, then add the package to yourPYTHONPATHor simply dopip install -e .All the requirements are listed in the fileenv.yml. It can be used to create a conda environement as follows.cd kernax-mainconda env create -n kernax -f env.ymlActivate the new environment:conda activate kernaxAnd test if it is working properly:python -c "import kernax; print(dir(kernax))"ReproductibilityThis code implements the regularized Stein thinning algorithm introduced in the paperKernel Stein Discrepancy thinning: a theoretical perspective of pathologies and a practical fix with regularization.Please consider citing the paper when using this library:@article{benard2023kernel,title={Kernel Stein Discrepancy thinning: a theoretical perspective of pathologies and a practical fix with regularization},author={B{\'e}nard, Cl{\'e}ment and Staber, Brian and Da Veiga, S{\'e}bastien},journal={arXiv preprint arXiv:2301.13528},year={2023}}All the numerical experiments presented in thepapercan be reproduced with the scripts made available in the example folder.In particular:Figures 1, 2 & 3 can be reproduced with the script example/mog_randn.pyEach experiment in Section 4 and Appendix 1 can be reproduced with the scripts gathered in the following folders:Gaussian mixture: example/mog4_mcmc and example/mog4_mcmc_dimMixture of banana-shaped distributions: example/mobt2_mcmc and example/mobt2_mcmc_dimBayesian logistic regression: example/logistic_regression.pyTwo additional scripts are also available to reproduce figures shown in the supplementary material:Figure 2: example/mog_weight_weights.pyFigure 6: example/mog4_mcmc_lambda
Package: kerncraft
kerncraftLoop Kernel Analysis and Performance Modeling ToolkitThis tool allows automatic analysis of loop kernels using the Execution Cache Memory (ECM) model,
the Roofline model and actual benchmarks. kerncraft provides a framework to investigate the
data reuse and cache requirements by static code analysis. In combination with the Intel IACA tool
kerncraft can give a good overview of both in-core and memory bottlenecks and use that data to
apply performance models.For a detailed documentation see publications indoc/.InstallationOn most systems with python pip and setuputils installed, just run:pip install--userkerncraftfor the latest release. In order to get theIntel Achitecture Code Analyzer (IACA), required by theECM,ECMCPUandRooflineASMperformance models, readthisand run:iaca_get--I-accept-the-Intel-What-If-Pre-Release-License-Agreement-and-please-take-my-soulAdditional requirements are:likwid(used in Benchmark model and bylikwid_bench_auto)UsageGet an example kernel and machine file from the examples directorywgethttps://raw.githubusercontent.com/RRZE-HPC/kerncraft/master/examples/machine-files/SandyBridgeEP_E5-2680.ymlwgethttps://raw.githubusercontent.com/RRZE-HPC/kerncraft/master/examples/kernels/2d-5pt.cHave a look at the machine file and change it to match your targeted machine (above we downloaded a file for a Sandy Bridge EP machine)Run kerncraftkerncraft-pECM-mSandyBridgeEP_E5-2680.yml2d-5pt.c-DN 10000-DM 10000add-vvfor more information on the kernel and ECM model analysis.CitationsWhen using Kerncraft for your work, please consider citing the following publication:Kerncraft: A Tool for Analytic Performance Modeling of Loop Kernels(preprint)J. Hammer, J. Eitzinger, G. Hager, and G. Wellein: Kerncraft: A Tool for Analytic Performance Modeling of Loop Kernels. In: Tools for High Performance Computing 2016, ISBN 978-3-319-56702-0, 1-22 (2017). Proceedings of IPTW 2016, the 10th International Parallel Tools Workshop, October 4-5, 2016, Stuttgart, Germany. Springer, Cham. DOI: 10.1007/978-3-319-56702-0_1, Preprint: arXiv:1702.04653``CreditsImplementation: Julian Hammer;ECM Model (theory): Georg Hager, Holger Stengel, Jan Treibig;LC generalization: Julian HammerLicenseAGPLv3
Package: kerndeterminer
Kern determinerWork out how far apart things should be (very quickly)kerndetermineris a Rust-based library for determining a kern
value between two glyphs of a font source file.(Don't use it for Latin kerning; it won't work. But it works fine for many other scripts)Given a font, two glyphs, and a target distance (and a few other parameters),kerndeterminerwill return the kern value which places the contours of the
two glyphs the given distance apart at their closest point. The graphic
below explains the main parameters and the effect ofkerndeterminer:How to useFirst, create aKernDeterminerobject. This loads the font, since you'll
probably be making quite a few calls todetermine_kernand won't want to
load the font each time:fromkerndeterminerimportKernDeterminerkerner=KernDeterminer("MyFont.glyphs")The font source can be any source loadable by the Rust version of Babelfont
(currently Glyphs version 3 files, UFO, and Designspace files).Next, call thedetermine_kernmethod on that object:kern=kerner.determine_kern("JIMi10",# Left glyph"REu1",# Right glyph"Regular",# Master name120,# Target distance200,# Height0.8,# Max tuck)This will return the optimal kerning value for that pair at the given
parameters. Note:Theheightparameter is used to translate the left glyph vertically befor kerning. This is used in Arabic fonts with cursive attachment.Themax_tuckparameter is a ratio of the left glyph's width which forms an upper limit on the kerning value. For example, ifmax_tuckis 0.5, the leftmost point on the right glyph can only be placed so that it is 50% of the way underneath the left glyph:
Package: kernelbiome
KernelBiome packageTheKernelBiomepython package can be installed viapip install kernelbiomeorpython -m pip install git+https://github.com/shimenghuang/KernelBiome.gitSmall usage example:import numpy as np
from kernelbiome.kernelbiome import KernelBiome

# Simulated some data
n = 100
X1 = np.random.normal(0, 1, n)
X2 = np.random.normal(0, 1, n)
X3 = np.random.normal(0, 1, n)
X4 = np.random.normal(0, 1, n)
X = np.exp(np.c_[X1, X2, X3, X4])
X /= X.sum(axis=1)[:, None]
y = 5*(X[:, 0]+X[:, 1])/(X[:, 0]+X[:, 1]+X[:, 2]) + np.random.normal(0, 1, n)/2

# Fit KernelBiome
models = {
    'linear': None,
    'aitchison': {'c': np.logspace(-7, -3, 5)},
}
KB = KernelBiome(kernel_estimator='KernelRidge',
                 center_kmat=True,
                 models=models, # `models=None` for using all default models
                 verbose=1)
KB.fit(X, y)

# Calculate mean squared error
MSE = np.sqrt(np.mean((KB.predict(X) - y)**2))For a complete usage example, seekernelbiome_illustration.pyReproducible CodeThisrepositorycontains the python packageKernelBiomeand code that can reproduce results in the paperSupervised Learning and Model Analysis with Compositional Data (Huang et al., 2022).All scripts producing results in the paper can be found in theexperimentsfolder with some helper functions for the experiment scripts located in thehelpersfolder. Scripts starting with "run_" are used to run computation and save results, and scripts starting with "summarize_" are used to load and summarize results in e.g. figures.data_originalanddata_processedare folder to place the original and to save the processed datasets respectively. See README files therein for details.predictionPrediction comparison on the 33 publicly available datasets on classification and regression.post_analysisPost-analysis including CFI and kernel PCA for two of the public datasets,cirrhosisandcentralpark.tree_visualizationVisualization of CFI base on weighted and unweighted KernelBiome.consistencySimulation to show consistency results in the paper.toy_exampleslog_contrast_example.py: Illustration of CFI and CPD in the case of log contrast model using simulated data.rescale_matters_example.py: Comparison of CFI and CPD with relative influence (RI) and partial dependency plot (PDP) based on simulated data.
Package: kernelbridge
KernelBridgeEfficient, interoperable kernel creation and combination.Free software: BSD licenseDocumentation:https://kernelbridge.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1a1 (2020-03-24)First release on PyPI.
Package: kernel-killer
kernel_killerExtension to kill kernel on tab closingThis extension is composed of a Python package namedkernel_killerfor the server extension and a NPM package namedkernel_killerfor the frontend extension.RequirementsJupyterLab >= 4.0.0InstallTo install the extension, execute:pipinstallkernel_killerUninstallTo remove the extension, execute:pipuninstallkernel_killerTroubleshootIf you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:jupyterserverextensionlistIf the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:jupyterlabextensionlistContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the kernel_killer directory# Install package in development modepipinstall-e"."# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Server extension must be manually installed in develop modejupyterserverextensionenablekernel_killer# Rebuild extension Typescript source after making changesjlpmbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseDevelopment uninstall# Server extension must be manually disabled in develop modejupyterserverextensiondisablekernel_killer
pipuninstallkernel_killerIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedkernel_killerwithin that folder.Packaging the extensionSeeRELEASE
Package: kernelmch
KernelGaussianoEsta es una clase de Python que implementa el kernel gaussiano para suavizar una serie de tiempo. Esta clase permite cargar datos desde un archivo CSV, suavizar la serie de tiempo y graficar tanto la serie original como la suavizada.RequisitosAsegúrate de tener instaladas las siguientes bibliotecas antes de utilizar esta clase:pandasnumpymatplotlibPuedes instalarlas utilizandopip:pipinstallpandasnumpymatplotlibUsofromKernelGaussianoimportKernelGaussiano# Inicializa la clase con la ruta del archivo CSV y el valor de sigma (parámetro de suavizado)kernel=KernelGaussiano("archivo.csv",sigma)# Grafica la serie de tiempo original y suavizadakernel.PlotGaussianKernel()Parámetrosdata(str): Ruta del archivo CSV con los datos de la serie de tiempo.sigma(float): Parámetro de suavizado.Nota: El archivo CSV debe contener dos columnas con los nombres 'fecha_actualizacion' y 'nuevos_casos' para que esta clase funcione correctamente.Ejemplokernel=KernelGaussiano("datos_covid.csv",3.0)kernel.PlotGaussianKernel()CréditosEsta librería fue desarrollada por Luciano Muñoz.ContactoSi tienes alguna pregunta o comentario, no dudes en ponerte en contacto conmigo a través de mi correo electrónico: [luciano.munoz1@udea.edu.co].
Package: kernelmethods
Kernel methods and classesDocs:https://raamana.github.io/kernelmethods/Demo notebooks:kernelmethodskernelmethodsis a pure python library defining modular classes that provides basic kernel methods, such as computing various kernel functions on a given sample (N points of dimension p) as well as provides an intuitive interface for advanced functionality such as composite and hyper kernels. This library fills an important void in the ever-growing python-based machine learning ecosystem, where users can only use predefined kernels and are not able to customize or extend them for their own applications, that demand great flexibility owing to their diversity and need for better performing kernel. This library defines theKernelMatrixclass that is central to all the kernel methods and machines. As theKernelMatrixclass is a key bridge between input data and the various kernel learning algorithms, it is designed to be highly usable and extensible to different applications and data types. Besides being able to apply basic kernels on a given sample (to produce aKernelMatrix), this library provides various kernel operations, such as normalization, centering, product, alignment evaluation, linear combination and ranking (by various performance metrics) of kernel matrices.In addition, we provide several convenient classes, such asKernelSetandKernelBucketfor easy management of a large collection of kernels.  Dealing with a diverse configuration of kernels is necessary for automatic kernel selection and optimization in applications such as Multiple Kernel Learning (MKL) and the like.In addition to the common numerical kernels such as the Gaussian and Polynomial kernels, we designed this library to make it easy to develop categorical, string and graph kernels, with the same attractive properties of intuitive and highly-testable API. In addition to providing native implementation of non-numerical kernels, we aim to provide a deeply and easily extensible framework for arbitrary input data types, such as sequences, trees and graphs etc, via data structures such aspyradigm.Moreover, drop-inEstimatorclasses are provided, calledKernelMachine, offering the power ofSVMfor seamless usage in thescikit-learnecosystem. Another useful class is calledOptimalKernelSVRwhich finds the most optimal kernel func for a given sample, and trains the SVM using the optimal kernel.Docshttps://raamana.github.io/kernelmethods/Demo notebooks:NoteThe software is beta. All types of contributions are greatly welcome.History0.0.1 (2018-12-26)First release on PyPI.
Package: kerneloose
kerneloosePython implementation of the kernel method for out-of-sample extension (OOSE) of dimensionality reduction techniques.Based on"Parametric nonlinear dimensionality reduction using kernel t-SNE" by Gisbrecht, Schulz, and Hammer.The kernel method is particularly useful for projection techniques that are computationally expensive and/or have non-convex objective functions, such ast-SNE.Installationpip install kernelooseUsage exampleThe syntax follows scikit learn conventions.
Assumehd_datais a numpy array containing high-dimensional data, and an arrayld_dataof equal length but lower dimension was obtained by some projection technique.
An OOSE of that projection can be obtained by:fromkernelooseimportKernelMapkernel_oose=KernelMap()kernel_oose.fit(hd_data,ld_data)The mapping can be applied tonew_data(with same dimensionality asld_data) simply by:kernel_oose.transform(new_data)Parameters of the calculated OOSE mapping can be saved and loaded for later use:kernel_oose.save('some/file/name')resume_later=KernelMap()resume_later.load('some/file/name')
Package: kernel-openmodelica
A Jupyter kernel for OpenModelica.ImportantThis project is a fork from the originaljupyter-openmodelica.
The goal of forking was to perform an important refactor and improve PEP 8 compliance, but also to
fix a few bugs because the original source seems abandonned. If this works I will reach the OM
maintainers and propose to replace the project with the updated code. Plotting is still extremely
fragile and not customizable! Only works properly with Jupyter Notebook and kernel restart is not
working, requires to force shutdown the kernel.
Any help is welcomed!PrerequisitesJupyter NotebookOpenModelicaOMPythonInstallationBefore proceeding follow the installation instructions in OMPython as given in the prerequisites.
Make sure the environment variable for OpenModelica is set e.g.:OPENMODELICAHOME=C:/OpenModelica1.20.0-64bit/. Once everything is set, install the package withpipfrom PyPI or clone and build this repository.pip install kernel_openmodelica
Package: kernelparcial
KernelsEsta es una clase de Python que implementa el kernel gaussiano, kernel tricúbico y kernel Epanechnikov para suavizar una serie de tiempo. Esta clase permite cargar datos desde un archivo CSV, suavizar la serie de tiempo y graficar tanto la serie original como la suavizada.RequisitosAsegúrate de tener instaladas las siguientes bibliotecas antes de utilizar esta clase:pandasnumpymatplotlibPuedes instalarlas utilizandopip:pipinstallpandasnumpymatplotlibUsofromkernelparcialimportKernels# Inicializa la clase con la ruta del archivo CSV y el valor de sigma (parámetro de suavizado)kernels=Kernels("archivo.csv",sigma)# Grafica la serie de tiempo original y suavizada con el Kernel Gaussiano.kernels.PlotGaussianKernel()# Grafica la serie de tiempo original y suavizada con el Kernel Tricúbico .kernels.PlotTricubeKernel()# Grafica la serie de tiempo original y suavizada con el Kernel Epanechnikov.kernels.PlotEpanechnikovKernel()#Grafica la serie de tiempo original y la suavizada con los Kernel Gaussianos, Tricúbico y Epanechnikov.kernels.PlotAllKernels()Parámetrosdata(str): Ruta del archivo CSV con los datos de la serie de tiempo.sigma(float): Parámetro de suavizado.Nota: El archivo CSV debe contener dos columnas con los nombres 'fecha_actualizacion' y 'nuevos_casos' para que esta clase funcione correctamente.Ejemplokernel=KernelGaussiano("datos_covid.csv",3.0)kernel.PlotAllKernels()CréditosEsta librería fue desarrollada por Luciano Muñoz.ContactoSi tienes alguna pregunta o comentario, no dudes en ponerte en contacto conmigo a través de mi correo electrónico: [luciano.munoz1@udea.edu.co].
Package: kernel-scilab
A Jupyter kernel for ScilabImportantThis project is a fork from the originalscilab_kernel.
The goal of forking was to perform an important refactor and improve PEP 8 compliance, but also to
fix a few bugs related to executable path and figure display. Since the original kernel has not been
updated for a few years and it did not work out-of-the-box with the latest version of Scilab, This
was also a personal opportunity to learn a bit more about kernel implementation. There are still
some open ends, specially in command parsing (Jupyter does not have a mimetype JavaScript file for
Scilab language and here we continue using the one from Octave) and the criteria to display figures.
Any help is welcomed!PrerequisitesJupyter NotebookScilabInstallationpip install kernel_scilabTo use it, run one of:ipythonnotebook# In the notebook interface, select Scilab from the 'New' menuipythonqtconsole--kernelscilabipythonconsole--kernelscilabThis kernel is based onMetaKernel, which means it
features a standard set of magics.  For a full list of magics, run%lsmagicin a cell.If Scilab is not added to thePATHenvironmental variable, then you need to specify the path
to your Scilab executable by creating aSCILAB_EXECUTABLEenvironmental variable.  Use thescilab-adv-cliexecutable if using a Posix-like OS, andWScilex-cli.exeif using Windows.ConfigurationThe kernel can be configured by adding ankernel_scilab_config.pyfile to thejupyterconfig path.  TheScilabKernelclass offersplot_settingsas a configurable traits.
The available plot settings are shown in the following snippet.cat~/.jupyter/kernel_scilab_config.pyc.ScilabKernel.plot_settings={"format":"svg","backend":"inline","size":"600,500",}TroubleshootingIf the kernel is not starting, try running the following from a terminal.python-mkernel_scilab.checkPlease include that output if opening an issue.Advanced Installation NotesWe automatically install a Jupyter kernelspec when installing the python package.
This location can be found usingjupyter kernelspec list. If the default location
is not desired, you can remove the directory for thekernel_scilabkernel, and
install usingpython -m kernel_scilab install.
Seepython-mkernel_scilab install--helpfor available options.
Package: kernels-mixer
Jupyter Kernel MixingThis package provides a Jupyter Server extension that allows you to run local and remote
kernels side by side.It does this by "mixing" the local and remote kernels together into a single collection
containing both.This collection then keeps track of whether specific kernels were local or remote and
forwards any corresponding kernel requests accordingly.InstallationInstall thekernels-mixerPython package usingpip:pipinstallkernels-mixerSetupIf you do not already have a Jupyter config file (e.g.~/.jupyter/jupyter_lab_config.py),
the first generate one with the following command:jupyterlab--generate-configThe open your config file and add the following two lines to the end:importkernels_mixerkernels_mixer.configure_kernels_mixer(c)Kernel Name UniquenessThis extension expects that local and remote kernels have different names. If that is not
the case then the local kernel will override the remote kernel. For example, if there is
a local kernel named "python3", then any kernels in the remote kernel gateway named "python3"
will be hidden in favor of it.When using this extension, it is recommended that the remote kernel gateway is set up to
add a prefix onto every kernel name in order to distinguish them from the local kernels.Similarly, it is recommended that remote kernel display names are augmented to indicate
where they are running.The default kernel gateway used with this extension is the regional GCP kernel gateway
hosted underkernels.googleusercontent.com, which ensures that both of those conditions
are followed.
Package: kernelutility
kernelutility- A Python package for managing Python kernelsJoseph P. Vantassel, Texas Advanced Computing Center - The University of Texas at AustinAboutkernelutilitykernelutilitywas developed to allow users of the DesignSafe-CyberInfrastructure's
JupyterHub to easily manage their own Python kernels, which include a dedicated Python
interpreter and associated packages.Getting StartedStart a notebook or terminal in DesignSafe's JupyterHub. Note that you must use the latest
Jupyter notebook image.Installkernelutilitywith!pip install kernelutility(if in notebook) orpip install kernelutility(if in terminal).
If you are in a notebook you must restart your kernel for the installation ofkernelutilityto be visible to Python.Load kernelset withfrom kernelutility import kernelset. This will initialize your kernel
set and reactivate any prior kernels
if they are present.Use the methods ofkernelsetto modify your available kernels. The key methods areadd,remove,create, anddestroy. See the examplekernelutility.ipynband the API documentation
for more information.