- VCS Tags and Branches
- Writing Version Constraints
- Next Significant Release Operators
Composer Versions vs VCS Versions#
Because Composer is heavily geared toward utilizing version control systemslike git, the term 'version' can be a little ambiguous. In the sense of aversion control system, a 'version' is a specific set of files that containspecific data. In git terminology, this is a 'ref', or a specific commit,which may be represented by a branch HEAD or a tag. When you check out thatversion in your VCS -- for example, tag
v1.1
or commit e35fa0d
--, you'reasking for a single, known set of files, and you always get the same files back.Cleanmymac x 4 4 6 cyl. Caret is a Markdown editor for Mac, Windows and Linux. It stands out with its clean interface, productivity features and obsessive attention to detail. Download for Linux. For continued use Purchase License at $29.
In Composer, what's often referred to casually as a version -- that is,the string that follows the package name in a require line (e.g.,
~1.1
or1.2.*
) -- is actually more specifically a version constraint. Composeruses version constraints to figure out which refs in a VCS it should bechecking out (or simply to verify that a given library is acceptable inthe case of a statically-maintained library with a version
specificationin composer.json
).- Thus, a 2-carat diamond weighs 400 milligrams or 0.4 grams. The word karat is ultimately from the same source as carat but came to refer to the fineness of gold: one karat is equal to 1/24th part of pure gold in an alloy. (The 1/24th proportion goes back to ancient Roman times during which a siliqua was equal to 1/24th of a golden solidus.
- Caret is a Markdown editor for Mac, Windows and Linux. It stands out with its clean interface, productivity features and obsessive attention to detail. Download for Linux. For continued use Purchase License at $29.
- This blog post series is on machine learning with R. We will use the Caret package in R. In this part, we will first perform exploratory Data Analysis (EDA) on a real-world dataset, and then apply non-regularized linear regression to solve a supervised regression problem on the dataset. We will predict power output given a.
VCS Tags and Branches#
For the following discussion, let's assume the following sample libraryrepository:
Tags#
Normally, Composer deals with tags (as opposed to branches -- if you don'tknow what this means, read up onversion control systems).When you write a version constraint, it may reference a specific tag (e.g.,
1.1
) or it may reference a valid range of tags (e.g., >=1.1 <2.0
, or~4.0
). To resolve these constraints, Composer first asks the VCS to listall available tags, then creates an internal list of available versions basedon these tags. In the above example, composer's internal list includes versions1.0
, 1.0.1
, 1.0.2
, the beta release of 1.1
, the first and secondrelease candidates of 1.1
, the final release version 1.1
, etc.. (Notethat Composer automatically removes the 'v' prefix in the actual tagname toget a valid final version number.)When Composer has a complete list of available versions from your VCS, it thenfinds the highest version that matches all version constraints in your project(it's possible that other packages require more specific versions of thelibrary than you do, so the version it chooses may not always be the highestavailable version) and it downloads a zip archive of that tag to unpack in thecorrect location in your
vendor
directory.Branches#
Carpet 21236
If you want Composer to check out a branch instead of a tag, you need to point it to the branch using the special
dev-*
prefix (or sometimes suffix; see below). If you're checking out a branch, it's assumed that you want to work on the branch and Composer actually clones the repo into the correct place in your vendor
directory. For tags, it copies the right files without actually cloning the repo. (You can modify this behavior with --prefer-source and --prefer-dist, see install options.)In the above example, if you wanted to check out the
my-feature
branch, you would specify dev-my-feature
as the version constraint in your require
clause. This would result in Composer cloning the my-library
repository into my vendor
directory and checking out the my-feature
branch.When branch names look like versions, we have to clarify for composer that we're trying to check out a branch and not a tag. In the above example, we have two version branches:
v1
and v2
. To get Composer to check out one of these branches, you must specify a version constraint that looks like this: v1.x-dev
. The .x
is an arbitrary string that Composer requires to tell it that we're talking about the v1
branch and not a v1
tag (alternatively, you can name the branch v1.x
instead of v1
). In the case of a branch with a version-like name (v1
, in this case), you append -dev
as a suffix, rather than using dev-
as a prefix.Minimum Stability#
There's one more thing that will affect which files are checked out of a library's VCS and added to your project: Composer allows you to specify stability constraints to limit which tags are considered valid. In the above example, note that the library released a beta and two release candidates for version
1.1
before the final official release. To receive these versions when running composer install
or composer update
, we have to explicitly tell Composer that we are ok with release candidates and beta releases (and alpha releases, if we want those). This can be done using either a project-wide minimum-stability
value in composer.json
or using 'stability flags' in version constraints. Read more on the schema page.Writing Version Constraints#
Now that you have an idea of how Composer sees versions, let's talk about howto specify version constraints for your project dependencies.
Exact Version Constraint#
You can specify the exact version of a package. This will tell Composer toinstall this version and this version only. If other dependencies requirea different version, the solver will ultimately fail and abort any installor update procedures.
1 1 2 Carat Diamond
Example:
1.0.2
Version Range#
By using comparison operators you can specify ranges of valid versions. Validoperators are
>
, >=
, <
, <=
, !=
.You can define multiple ranges. Ranges separated by a space ()or comma (
,
) will be treated as a logical AND. A double pipe (||
)will be treated as a logical OR. AND has higher precedence than OR.Note: Be careful when using unbounded ranges as you might end upunexpectedly installing versions that break backwards compatibility.Consider using the caret operator instead for safety.
Examples:
>=1.0
>=1.0 <2.0
>=1.0 <1.1 || >=1.2
Hyphenated Version Range ( - )#
Inclusive set of versions. Partial versions on the right include are completedwith a wildcard. For example
1.0 - 2.0
is equivalent to >=1.0.0 <2.1
as the2.0
becomes 2.0.*
. On the other hand 1.0.0 - 2.1.0
is equivalent to>=1.0.0 <=2.1.0
.Example:
1.0 - 2.0
Wildcard Version Range (.*)#
You can specify a pattern with a
*
wildcard. 1.0.*
is the equivalent of>=1.0 <1.1
.Example:
1.0.*
Next Significant Release Operators#
Tilde Version Range (~)#
Typeit4me 6 0 – completes partially typed words for young. The
~
operator is best explained by example: ~1.2
is equivalent to>=1.2 <2.0.0
, while ~1.2.3
is equivalent to >=1.2.3 <1.3.0
. As you can seeit is mostly useful for projects respecting semanticversioning. A common usage would be to mark the minimumminor version you depend on, like ~1.2
(which allows anything up to, but notincluding, 2.0). Since in theory there should be no backwards compatibilitybreaks until 2.0, that works well. Another way of looking at it is that using~
specifies a minimum version, but allows the last digit specified to go up.Example:
~1.2
Note: Although
2.0-beta.1
is strictly before 2.0
, a version constraintlike ~1.2
would not install it. As said above ~1.2
only means the .2
can change but the 1.
part is fixed.Note: The
~
operator has an exception on its behavior for the majorrelease number. This means for example that ~1
is the same as ~1.0
asit will not allow the major number to increase trying to keep backwardscompatibility.Caret Version Range (^)#
The
^
operator behaves very similarly, but it sticks closer to semanticversioning, and will always allow non-breaking updates. For example ^1.2.3
is equivalent to >=1.2.3 <2.0.0
as none of the releases until 2.0 shouldbreak backwards compatibility. For pre-1.0 versions it also acts with safetyin mind and treats ^0.3
as >=0.3.0 <0.4.0
.This is the recommended operator for maximum interoperability when writinglibrary code.
Example:
^1.2.3
Stability Constraints#
If you are using a constraint that does not explicitly define a stability,Composer will default internally to
-dev
or -stable
, depending on theoperator(s) used. This happens transparently.If you wish to explicitly consider only the stable release in the comparison,add the suffix
-stable
.Examples:
Constraint | Internally |
---|---|
1.2.3 | =1.2.3.0-stable |
>1.2 | >1.2.0.0-stable |
>=1.2 | >=1.2.0.0-dev |
>=1.2-stable | >=1.2.0.0-stable |
<1.3 | <1.3.0.0-dev |
<=1.3 | <=1.3.0.0-stable |
1 - 2 | >=1.0.0.0-dev <3.0.0.0-dev |
~1.3 | >=1.3.0.0-dev <2.0.0.0-dev |
1.4.* | >=1.4.0.0-dev <1.5.0.0-dev |
To allow various stabilities without enforcing them at the constraint levelhowever, you may use stability-flags like
@<stability>
(e.g. @dev
) to let composer know that a given packagecan be installed in a different stability than your default minimum-stabilitysetting. All available stability flags are listed on the minimum-stabilitysection of the schema page.Summary#
Testing Version Constraints#
Carpet 21237
You can test version constraints using semver.mwl.be.Fill in a package name and it will autofill the default version constraintwhich Composer would add to your
composer.json
file. You can adjust theversion constraint and the tool will highlight all releases that match. Found a typo? Something is wrong in this documentation? Fork and edit it!
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23Learn about signing commits
- Choose a tag to compare
Verified
This commit was created on GitHub.com and signed with a verified signature using GitHub’s key.GPG key ID: 4AEE18F83AFDEB23Learn about signing commits
pycaret released this Aug 28, 2020 · 638 commits to master since this release
Release: PyCaret 2.1 | Release Date: August 28, 2020
Summary of Changes
- Model Deployment Model deployment support for
gcp
andazure
has been added indeploy_model
function for all modules. Seedocumentation
for details. - Compare Models Budget Time new parameter
budget_time
added incompare_models
function. To set the upper limit oncompare_models
training time,budget_time
parameter can be used. - Feature Selection New feature selection method
boruta
has been added for feature selection. By default,feature_selection_method
parameter in thesetup
function is set toclassic
but can be set toboruta
for feature selection using boruta algorithm. This change is applicable forpycaret.classification
andpycaret.regression
. - Numeric Imputation New method
zero
has been added in thenumeric_imputation
in thesetup
function. When method is set tozero
, missing values are replaced with constant 0. Default behavior ofnumeric_imputation
is unchanged. - Plot Model New parameter
scale
has been added inplot_model
for all modules to enable high quality images for research publications. - User Defined Loss Function You can now pass
custom_scorer
for optimizing user defined loss function intune_model
forpycaret.classification
andpycaret.regression
. You must usemake_scorer
fromsklearn
to create custom loss function that can be passed intocustom_scorer
for thetune_model
function. - Change in Pipeline Behavior When using
save_model
themodel
object is appended intoPipeline
, as such the behavior ofPipeline
andpredict_model
is now changed. Instead of saving alist
,save_model
now savesPipeline
object where trained model is on last position. The user functionality on front-end forpredict_model
remains same. - Compare Models parameter
blacklist
andwhitelist
is now renamed toexclude
andinclude
with no change in functionality. - Predict Model Labels The
Label
column returned bypredict_model
function inpycaret.classification
now returns the original label instead of encoded value. This change is made to make output frompredict_model
more human-readable. A new parameterencoded_labels
is added, which isFalse
by default. When set toTrue
, it will return encoded labels. - Model Logging Model persistence in the backend when
log_experiment
is set toTrue
is now changed. Instead of using internalsave_model
functionality, it now adopts tomlflow.sklearn.save_model
to allow the use of Model Registry andMLFlow
native deployment functionalities. - CatBoost Compatibility
CatBoostClassifier
is now compatible withblend_models
inpycaret.classification
. As suchblend_models
without anyestimator_list
will now result in blending total of15
estimators includingCatBoostClassifier
. - Stack Models
stack_models
inpycaret.classification
andpycaret.regression
now adopts toStackingClassifier()
andStackingRegressor
fromsklearn
. As such thestack_models
function now returnssklearn
object instead of customlist
in previous versions. - Create Stacknet
create_stacknet
inpycaret.classification
andpycaret.regression
is now removed. - Tune Model
tune_model
inpycaret.classification
andpycaret.regression
now inherits params from the inputestimator
. As such if you have trainedxgboost
,lightgbm
orcatboost
on gpu will not inherits training method fromestimator
. - Interpret Model
**kwargs
argument now added ininterpret_model
. - Pandas Categorical Type All modules are now compatible with
pandas.Categorical
object. Internally they are converted into object and are treated as the same way asobject
orbool
is treated. - use_gpu A new parameter added in the
setup
function forpycaret.classification
andpycaret.regression
. In2.1
it was added to prepare for the backend work required to make this change in future releases. As such usinguse_gpu
param in2.1
has no impact. - Unit Tests Unit testing enhanced. Continious improvement in progress https://github.com/pycaret/pycaret/tree/master/pycaret/tests
- Automated Documentation Added Automated documentation now added. Documentation on Website will only update for
major
releases 0.X. For all minor monthly releases, documentation will be available on: https://pycaret.readthedocs.io/en/latest/ - Introduction of GitHub Actions CI/CD build testing is now moved from
travis-ci
togithub-actions
.pycaret-nightly
is now being published every 24 hours automatically. - Tutorials All tutorials are now updated using
pycaret2.0
. https://github.com/pycaret/pycaret/tree/master/tutorials - Resources New resources added under
/pycaret/resources/
https://github.com/pycaret/pycaret/tree/master/resources - Example Notebook Many example notebooks added under
/pycaret/examples/
https://github.com/pycaret/pycaret/tree/master/examples
pycaret-2.1.tar.gz241 KB