Saravanan666/pypi-org huggingface dataset:
Package: sklearn-jax-kernels
sklearn-jax-kernelsWarning: This project is still in an early stage it could be that the API
will change in the future, further functionality is still very limited to the
use cases which defined the creation of the project (application to DNA
sequences present in Biology).Why?Ever wanted to run a kernel-based model fromscikit-learnon a relatively large dataset?  If so
you will have noticed, that this can take extraordinarily long and require huge
amounts of memory, especially if you are using compositions of kernels (such as
for examplek1 * k2 + k3).  This is due to the way Kernels are computed in
scikit-learn: For each kernel, the complete kernel matrix is computed, and the
compositions are then computed from the kernel matrices.  Further,scikit-learndoes not rely on an automatic differentiation framework for the
computation of gradients though kernel operations.Introductionsklearn-jax-kernelswas designed to circumvent these issues:The utilization ofJAXallows accelerating
kernel computations throughXLAoptimizations, computation on GPUs and simplifies the computation of
gradients though kernelsThe composition of kernels takes place on a per-element basis, such that
unnecessary copies can be optimized away by JAX compilationThe goal ofsklearn-jax-kernelsis to provide the same flexibility and ease
of use as known fromscikit-learnkernels while improving speed and allowing
the faster design of new kernels through Automatic Differentiation.The kernels in this package follow thescikit-learn kernel
API.QuickstartA short demonstration of how the kernels can be used, inspired by thescikit-learn
documentation.fromsklearnimportdatasetsimportjax.numpyasjnpfromsklearn_jax_kernelsimportRBF,GaussianProcessClassifieriris=datasets.load_iris()X=jnp.asarray(iris.data)y=jnp.array(iris.target,dtype=int)kernel=1.+RBF(length_scale=1.0)gpc=GaussianProcessClassifier(kernel=kernel).fit(X,y)Here a further example demonstrating how kernels can be combined:fromsklearn_jax_kernels.base_kernelsimportRBF,NormalizedKernelfromsklearn_jax_kernels.structured.stringsimportSpectrumKernelmy_kernel=RBF(1.)*SpectrumKernel(n_gram_length=3)my_kernel_2=RBF(1.)+RBF(2.)my_kernel_2=NormalizedKernel(my_kernel_2)Some further inspiration can be taken from the tests in the subfoldertests.Implemented KernelsKernel compositions ($+,-,*,/$, exponentiation)Kernels for real valued data:RBF kernelKernels for same length strings:SpectrumKernelDistanceSpectrumKernel, SpectrumKernel with distance weight between
matching substringsReverseComplement Spectrum kernel (relevant for applications in Biology
when working with DNA sequences)TODOsImplement more fundamental KernelsImplement jax compatible version of GaussianProcessRegressorOptimize GaussianProcessClassifier for performanceRun benchmarks to show benefits in speedAdd fake "split" kernel which allows to apply different kernels to different
parts of the input
Package: sklearn-json
sklearn-jsonExport scikit-learn model files to JSON for sharing or deploying predictive models with peace of mind.Why sklearn-json?Other methods for exporting scikit-learn models require Pickle or Joblib (based on Pickle). Serializing model files with Pickle provide a simple attack vector for malicious users-- they give an attacker the ability to execute arbitrary code wherever the file is deserialized. (For an example see:https://www.smartfile.com/blog/python-pickle-security-problems-and-solutions/).sklearn-json is a safe and transparent solution for exporting scikit-learn model files.SafeExport model files to 100% JSON which cannot execute code on deserialization.TransparentModel files are serialized in JSON (i.e., not binary), so you have the ability to see exactly what's inside.Getting Startedsklearn-json makes exporting model files to JSON simple.Installpip install sklearn-jsonExample Usageimportsklearn_jsonasskljsonfromsklearn.ensembleimportRandomForestClassifiermodel=RandomForestClassifier(n_estimators=10,max_depth=5,random_state=0).fit(X,y)skljson.to_json(model,file_name)deserialized_model=skljson.from_json(file_name)deserialized_model.predict(X)FeaturesThe list of supported models is rapidly growing. If you have a request for a model or feature, please reach out tosupport@mlrequest.com.sklearn-json requires scikit-learn >= 0.21.3.Supported scikit-learn ModelsClassificationsklearn.linear_model.LogisticRegressionsklearn.linear_model.Perceptronsklearn.discriminant_analysis.LinearDiscriminantAnalysissklearn.discriminant_analysis.QuadraticDiscriminantAnalysissklearn.svm.SVCsklearn.naive_bayes.GaussianNBsklearn.naive_bayes.MultinomialNBsklearn.naive_bayes.ComplementNBsklearn.naive_bayes.BernoulliNBsklearn.tree.DecisionTreeClassifiersklearn.ensemble.RandomForestClassifiersklearn.ensemble.GradientBoostingClassifiersklearn.neural_network.MLPClassifierRegressionsklearn.linear_model.LinearRegressionsklearn.linear_model.Ridgesklearn.linear_model.Lassosklearn.svm.SVRsklearn.tree.DecisionTreeRegressorsklearn.ensemble.RandomForestRegressorsklearn.ensemble.GradientBoostingRegressorsklearn.neural_network.MLPRegressor
Package: sklearn-kmedoids-on-string
This repo is forked from scikit-learn-extra, and removed validations to make kmedoids to work with string data for custom callable distance metric.scikit-learn-extra is a Python module for machine learning that extends scikit-learn. It includes algorithms that are useful but do not satisfy the scikit-learninclusion criteria, for instance due to their novelty or lower citation number.This repo forked from scikit-learn-extra, and removed validations to make kmedoids to workd with string data for custom callable distance metric.InstallationDependenciessklearn-kmedoids-string requires,Python (>=3.7)scikit-learn (>=0.24), and its dependenciesInstallationInstall from PyPi with,pip install sklearn-kmedoids-on-string==0.3.0.dev0
Package: sklearn-linear-model-modification
SKLearn Linear Model ModificationThis class should act exactly like sklearn linear model to solve regression problems with the benefit of being able to use drop1 and add1 based on AIC.InstallationRun the following to install:pipinstallsklearn_linear_model_modificationUsageimport pandas as pd
from sklearn_linear_model_modification import LinearRegression, Add1LinearRegression, Drop1LinearRegression
from sklearn_linear_model_modification import Lasso, Add1Lasso, Drop1Lasso
from sklearn_linear_model_modification import ElasticNet, Add1ElasticNet, Drop1ElasticNet
from sklearn_linear_model_modification import Ridge, Add1Ridge, Drop1Ridge

def load_Xy():
    data = load_boston()
    X = pd.DataFrame( data['data'], columns=data['feature_names'] )
    y = data['target']
    return X, y



X, y = load_Xy()

lmod = Ridge()
lmod.fit(X, y)

lmod = Lasso()
lmod.fit(X, y)

lmod = ElasticNet()
lmod.fit(X, y)

lmod = LinearRegression()
lmod.fit(X, y)


lmod = Add1Ridge()
lmod.fit(X, y)

lmod = Add1Lasso()
lmod.fit(X, y)

lmod = Add1ElasticNet()
lmod.fit(X, y)

lmod = Add1LinearRegression()
lmod.fit(X, y)

lmod = Drop1Ridge()
lmod.fit(X, y)

lmod = Drop1Lasso()
lmod.fit(X, y)

lmod = Drop1ElasticNet()
lmod.fit(X, y)

lmod = Drop1LinearRegression()
lmod.fit(X, y)Development sklearn_linear_model_modificationTo install sklearn_linear_model_modification, along with the tools you need to develop and run tests, run the following in your virtualend:$pipinstall-e.[dev]
Package: sklearn-lmer
sklearn-lmer - Scikit-learn estimator wrappers for pymer4 wrapped LME4 mixed effects modelssklearn-lmer is a simple package to wrap the convienience
ofpymer4’slme4wrapping in amostlysklearncompatible regressor class.Refer to thedocumentationfor examples and api.Linear mixed effects regressionsLinear mixed effects regressions are great, but if you’re here,
you probably already agree. You can find more infomration about
them elsewhere, the linkslme4aren’t a bad place to start.InstallationMixing r and python used to be a bit more fraught, but rpy2 and conda
seem to be working together better these days.
To install first get a conda environment with the dependencies:>>> conda create -n sklmer -c conda-forge numpy scipy rpy2 r-lme4 r-lmertest r-lsmeans tzlocalThen pip install sklearn-lmer:>>> pip install sklearn-lmerUsageIt can be imported as:>>> from sklmer import LmerRegressorNow themostlypart of that compatiblity is that init does have two required paramters:
a formula and the names of the columns holding independent variables and grouping variables
(I’ve called this parameterX_colseven though it is more than just X). When I use this I’ve got my data in a dataframe and just passdataframe.columnswithX_colslike so>>> df = pd.read_csv(os.path.join(get_resource_path(),'sample_data.csv'))
>>> lreg = LmerRegressor('DV ~ IV2 + (IV2|Group)', X_cols=df.columns)If you want the best compatibility with sklearn it probably makes sense to split
out the dataframe into X, y, and group variables, though since you’ve defined a formula
it’s ok if the y and group columns are in X>>> X = df.values
>>> y = df.DV.values
>>> groups = df.Group.valuesOnce you’ve done that, it seems to work fine with other sklearn tools, likecross_val_score>>> logo = LeaveOneGroupOut()
>>> cross_val_score(lreg, X=X, y=y, cv=logo.split(X, groups=groups), scoring='neg_mean_squared_error')
Package: sklearn-lvq
WarningRepository and Package Name changed to sklearn-lvq!Generalized Learning Vector QuantizationScikit-learn compatible implementation of GLVQ, GRLVQ, GMLVQ, LGMLVQ
RSLVQ, MRSLVQ and LMRSLVQ.Compatible with Python2.7, Python3.6 and above.This implementation is based on the Matlab implementation
provided by Biehl, Schneider and Bunte (http://matlabserver.cs.rug.nl/gmlvqweb/web/).Important Linksscikit-learn (http://scikit-learn.org/)documentation (https://sklearn-lvq.readthedocs.io/en/latest/?badge=latest)InstallationTo install this module run:pip install .orpip install sklearn-lvqTo also install the extras, usepipinstall.[docs,examples,tests]orpipinstall-Usklearn-lvq[docs,examples,tests]ExamplesTo run the examples:pip install -U sklearn-lvq[examples]The examples can be found in the examples directory.TestingTo run testss:pip install -U sklearn-lvq[tests]Tests are located in thesklearn_lvq/testsfolder
and can be run with thenosetestscommand in the main directory.DocumentationTo build the documentation locally, ensure that you have sphinx, sphinx-gallery,
pillow, sphinx_rt_theme, metric_learn and matplotlib by executing:pip install -U sklearn-lvq[docs]
Package: sklearn-mlmlm
scikit-mlmlmis a Python and scikit-learn compatible implementation of Minimal Learning Machine - Multi Label Classifier, based on the Arxiv paperMinimal Learning Machine for Multi-Label Learningand the GitHub repositoryhttps://github.com/jookriha/ml-mlm.Example Implementation:A quick demo can be found inml_mlmlm_demo.pyat the root of the project.
Package: sklearn-model
sklearn-modelPython implementation for exportingscikit-learnmodels as perJSON Machine Learning  Model (JMLM) specificationInstallationpip3 install sklearn-modelUsageCheck out the following Jupyter notebooks in theexamplesdirectory.Linear RegressionKMeansDecision Tree ClassificationIssues & ContributionPlease feel free to raise an issue in case of any query or send a pull request to contribute.
Package: sklearn-nature-inspired-algorithms
Nature-Inspired Algorithms for scikit-learnNature-inspired algorithms for hyper-parameter tuning ofscikit-learnmodels. This package uses algorithms implementation fromNiaPy.Installation$pipinstallsklearn-nature-inspired-algorithmsTo install this package on Fedora, run:$dnfinstallpython3-sklearn-nature-inspired-algorithmsUsageThe usage is similar to using sklearn'sGridSearchCV. Refer to thedocumentationfor more detailed guides and more examples.fromsklearn_nature_inspired_algorithms.model_selectionimportNatureInspiredSearchCVfromsklearn.ensembleimportRandomForestClassifierparam_grid={'n_estimators':range(20,100,20),'max_depth':range(2,40,2),'min_samples_split':range(2,20,2),'max_features':["auto","sqrt","log2"],}clf=RandomForestClassifier(random_state=42)nia_search=NatureInspiredSearchCV(clf,param_grid,algorithm='hba',# hybrid bat algorithmpopulation_size=50,max_n_gen=100,max_stagnating_gen=10,runs=3,random_state=None,# or any number if you want same results on each run)nia_search.fit(X_train,y_train)# the best params are stored in nia_search.best_params_# finally you can train your model with best params from nia searchnew_clf=RandomForestClassifier(**nia_search.best_params_,random_state=42)Also you plot the search process withline plotorviolin plot.fromsklearn_nature_inspired_algorithms.helpersimportscore_by_generation_lineplot,score_by_generation_violinplot# line plot will plot all of the runs, you can specify the metric to be plotted ('min', 'max', 'median', 'mean')score_by_generation_lineplot(nia_search,metric='max')# in violin plot you need to specify the run to be plottedscore_by_generation_violinplot(nia_search,run=0)Jupyter notebooks with full examples are available inhere.Using a Custom Nature-Inspired AlgorithmIf you do not want to use any of the pre-defined algorithm configurations, you can use any algorithm from theNiaPycollection.
This will allow you to have more control of the algorithm behavior.
Refer to theirdocumentationandexamplesfor the usage.Note:Use version >2.x.x of NiaPy packagefromniapy.algorithms.basicimportGeneticAlgorithmalgorithm=GeneticAlgorithm()# when custom algorithm is provided random_state is ignoredalgorithm.set_parameters(NP=50,Ts=5,Mr=0.25)nia_search=NatureInspiredSearchCV(clf,param_grid,algorithm=algorithm,population_size=50,max_n_gen=100,max_stagnating_gen=20,runs=3,)nia_search.fit(X_train,y_train)ContributingDetailed information on the contribution guidelines are in theCONTRIBUTING.md.
Package: sklearn-pandas-transformers
The main use of this package is to use Sklearn Pipeline with transformer / estimator that doesn't comply with the basic Pipeline:1 - Use sklearn Pipeline with transformation on Y:from sklearn_pandas_transformers.transformers import SplitXY, EstimatorWithoutYWrapper, SklearnPandasWrapper

from sklearn.ensemble import RandomForestRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.impute import KNNImputer
from sklearn.pipeline import Pipeline
import pandas as pd
import numpy as np

input_df = pd.DataFrame([[0, 1, 2, 3], [4, 5, 6, 7], [8, np.nan, 9, 10]])
input_df.columns = ["a", "b", "c", "d"]

spliter = SplitXY("a")

pipe = Pipeline([
        ("imputer", SklearnPandasWrapper(KNNImputer())),
        ("spliter", spliter), ("scaler", StandardScaler()),
        ("rf",
            EstimatorWithoutYWrapper(RandomForestRegressor(random_state=45),
                                    spliter))
    ])
pipe.fit(input_df)

res = pipe.predict(input_df)2 - Use sklearn Transformer (returning numpy array)  to return pandas DataFrame (with unchanged columns names):SklearnPandasWrapper(StandardScaler()))
Package: sklearn-pmml
[![Build Status](https://travis-ci.org/alex-pirozhenko/sklearn-pmml.svg)](https://travis-ci.org/alex-pirozhenko/sklearn-pmml)
[![Join the chat athttps://gitter.im/alex-pirozhenko/sklearn-pmml](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/alex-pirozhenko/sklearn-pmml?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)# sklearn-pmmlA library that allows serialization of SciKit-Learn estimators into PMML# Installation
The easiest way is to use pip:` pip installsklearn-pmml`# Supported models
- DecisionTreeClassifier
- DecisionTreeRegressor
- GradientBoostingClassifier
- RandomForestClassifier# PMML output## Classification
Classifier converters can only operate with categorical outputs, and for each categorical output variable`varname`the PMML output contains the following outputs:
- categorical`varname`for the predicted label of the instance
- double`varname.label`for the probability for a given label## Regression
Regression model PMML outputs the numeric response variable named as the output variable
Package: sklearnpy
importgzipdefun_gz(file_name):#获取文件名，去掉后缀名f_name=filename.replace(".gz","")#开始解压g_file=gzip.GzipFile(file_name)#读取解压后的文件，并写入去掉后缀名的同名文件open(f_name,"wb+").write(g_file.read())g_file.close()un_gz('D:\D盘\Desktop\cvyuan-0.1.tar.gz')#绝对路劲gitconfig--globaluser.email"moudexiao@gamil.com"gitconfig--globaluser.name"moudexiao"gitconfighttp.sslVertifyfalseecho"# duoyuantongji">>README.md
gitinit
gitaddREADME.md
gitcommit-m"first commit"gitbranch-Mmain
gitremoteaddoriginhttps://github.com/moudexiao/duoyuantongji.git
gitpush-uoriginmain


gitremoteaddoriginhttps://github.com/moudexiao/duoyuantongji.git
gitbranch-Mmain
gitpush-uoriginmainExample PackageThis is a simple example package. You can useGithub-flavored Markdownto write your content.
Package: sklearn-pycrfsuite
sklearn-crfsuite is a thinCRFsuite(python-crfsuite) wrapper which provides
interface simlar toscikit-learn.sklearn_crfsuite.CRFis a scikit-learn
compatible estimator: you can use e.g. scikit-learn model
selection utilities (cross-validation, hyperparameter optimization) with it,
or save/load CRF models usingjoblib.License is MIT.Documentation can be foundhere.Changes0.3.6 (2017-06-22)addedsklearn_crfsuite.metrics.flat_recall_score.0.3.5 (2017-03-21)Properly close file descriptor inFileResource.cleanup;declare Python 3.6 support, stop testing on Python 3.3.0.3.4 (2016-11-17)Small formatting fixes.0.3.3 (2016-03-15)scikit-learn dependency is now optional for sklearn_crfsuite;
it is required only when you use metrics and scorers;addedmetrics.flat_precision_score.0.3.2 (2015-12-18)Ignore more errors inFileResource.__del__.0.3.1 (2015-12-17)Ignore errors inFileResource.__del__.0.3 (2015-12-17)Addedsklearn_crfsuite.metrics.sequence_accuracy_score()function and
relatedsklearn_crfsuite.scorers.sequence_accuracy;FileResource.__del__method made more robust.0.2 (2015-12-11)backwards-incompatible:crf.taggerattribute is renamed tocrf.tagger_; when model is not trained accessing this attribute
no longer raises an exception, its value is set to None instead.new CRF attributes available after training:classes_size_num_attributes_attributes_state_features_transition_features_Tutorial is added.0.1 (2015-11-27)Initial release.
Package: sklearn-quantile
This module provides quantile machine learning models for python, in a plug-and-play fashion in the sklearn environment. This means that practically the only dependency is sklearn and all its functionality is applicable to the here provided models without code changes.The models implemented here share the trait that they are trained in exactly the same way as their non-quantile counterpart. The quantile information is only used in the prediction phase. The advantage of this (over for example Gradient Boosting Quantile Regression) is that several quantiles can be predicted at once without the need for retraining the model, which overall leads to a significantly faster workflow. Note that accuracy of doing this depends on the data. As can be seen in the example in the documentation: with certain data characteristics different quantiles might require different parameter optimisation for optimal performance. This is obviously possible with the implemented models here, but this requires the use of a single quantile during prediction, thus losing the speed advantage described above.For guidance see docs (through the link in the badge). They include an example that for quantile regression forests in exactly the same template as used for Gradient Boosting Quantile Regression in sklearn for comparability.Implemented:Random Forest Quantile RegressionRandomForestQuantileRegressor: the main implementationSampleRandomForestQuantileRegressor: an approximation, that is much faster than the main implementation.RandomForestMaximumRegressor: mathematically equivalent to the main implementation but much faster.Extra Trees Quantile RegressionExtraTreesQuantileRegressor: the main implementationSampleExtraTreesQuantileRegressor: an approximation, that is much faster than the main implementation.Quantile K-nearest neighbors (KNeighborsQuantileRegressor)InstallationThe package can be installed with conda:conda install --channel conda-forge sklearn-quantileExampleAn example of Random Forest Quantile Regression in action (both the main implementation and its approximation):Usage exampleRandom Forest Quantile Regressor predicting the 5th, 50th and 95th percentile of the California housing dataset.from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split
from sklearn_quantile import RandomForestQuantileRegressor

X, y = fetch_california_housing(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.5, random_state=0)

qrf = RandomForestQuantileRegressor(q=[0.05, 0.50, 0.95])
qrf.fit(X_train, y_train)

y_pred_5, y_pred_median, y_pred_95 = qrf.predict(X_test)
qrf.score(X_test, y_test)Important linksAPI reference:https://sklearn-quantile.readthedocs.io/en/latest/api.htmlDocumentation:https://sklearn-quantile.readthedocs.io/en/latest/index.html
Package: sklearnreg
This is a library that imports all the classes of sklearn regression model. The list of classes that are imported within this model include:Linear RegressionRidge RegressionLasso RegressionSupport Vector RegressionDecision Tree RegressionRandom Forest RegressionAdaboost RegressionYou need to specify all the hyperparameters for each of these classes as is given in the sklearn documentation.Avail the benefit of imporrting the regression classes at once and play with them to see the best fit model for your regression problem.Hope it helps to solve your problem.========================================================================================================================================steps:pip install sklearnregfrom sklearnreg import *
Package: sklearn-rri
Python package providing scikit-learn compatible classifier based on Reflective
Random Indexing (RRI) [1].DocumentationThe documentation is hosted onhttp://sklearn-rri.readthedocs.io/InstallationLatest from thesource:git clone https://github.com/cmick/sklearn-rri.git
cd sklearn-rri
python setup.py installUsingPyPI:pip install sklearn-rriDependenciessklearn-rri requires:NumPy (>= 1.11.0)SciPy (>= 0.16.0)scikit-learn (>= 0.17.0)Examples>>>fromsklearn_rriimportReflectiveRandomIndexing>>>fromsklearn.random_projectionimportsparse_random_matrix>>>X=sparse_random_matrix(100,100,density=0.01,random_state=42)>>>rri=ReflectiveRandomIndexing(50,random_state=42)>>>rri.fit(X)ReflectiveRandomIndexing(n_components=50, n_iter=3, norm=True,
        random_state=42, seed='auto')>>>rri.transform(X)<100x50 sparse matrix of type '<class 'numpy.float64'>'
        with 1154 stored elements in Compressed Sparse Row format>References[1] Trevor Cohen, Roger Schaneveldt, and Dominic Widdows,, Reflective Random
Indexing and Indirect Inference: A Scalable Method for Discovery of Implicit
Connections, 2010.https://www.ncbi.nlm.nih.gov/pubmed/19761870
Package: sklearn-sequence-classifiers
Convolutional neural network sequence classifier with a scikit-learn interface.Usage examplePredicting IMDB review sentiments.:from keras.datasets import imdb
from keras.preprocessing import sequence
from sequence_classifiers import CNNSequenceClassifier

maxlen = 400
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=5000)
x_train = sequence.pad_sequences(x_train, maxlen=maxlen)
x_test = sequence.pad_sequences(x_test, maxlen=maxlen)

clf = CNNSequenceClassifier(epochs=2)
clf.fit(x_train, y_train)
print(clf.score(x_test, y_test))