Saravanan666/pypi-org huggingface dataset:
Package: optproblems
DescriptionThis package contains a collection of common benchmark problems for black-box
optimization. Under the term “black-box problem”, we understand problems for
which only little is known about their structure and properties. Such problems
usually appear in practice when simulator output or some other complex system
with nonlinear behavior is to be optimized.Contained test problems:Binary problems OneMax, LeadingOnes, and LeadingOnesTrailingZeros and three
instance generators for multimodal problemsCEC 2005 collection of single-objective problemsCEC 2007 collection of multiobjective problemsDixon-Szegö collection for global optimizationDTLZ problems 1-7Multiple-Peaks Model 2Walking Fish Group (WFG) toolkitZDT collection for multiobjective optimizationThe infrastructure of this package can also be used to wrap your own
(real-world) optimization problems in the problem base class. Reasons to do
this may be the following features:Support for single-objective and multi-objective problemsIn general, no assumptions about the search space are madeEvaluations are automatically countedCan use true parallelism or concurrency via multiprocessing(.dummy)Provides functionality for checking bound constraints and repairing
violations of them in continuous optimizationOptionally: detection and subsequently avoidance of duplicate evaluationsA few real-world problems are also included. Examples:Configuration of a gradient method on test problemUniformity optimization of points in the unit hypercubeDependenciesSome modules of this package have additional dependencies on third-party
packages. However, these are not enforced during installation not to hinder
the utilization of the base module, which will always be free of dependencies.ModuleDependenciesbasenonebinarynonecec2005numpycec2007numpy, diversipycontinuousnonedtlzdiversipympmnumpymultiobjectivediversipyrealworldnumpy, diversipywfgdiversipyzdtdiversipyDocumentationThe documentation is located athttps://www.simonwessing.de/optproblems/doc/
Package: optprompt
OptpromptA prompting option parserExampleimportoptpromptparser=optprompt.OptionPrompter(config_files=['./example.toml'])parser.add_argument('-n','--name',prompt='What is your name')parser.add_argument('-r','--race',prompt='What is your race',default='elf')parser.add_argument('-e','--edition')opts=parser.parse_args()print(opts)With the config file[defaults]
edition = '3.5'Will produce the following output(venv) [dylan@voyager examples]$ PYTHONPATH=$(pwd)/.. python example.py
What is your name : Bob
What is your race [elf]:
Namespace(edition='3.5', name='Bob', race='elf')
Package: optrabot
OptraBotOptraBot is a Options Trading Bot which can be used to run fully automated options trading strategies using your Interactive Brokers trading account.Have a look on theRoadmapand discover what we're currently working on and whats coming next.Run through theChangelogand find out about the most recent updates of the software.System requirementsMicrosoft Windows, MacOS or Linux operating systemPython 3.10 or newerInteractive Brokers Trader Workstation or IB GatewayDisclaimerBe aware that you're using this software at your own risk. The author is not liable for any losses occuring with using this software.
Package: optres
optresYet another Rust's Option<T> and Result<T, E> simple implementation in Python.Installationpython3-mpipinstall-UoptresExamplefromoptresimportunwrap,Result,Err,is_ok,is_err,unwrap_errfromtypingimportLiteralStringdefreturn_result(x:int|None)->Result[int,LiteralString]:returnErr("not int")ifxisNoneelsexdefexample()->None:a:int|None=1c:int=unwrap(a)print(c)assertis_ok(return_result(a))a=None# unwrap(a) # error := panic in Rust.may_be_err=return_result(a)assertis_err(may_be_err)print(unwrap_err(may_be_err))if__name__=="__main__":example()
Package: optrie
OpTrie一个简单的字符串模板匹配工具安装pippip install optrie二进制兼容性manylinux2.17windows和macos暂未测试源码安装gitclonehttps://github.com/qjf42/optriecdoptrie
pythonsetup.pyinstallUsage1. 准备词典每一个[D:xxx]表示词典key后续的每一行是其可以匹配的字符串不同key的值集合可以有重合[D:hi]
你好
hello
# 注释，#必须为首字符
[D:location]
上海
北京
[D:price]
房价
价格2. 准备模板每一行是一个模板，用tab分隔，可以有2~4项，分别为：模板项[D:xx]必须包含在词典中[W:1]用于模糊匹配，表示0-1个字符，[W:2-3]表示2-3个字符也可以直接用明文置信分ps：目前匹配采用贪心策略，当匹配多个模板时，只取第一个，不保证分数最大模板关联信息（可选）json, schema: {string => string|numeric}信息抽取（可选）json, schema: {输出字段 => 抽取的词典项或模糊匹配项}[D:hi][W:1]	1
[W:2-3][D:location][D:price]	0.9	{"catg": "housing"}	{"loc": "[D:location]"}
[W:1-2]月新番	1		{"month":"[W:1-2]"}匹配fromoptrieimportOpTrie# 加载模板和词典，可以有多个m=OpTrie().load(['sample.tpl'],['sample.dic'])# 打印词典树m.show()res=m.match('你好')res.matched# Trueres.template# [D:hi][W:1]res.score# 1res=m.match('查询上海房价')res.matched# Trueres.template# "[W:2-3][D:location][D:price]"res.score# 0.9res.extra_info# {"catg": "housing"}res.groups# {"loc": "上海"}res=m.match('深圳房价')res.matched# False
Package: optrs
optrsis a lightweight molecular mechanics optimisation code written in rust.InstallationInstall the binary withpipinstalloptrsor thePython API.UsageOptimise a molecule provided as a.xyzfileoptrsmolecule.xyzwhich will generateopt.xyzin working directory.API examples.FeaturesUFFforcefieldRBforcefield3D structure generationSteepest decent optimisation
Package: opts
Welcome to opts===============opts is a simple python library which allows you to easiely parse command linearguments.Features--------- Supports so called commands e.g. ``hg clone``.- Supports abbreviations of commands and options e.g. ``hg cl`` instead of``hg clone`` or ``hg --he`` instead of ``hg --help``.- Shows possible alternatives if you pass a command or an option does not exist- Declarative syntax for commands and parser.Links------ http://github.com/DasIch/opts- http://packages.python.org/opts- http://pypi.python.org/pypi/opts/0.1.1
Package: optscale-arcee
ArceeThe OptScale ML profiling tool by HystaxArcee is a tool that hepls you to integrate ML tasks withOptScale.
This tool can automatically collect executor metadata from cloud and process stats.InstallationArcee requires python 3.7+ to run.pipinstalloptscale-arceeUsageFirst of all you need to import and init arcee in your code:importoptscale_arceeasarcee# init arcee using context manager syntaxwitharcee.init('token','model_key'):# some codeTo use custom endpoint and enable\disable ssl checks (supports using self-signed ssl certificates):witharcee.init('token','model_key',endpoint_url='https://my.custom.endpoint:443/arcee/v2',ssl=False):# some codeAlternatively arcee can be initialized via function call. However manual finish is required:arcee.init('token','model_key')# some codearcee.finish()Or in error case:arcee.init('token','model_key')# some codearcee.error()To send stats:arcee.send({"loss":2.0012,"iter":2,"epoch":1})(key should be string, value - int or float, multiple values can be sent)To add tags to model run (key, value):arcee.tag("project","torchvision demo")To add milestones:arcee.milestone("Download test data")To add stages:arcee.stage("calculation")To add hyperparameters:arcee.hyperparam("epochs",5)Logging datasetsTo log a dataset, use the dataset method with the following parameter:path (str): the path of the dataset.arcee.dataset("dataset_path")
Package: optschedule
OptScheduleFlexible parameter scheduler that can be implemented with proprietary and open source optimizers and algorithms.Free software: MIT licenseDocumentation:https://optschedule.readthedocs.io/en/latest/Installationoptschedulecan be installed through Python's package installer pip. To install, runpipinstalloptschedulein your terminal. Alternatively, install the package directly from GitHubgitclone-bdevelopmenthttps://github.com/draktr/optschedule.gitcdmonte
pythonsetup.pyinstallFeaturesExponential decay (gradual and staircase)Cosine decayInverse time decay (gradual and staircase)Polynomial decayPiecewise constant decayConstant scheduleGeometric decayArithmetic decayTime decayStep decayAdvantagesFLEXIBLE- the package is designed to be simple and compatible with existing implementations and custom algorithmsCOMPREHENSIVE- the package contains the largest collection of schedules of any Python package. For more, feel free to raise a feature request in Issues.NUMBA FRIENDLY- schedule produced by the package is compatible with Numba and will not cause any issues if the rest of the algorithm is Numba compatible. This can drastically speed up the algorithm.UsagePackage containsScheduleclass with methods that return an array of elements that is useful as a pre-defined parameter schedule (e.g. learning rate). The package can also be used for manually assigning varying weights to abstract particles. Overall, due to the general nature of the package a user might finds its own particular application.Example: Variable Learning Rate in Gradient Descent AlgorithmfromoptscheduleimportSchedule# Function to be minimized (objective function) $ f(x) = (x+2)^2 $deffoo(params):return(params[0]+2)**2# Creating learning rate scheduleschedule=Schedule(1000)learning_rate=schedule.exponential_decay(initial_value=0.1,decay_rate=0.5)# Array with objective valueobjective=np.zeros(1000)# Initial parameter valueparam=[10]# Differenced=0.01# Gradient Descent Algorithmforepoch,linenumerate(learning_rate):objective[epoch]=foo(param)difference_objective=foo([param[0]+d])param[0]=param[0]-l*(difference_objective-objective[epoch])/dprint(f"Solution:{param[0]}")Maintaining and ContributingFeel free to reach out through Issues forum to add or request features. Any issues, bugs and improvement recommendations are very welcome.
Package: optshare
OptShareSpecial thanks toAKsharefor the opportunity to learn from this project in terms of code and project development.OptShareis a Python-based option data interface library, designed to provide easy-to-use option data, index data, and market yield data.The main source ofOptSharedata is the official website and raw data published byeastmoneyfinancial website.Documentation:文档链接InstallationPython 3.9(64-bit) or laterpip install optshareUsageCodeimportoptsharecurrent_option_data=optshare.get_current_option()print(current_option_data)Output代码               名称   最新价    涨跌额      涨跌幅     成交量       成交额  \
0       a2305p4500    豆一23年05月沽4500  50.0   49.5  9900.00     1.0     500.0   
1        i2305p510    铁矿石23年05月沽510   3.0    2.9  2900.00     1.0     300.0   
2       v2305c9000   PVC23年05月购9000  12.5   12.0  2400.00     4.0     247.0   
3       v2305c9200   PVC23年05月购9200  12.0   11.5  2300.00    23.0    1280.0   
4      p2305c12600  棕榈油23年05月购12600   9.5    9.0  1800.00  2407.0  197575.0   
...            ...              ...   ...    ...      ...     ...       ...   
11963   y2303p8100    豆油23年03月沽8100   0.5   -2.0   -80.00   133.0    1135.0   
11964   y2303p8400    豆油23年03月沽8400   3.0  -13.5   -81.82   942.0   46570.0   
11965   SR303P5400    白糖23年03月沽5400   0.5   -2.5   -83.33   656.0    6560.0   
11966   y2303p8300    豆油23年03月沽8300   1.5   -8.0   -84.21   874.0   19995.0   
11967   v2309c7000   PVC23年09月购7000  40.0 -312.5   -88.65     1.0     200.0   

           持仓量  行权价  剩余日      日增     昨结    今开  
