From 30c72fb1a5ce692d02df9f65745e237b59b93f2d Mon Sep 17 00:00:00 2001 From: Robert Zhang Date: Wed, 15 Apr 2020 20:06:58 -0400 Subject: [PATCH 1/2] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index f459c9a..9ec0aa4 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,32 @@ In addition, the package includes functionality that allows detailed training ev ## Usage For more information on the eLCS algorithm and how to use it, please refer to the "eLCS User Guide" Jupyter Notebook inside this repository. +## Usage TLDR +```python +#Import Necessary Packages/Modules +from skeLCS.eLCS import eLCS +import numpy as np +import pandas as pd +from sklearn.model_selection import cross_val_score + +#Load Data Using Pandas +data = pd.read_csv('myDataFile.csv') +dataFeatures = data.drop(classLabel,axis=1).values +dataPhenotypes = data[classLabel].values + +#Shuffle Data Before CV +formatted = np.insert(dataFeatures,dataFeatures.shape[1],dataPhenotypes,1) +np.random.shuffle(formatted) +dataFeatures = np.delete(formatted,-1,axis=1) +dataPhenotypes = formatted[:,-1] + +#Initialize eLCS Model +model = eLCS(learningIterations = 5000) + +#3-fold CV +print(np.mean(cross_val_score(model,dataFeatures,dataPhenotypes,cv=3))) +``` + ## License Please see the repository [license](https://github.com/UrbsLab/scikit-eLCS/blob/master/LICENSE) for the licensing and usage information for scikit-eLCS. From 6b2fb0b4648e401b0403d377e8e0c38d762d35fe Mon Sep 17 00:00:00 2001 From: Robert Zhang Date: Wed, 15 Apr 2020 20:09:48 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ec0aa4..55302b7 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ These values can then be exported as a csv after training is complete for analys In addition, the package includes functionality that allows detailed training evaluation to be done at given iterations during the training process. At each interval, the package saves a snapshot of the rule population, along with evaluation accuracy and instance coverage. These snapshots of the rule population (including the final rule population) can then be exported as a csv after training is complete for analysis using the built in "exportRulePopulationAtIterationToCSV" and "exportFinalRulePopulationToCSV" methods. ## Usage -For more information on the eLCS algorithm and how to use it, please refer to the "eLCS User Guide" Jupyter Notebook inside this repository. +For more information on the eLCS algorithm and how to use it, please refer to the ["eLCS User Guide"](https://github.com/UrbsLab/scikit-eLCS/blob/master/eLCS%20User%20Guide.ipynb) Jupyter Notebook inside this repository. ## Usage TLDR ```python