Package: orthrus
orthrusA python package for scaling and automating pre-processing, visualization, classification, and features selection of generic data sets. Read thedocs!Installing the conda environmentIn order to ensure proper behavior of python classes and functions between platforms we recommend installing an isolatedcondaenvironment with the depedencies listed inenvironment.yml. To create a new enviroment with these dependencies, from the shell run:condaenvcreate-fenvironment.ymlThis will generate the conda environment orthrus and install any dependencies required by the orthrus module. If the user does not have a CUDA >=11 compatible graphics card, then the user can replaceenvironment.ymlwithenvironment_nocuda.yml. The user can also use their own environment and install the packages listed in eitherenvironment.ymlorenvironment_nocuda.yml.Installing the orthrus packageorthrus is now available through the PyPi just runpipinstallorthrusto install the orthrus package. To install the orthrus package from this repo, first activate the orthrus environment and then navigate to your local orthrus directory:condaactivateorthruscd/path/to/orthrus/Install the package withpippipinstall-e.Finally addORTHRUS_PATH=/path/to/orthrus/to your environment variables (different for each OS).Basic UsageThe fundamental object in the orthrus package is the DataSet class. Here is an example of loading the iris dataset into theDataSetclass to create an instance from within the orthrus directory:# importsfromorthrus.core.datasetimportDataSetasDSimportpandasaspd# load data and metadatadata=pd.read_csv("test_data/Iris/Data/iris_data.csv",index_col=0)metadata=pd.read_csv("test_data/Iris/Data/iris_metadata.csv",index_col=0)# create DataSet instanceds=DS(name='iris',path='./test_data',data=data,metadata=metadata)# save datasetds.save()herepathindicates wheredswill save figures and results output by the class methods.Creating a Project EnvironmentTo increase organization and reproducibility of results the orthrus package includes helper functions for generating a project directory and experiment subdirectories. Here is an example where we create a project directory calledIrisand then generate an experiment directory calledsetosa_versicolor_classify_species_svmwhere we intend to classify setosa and versicolor species with an SVM classifier.# importsfromorthrus.core.helperimportgenerate_projectfromorthrus.core.helperimportgenerate_experimentfromorthrus.core.datasetimportload_datasetimportshutil# Create a project directory structure in the test pathfile_path='./test_data/'generate_project('Iris',file_path)# move data into Data directory of Iris project directoryshutil.move('./test_data/iris.ds','./test_data/Iris/Data/iris.ds')# create experiment directory in the Experiments directory of the Iris directoryproj_dir='./test_data/Iris/'generate_experiment('setosa_versicolor_classify_species_svm',proj_dir)Once thesetosa_versicolor_classify_species_svmdirectory is created there will be a filesetosa_versicolor_classify_species_svm_params.pycontaining a template for experimental parameters that the user can change or add on to. The Scripts directory in the Iris directory should contain general purpose scripts that can take in specific experimental parameters from your different experiments—allowing you to easily change your experiment on the fly with minimal code change. Take a look at theIrisdirectory for an example of this workflow.