0        183.0  NaN  NaN     0.0    0.5  50.0  
1        745.0  NaN  NaN     0.0    0.1   3.0  
2        211.0  NaN  NaN     0.0    0.5  12.0  
3        133.0  NaN  NaN    -7.0    0.5  10.5  
4      12173.0  NaN  NaN  1360.0    0.5   7.0  
...        ...  ...  ...     ...    ...   ...  
11963    742.0  NaN  NaN   -80.0    2.5   1.0  
11964    630.0  NaN  NaN   148.0   16.5   6.5  
11965   5193.0  NaN  NaN   -82.0    3.0   0.5  
11966   7134.0  NaN  NaN   -32.0    9.5   3.5  
11967      9.0  NaN  NaN     0.0  352.5  40.0  

[11968 rows x 13 columns]
Package: opt-sugar
opt-sugaris a Python package meant to make the optimization operation (OptOps) tasks easier by providing the building blocks needed
to use mlflow for mathematical optimization experimentation.The project was started in oct 2022 by Juan Chacon.InstallationDependenciesopt-sugar requires:Python (>= 3.8)NumPy (>= 1.23.2)GurobiPy (>= 9.5.2)ScikitLearn (>= 1.1.2)User installationIf you already have a working installation all the dependencies,
the easiest way to install opt-sugar is usingpip:pip install -U opt-sugarRead the docshere.For ContributorsReleasing PackageTo release the package to PyPI follow the next steps:Update version in setup.py file and push changes to GitHub.In GitHub create a tag with the same version as in the setup.py, then create a release using the tag you just created.Have a coffee, theUpload Python PackageGitHub action will do the rest.Updating ExamplesOnce the examples run locally using the imports with local paths in the examples:Remove the sys.path.append lines in the examples (commenting them by now is okay)Release to PyPIAdd opt-sugar in the requirements-dev.txtRemove the docs/source/auto_examples folder contentGenerate the examples locally and push to repoCheckout any changes in the main branchNoteIt would be good idea to runpip install -U -r requirements-dev.txtin your dev environment to get the most
updated version of the package.
Package: optuna-async-helper
Optuna Async HelperA Helper Library for Optuna Async OptimizationInstallpipinstalloptuna-async-helperUsagefromoptuna_async_helperimportSearchSpace,SearchSpec,optimizedefrosenbrock(x:float,y:float)->float:return(1-x)**2+100*(y-x**2)**2search_space:SearchSpace=[SearchSpec(var_name="x",var_type="float",low=-5,high=5),SearchSpec(var_name="y",var_type="float",low=-5,high=5),]withtempfile.TemporaryDirectory()astempdir:study=optimize(study_name="rosenbrock",storage=f"sqlite:///example.db",objective_func=rosenbrock,search_space=search_space,n_trials=50,batch_size=4,)assertstudy.best_value<1.0assertabs(study.best_params["x"]-1)<1.0assertabs(study.best_params["y"]-1)<1.0For more detail, please checkoptimizeandSearchSpecdefinitions.
Package: optunacy
Optunacy - alternate Optuna contour plotterPlots Optuna contour plots trivially and with detailed mouseovers.
It collects data from all the hashes in Optuna, as well as the Objectives if you provide them.It provides mouseovers with details, too.Examplefromoptunacy.oplotimportOPlotdefoptuna_objective(trial,train_loader,test_loader):...trial.set_user_attr("Neurons per Hidden Layer",nphl)...# The objectives have a printable name and directionreturnvalidation_accuracy,spikes_per_digitobjective_names=["Validation Accuracy","Spikes per Digit"]objective_directions=["maximize","minimize"]study=optuna.create_study(study_name="Minimize spikes, maximize accuracy",directions=objective_directions)study.optimize(lambdatrial:optuna_objective(trial,train_loader,test_loader),n_trials=100)see=OPlot(study,objective_names)see.plot("Hidden Layers","Neurons per Hidden Layer","Validation Accuracy",z_clip=(0.8,1))OptionsThe plot function has these options:defplot(self,x_name,# stringy_name,# stringz_name=None,# stringx_range=None,# range, ex: x_range=(3,9)y_range=None,# rangez_clip=None,# Clamps colors to max and mininterpol="linear"):# <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html">interpolation method</a>Installationpip install optunacy
Package: optuna-dashboard
optuna-dashboardReal-time dashboard forOptuna.
Code files were originally taken fromGoptuna.InstallationYou can install optuna-dashboard viaPyPIorAnaconda Cloud.$ pip install optuna-dashboardGetting StartedFirst, please specify the storage URL to persistent your study using theRDB backend.importoptunadefobjective(trial):x=trial.suggest_float("x",-100,100)y=trial.suggest_categorical("y",[-1,0,1])returnx**2+yif__name__=="__main__":study=optuna.create_study(storage="sqlite:///db.sqlite3",# Specify the storage URL here.study_name="quadratic-simple")study.optimize(objective,n_trials=100)print(f"Best value:{study.best_value}(params:{study.best_params})")After running the above script, please execute theoptuna-dashboardcommand with Optuna storage URL.$ optuna-dashboard sqlite:///db.sqlite3
Listening on http://localhost:8080/
Hit Ctrl-C to quit.Please check outour documentationfor more details.Using an official Docker imageYou can also usean official Docker imageinstead of setting up your Python environment.
The Docker image only supports SQLite3, MySQL(PyMySQL), and PostgreSQL(Psycopg2).$ docker run -it --rm -p 8080:8080 -v `pwd`:/app -w /app \
> ghcr.io/optuna/optuna-dashboard sqlite:///db.sqlite3MySQL (PyMySQL)$ docker run -it --rm -p 8080:8080 ghcr.io/optuna/optuna-dashboard mysql+pymysql://username:password@hostname:3306/dbnamePostgreSQL (Psycopg2)$ docker run -it --rm -p 8080:8080 ghcr.io/optuna/optuna-dashboard postgresql+psycopg2://username:password@hostname:5432/dbnameJupyter Lab Extension (Experimental)You can install the Jupyter Lab extension viaPyPI.$ pip install jupyterlab jupyterlab-optunaTo use, click the tile to launch the extension, and enter your Optuna’s storage URL (e.g.sqlite:///db.sqlite3) in the dialog.Browser-only version (Experimental)We’ve developed the version that operates solely within your web browser, which internally uses SQLite3 Wasm and Rust.
There’s no need to install Python or any other dependencies.
Simply open the following URL in your browser, drag and drop your SQLite3 file onto the page, and you’re ready to view your Optuna studies!https://optuna.github.io/optuna-dashboard/Please note that only a subset of features is available. However, you can still check the optimization history, hyperparameter importances, and etc. in graphs and tables.VS Code Extension (Experimental)You can install the VS Code extension viaVisual Studio Marketplace.Please right-click the SQLite3 files (*.dbor*.sqlite3) in the VS Code file explorer and select the "Open in Optuna Dashboard" command from the dropdown menu.
This extension leverages the browser-only version of Optuna Dashboard, so the same limitations apply.Submitting patchesIf you want to contribute, please checkDevelopers Guide.
Package: optuna-distributed
optuna-distributedAn extension toOptunawhich makes distributed hyperparameter optimization easy, and keeps all of the original Optuna semantics. Optuna-distributed can run locally, by default utilising all CPU cores, or can easily scale to many machines inDask cluster.NoteOptuna-distributed is still in the early stages of development. While core Optuna functionality is supported, few missing APIs (especially around Optuna integrations) might prevent this extension from being entirely plug-and-play for some users. Bug reports, feature requests and PRs are more than welcome.FeaturesAsynchronous optimization by default. Scales from single machine to many machines in cluster.Distributed study walks and quacks just like regular Optuna study, making it plug-and-play.Compatible with all standard Optuna storages, samplers and pruners.No need to modify existing objective functions.Installationpipinstalloptuna-distributedOptuna-distributed requires Python 3.8 or newer.Basic exampleOptuna-distributed wraps standard Optuna study. The resulting object behaves just like regular study, but optimization process is asynchronous. Depending on setup ofDask client, each trial is scheduled to run on available CPU core on local machine, or physical worker in cluster.NoteRunning distributed optimization requires a Dask cluster with environment closely matching one on the client machine. For more information on cluster setup and configuration, please refer tohttps://docs.dask.org/en/stable/deploying.html.importrandomimporttimeimportoptunaimportoptuna_distributedfromdask.distributedimportClientdefobjective(trial):x=trial.suggest_float("x",-100,100)y=trial.suggest_categorical("y",[-1,0,1])# Some expensive model fit happens here...time.sleep(random.uniform(1.0,2.0))returnx**2+yif__name__=="__main__":# client = Client("<your.cluster.scheduler.address>")  # Enables distributed optimization.client=None# Enables local asynchronous optimization.study=optuna_distributed.from_study(optuna.create_study(),client=client)study.optimize(objective,n_trials=10)print(study.best_value)But there's more! All of the core Optuna APIs, includingstorages, samplersandprunersare supported! If you'd like to know how Optuna-distributed works, then check outthis article on Optuna blog.What's missing?Support for callbacks and Optuna integration modules.Study APIs such asstudy.stopcan't be called from trial at the moment.Local asynchronous optimization on Windows machines. Distributed mode is still available.Support foroptuna.terminator.
Package: optuna-fast-fanova
optuna-fast-fanovaoptuna-fast-fanova provides Cython-accelerated version ofFanovaImportanceEvaluator.n_trialsn_paramsn_treesfANOVA (Optuna)fast-fanova1000326471.431s2.963s (-95.9%)100086492.307s2.315s (-97.5%)100026452.295s1.297s (-97.5%)10032641.668s0.306s (-81.6%)1008641.652s0.138s (-91.7%)1002641.242s0.095s (-92.4%)The benchmark scriptwas run on my laptop (Macbook M1 Pro) so the times should not be taken precisely.InstallationSupported Python versions are 3.7 or later.$ pip install optuna-fast-fanovaPlease note that this library depends on the scikit-learn's C-API (Cython pxd files).
However, its ABI may contain breaking changes, even in patch releases.
If you install optuna-fast-fanova with scikit-learn v1.1.1 and then upgrade scikit-learn to v1.1.2, optuna-fast-fanova will not work.
Please reinstall optuna-fast-fanova if you update scikit-learn.UsageUsage is like this:importoptunafromoptuna_fast_fanovaimportFanovaImportanceEvaluatordefobjective(trial):x=trial.suggest_float("x",-10,10)y=trial.suggest_int("y",-10,10)returnx**2+yif__name__=="__main__":study=optuna.create_study()study.optimize(objective,n_trials=1000)importance=optuna.importance.get_param_importances(study,evaluator=FanovaImportanceEvaluator())print(importance)You can use optuna-fast-fanova in only two steps.Add an import statement:from optuna_fast_fanova import FanovaImportanceEvaluator.Pass aFanovaImportanceEvaluator()object to anevaluatorargument ofget_param_importances()function.How to cite fANOVAThis is a derived work ofhttps://github.com/automl/fanova.
For how to cite the original work, please refer tohttps://automl.github.io/fanova/cite.html.
Package: optuna-integration
Optuna-IntegrationDocsOptuna-Integrationis an integration module ofOptuna.
This package allows us to use Optuna, an automatic Hyperparameter optimization software framework,
integrated with many useful tools like PyTorch, sklearn, TensorFlow, etc.IntegrationsOptuna-Integration API reference ishere.AllenNLP(example)Catalyst(example)Chainer(example)ChainerMN(example)FastAI (V1(example), (V2([example]https://github.com/optuna/optuna-examples/tree/main/fastai/fastaiv2_simple.py)))Keras(example)MXNet(example)SHAPskorch(example)tf.keras(example)InstallationOptuna-Integration is available atthe Python Package Indexand onAnaconda Cloud.# PyPI$pipinstalloptuna-integration# Anaconda Cloud$condainstall-cconda-forgeoptuna-integrationOptuna-Integration supports from Python 3.7 to Python 3.10.Also, we also provide Optuna docker images onDockerHub.CommunicationGitHub Discussionsfor questions.GitHub Issuesfor bug reports and feature requests.ContributionAny contributions to Optuna-Integration are more than welcome!For general guidelines how to contribute to the project, take a look atCONTRIBUTING.md.ReferenceTakuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. 2019.
Optuna: A Next-generation Hyperparameter Optimization Framework. In KDD (arXiv).
Package: optuna-learn
optuna-learnTuning hyper-parameters based on Optuna is as easy as using scikit-learn.:hourglass_flowing_sand: Dependenciesoptuna-learn requires:python >= 3.6scikit-learnoptuna:zap: Quick StartfromlightgbmimportLGBMClassifierfromoptlearn.optimportOptunaSearchfromsklearn.datasetsimportload_irisfromsklearn.metricsimportaccuracy_scorefromsklearn.model_selectionimporttrain_test_splitX,y=load_iris(return_X_y=True)X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2)opt=OptunaSearch(model=LGBMClassifier,optimize_direction='minimize',params_dict={'n_estimators':['categorical',100,200,300,500],'reg_alpha':['float',0.001,10,False],'reg_lambda':['float',0.001,100,False],'num_leaves':['int',2,256],})opt.fit(X_train,y_train)y_pred=opt.predict(X_test)accuracy_score(y_test,y_pred)>>>0.9967924528301886