faculty-xval
Cross validation of machine-learning models on Faculty platform. At present, the package mostly offers a way to cross validate models in parallel by means of Faculty jobs. To access the functionality one makes use of the class:
faculty_xval.validation.JobsCrossValidator
Additional information is found in the example notebooks provided. Please have a
look at the section Try out the examples below.
The package supports keras and sklearn models. Whilst one can write custom
models that are compatible with faculty-xval, no guarantee is given that the
package handles these situations correctly, in particular because of issues
concerning the randomisation of weights.
Two sets of installation instructions are provided below:
- If you would like to simply use
faculty-xval, please follow theUser installation instructions. - If you would like to develop
faculty-xvalfurther, please follow theDeveloper installation instructions.
User installation instructions
Create an environment
In your project on Faculty platform, create an environment named faculty_xval.
In the PYTHON section, select Python 3 and pip from the dropdown menus.
Then, type faculty-xval in the text box, and click on the ADD button.
The environment installs the package faculty-xval, and should be applied on
every server that you create; this includes both interactive servers and job
servers, as explained next.
Create a job definition
Create a new job definition named cross_validation. In the COMMAND section,
paste the following:
faculty_xval_jobs_xval $IN_PATHS
Then, add a PARAMETER with the name IN_PATHS, and ensure that the
Make field mandatory box is checked.
Finally, under SERVER SETTINGS, add faculty_xval to the ENVIRONMENTS
section.
For cross-validation jobs that are computationally intensive, we recommend using
dedicated servers as opposed to running on shared infrastructure. To achieve
this, click on Large and GPU servers under SERVER RESOURCES, and select an
appropriate server type from the dropdown menu.
Remember to click SAVE when you are finished.
Developer installation instructions
Select a username
Before beginning the installation process, pick an appropriate username, such as
foo. This does not necessarily need to match your Faculty platform username.
In the following instructions, your selected username will be referred to as
<USER_NAME>.
Clone the repository
Create the folder /project/<USER_NAME>. Then, run the commands:
cd /project/<USER_NAME>
git clone https://github.com/facultyai/faculty-xval.git
Create an environment
Next, create an environment in your project named faculty_xval_<USER_NAME>.
In this environment, under SCRIPTS, paste in the following code to the BASH
section, remembering to change the USER_NAME definition on the second line to
your selected <USER_NAME>:
# Remember to change username!
USER_NAME=<USER_NAME>
# Install faculty-xval from local repository.
pip install /project/$USER_NAME/faculty-xval/
# Turn USER_NAME into an environment variable.
echo "export USER_NAME=$USER_NAME" > /etc/faculty_environment.d/app.sh
if [[ -d /etc/service/jupyter ]] ; then
sudo sv restart jupyter
fi
This environment should be applied on every server that you create; this includes both 'normal' interactive servers and job servers, as explained next.
Create a job definition
Next, create a new job definition named cross_validation_<USER_NAME>. In the
COMMAND section, paste the following:
faculty_xval_jobs_xval $in_paths
Then, add a PARAMETER with the name in_paths, and ensure that the
Make field mandatory box is checked.
Finally, under SERVER SETTINGS, add faculty_xval_<USER_NAME> to the
ENVIRONMENTS section.
For cross-validation jobs that are computationally intensive, we recommend using
dedicated servers as opposed to running in the cluster. To achieve this, click
on Large and GPU servers under SERVER RESOURCES, and select an appropriate
server type from the dropdown menu.
Remember to click SAVE when you are finished.
Try out the examples
Please clone this repository. Examples of cross validation with faculty-xval
for the different types of model are provided in the directories
examples/keras and examples/sklearn. Usage instructions are then divided in
two notebooks:
jobs_cross_validator_run.ipynbloads the data, instantiates the model, and starts a Faculty job that carries out the cross validation.jobs_cross_validator_analyse.ipynbgathers the results from the cross validation, reloads the target data, and calculates the model accuracy over multiple train-test splits.
Note that the example notebooks must be run in the order just defined.
Metadata
Release files for faculty-xval 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| faculty-xval-0.1.0.tar.gz | 11.7 kB | Without provenance | Details for faculty-xval-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| faculty_xval-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for faculty_xval-0.1.0-py3-none-any.whl |
Total release size: 27.6 kB
Release files / faculty-xval-0.1.0.tar.gz
| Download URL | faculty-xval-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69a3d4cded33f5dd5cd97edec17d91c2112a51bd9ae4e8e7bfff2df37bd39188
|
|
BLAKE2b-256 checksum How to use checksums |
9ea38cc96fdd6a7623a517272584ae94545a76e9aa676cac1bc2f8ed477920f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Release files / faculty_xval-0.1.0-py3-none-any.whl
| Download URL | faculty_xval-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dbb7c7ab966c0c218246c05ce8f71173a9274ea8a742a3f333827e9f4b3f33b7
|
|
BLAKE2b-256 checksum How to use checksums |
99a492c7ca217b9c0efed2fb4a4afeeb5d4acbe11d56593ad467fe4d2e94b6a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Security for faculty-xval 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.