<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Miniconda Installation
Install Miniconda from their Website.
All required python packages will be downloaded using the conda package and environment management system.
When Miniconda is installed on your system, open up your shell with the command <kbd>WINDOWS</kbd> + <kbd>R</kbd> -> cmd on windows or search for the
terminal on Linux systems.
Then type this to make sure you got the latest version.
Step1:  A new environment capsule with preset libraries installed for one or more of your projects can be created. fauenv is the name of the new python 3.x environment in this example.
Step2:  Check which environments are currently installed. root is the name of the default one.
Step3:  Then, activate the desired environment.
Step4:  Install Packages for Machine Learning / Pattern Recognition
With this command, all required packages as well as their dependencies will be installed in the latest version possible. Version conflicts between them are avoided automatically.
Note, those packages are only installed for the chosen environment.
If you want to install them on another environment in the same version,conda automatically creates the hardlinks to the library's directory, avoiding to have numerous copies of the same library on the filesystem.
Install
Use conda to install new packages.
Step5:  Install packages not in the conda repository via pip.
Step6:  Clean up
In order to free about 330MB of disc space after installation, delete the cached tar.bz archive files. Packages no longer needed as dependencies can be deleted as well.
Step7:  Update
To update all packages of a specific environment call
Step8:  Now, all is set up to get started.
Using Jupyter Notebook
The Jupyter Notebook is a web-based interactive computational environment to combine code execution, text, mathematics, plots and rich media into a single document.
Jupyter stands for Julia, Python and R, which are the main proramming languages supported.
There are several tutorials for this framework.
To start Jupyter Notebook call
Step9:  The console will show an URL like http
Step10:  Jupyter Notebook magic functions
Unlike traditional python, the Jupyter notebook offers some extended timing, profiling, aliasing and other functionalities via it's magic functions.
An example
Step11:  In standard python this would be achieved by
Step12:  Some useful magic functions are
- %time or %timeit for benchmarks
- %prun for profiling
- %magic returns a list of all magic functions
- %load or %loadpy to import a .py file into the notebook
- %quickref for a reference sheet
Step13:  Further readings
There are some great websites where ready-made Jupyter Notebook files can be found and imported
Step14:  Upgrading to a new version of python
<ASSISTANT_TASK:>
Python Code:
conda update --all
Explanation: Miniconda Installation
Install Miniconda from their Website.
All required python packages will be downloaded using the conda package and environment management system.
When Miniconda is installed on your system, open up your shell with the command <kbd>WINDOWS</kbd> + <kbd>R</kbd> -> cmd on windows or search for the
terminal on Linux systems.
Then type this to make sure you got the latest version.
End of explanation
conda create -n fauenv python=3
Explanation: A new environment capsule with preset libraries installed for one or more of your projects can be created. fauenv is the name of the new python 3.x environment in this example.
End of explanation
conda info -e
Explanation: Check which environments are currently installed. root is the name of the default one.
End of explanation
activate fauenv
Explanation: Then, activate the desired environment.
End of explanation
conda install -n fauenv numpy scipy matplotlib scikit-learn scikit-image ipython ipython-notebook  
conda install -n fauenv nose pip anaconda-client pillow ujson flask jinja2 natsort joblib numba pyside
Explanation: Install Packages for Machine Learning / Pattern Recognition
With this command, all required packages as well as their dependencies will be installed in the latest version possible. Version conflicts between them are avoided automatically.
Note, those packages are only installed for the chosen environment.
If you want to install them on another environment in the same version,conda automatically creates the hardlinks to the library's directory, avoiding to have numerous copies of the same library on the filesystem.
Install
Use conda to install new packages.
End of explanation
activate fauenv # if not in fauenv environment already
pip install visvis tinydb nibabel pydicom medpy simpleITK pycuda numpy-stl websockets
Explanation: Install packages not in the conda repository via pip.
End of explanation
conda clean -tps # delete downloaded cached tarballs (t), orphaned packages (p), and cached sources (s)
Explanation: Clean up
In order to free about 330MB of disc space after installation, delete the cached tar.bz archive files. Packages no longer needed as dependencies can be deleted as well.
End of explanation
conda update --all -n fauenv
activate fauenv # if not in fauenv environment already
pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs pip install -U
Explanation: Update
To update all packages of a specific environment call
End of explanation
jupyter notebook # --port 8888
Explanation: Now, all is set up to get started.
Using Jupyter Notebook
The Jupyter Notebook is a web-based interactive computational environment to combine code execution, text, mathematics, plots and rich media into a single document.
Jupyter stands for Julia, Python and R, which are the main proramming languages supported.
There are several tutorials for this framework.
To start Jupyter Notebook call
End of explanation
%pylab inline
Explanation: The console will show an URL like http://localhost:8888/tree and open the operating system's default browser with this location.
Use it to navigate, open, create, delete, and run .ipynb files.
Note: For inline plots use this magic function at the beginning of your code. This also imports numpy as np, imports matplotlib.pyplot as plt, and others.
End of explanation
%time sum(range(int(1e7)))
%timeit sum(range(10000000))
Explanation: Jupyter Notebook magic functions
Unlike traditional python, the Jupyter notebook offers some extended timing, profiling, aliasing and other functionalities via it's magic functions.
An example:
End of explanation
python -mtimeit -s"import test" "mytestFunction(42)"
Explanation: In standard python this would be achieved by
End of explanation
%quickref
Explanation: Some useful magic functions are
- %time or %timeit for benchmarks
- %prun for profiling
- %magic returns a list of all magic functions
- %load or %loadpy to import a .py file into the notebook
- %quickref for a reference sheet
End of explanation
conda update --all
conda update --all -n fauenv
activate fauenv
conda clean -tps
pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs pip install -U
jupyter notebook
Explanation: Further readings
There are some great websites where ready-made Jupyter Notebook files can be found and imported:
1. Nbviewer: An online .ipynb render engine for notebooks on github
   1. Jupyter Notebook Tutorial
   2. Good Scikit-learn Tutorial
3. Google: segmentation type:ipynb github
Day two
When you come back to working with scikit-learn and jupyter notebook, use those commands to get the fresh releases and start the server
End of explanation
activate fauenv
conda install python=3.6
Explanation: Upgrading to a new version of python
End of explanation
<END_TASK>