Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Added dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cvalenzu committed Nov 17, 2020
1 parent 52e147d commit 1ee2107
Show file tree
Hide file tree
Showing 12 changed files with 2,137 additions and 631 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.7

# Installing git
RUN apt-get update -y
RUN apt-get install -y git
# Installing numpy and jupyterlab
RUN pip install jupyterlab numpy Cython pyarrow

# Installing requirements
COPY ./requirements.txt requirements.txt
RUN pip install -r requirements.txt

# Copying examples
COPY ./examples /examples

# Copying this package
COPY . /package
RUN pip install -e /package

# Download models
RUN python -c "from lc_classifier.classifier.models import HierarchicalRandomForest;HierarchicalRandomForest({}).download_model()"

WORKDIR /examples
EXPOSE 8888

CMD ["jupyter", "notebook", "--allow-root", "--ip", "0.0.0.0", "--NotebookApp.token=''"]
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pip install -e .
# Functionalities

## Augmentation
If you want more samples you can use our implementation of data augmentation. For now you can use ShortTransientAugmenter for some transients.
If you want more samples you can use our implementation of data augmentation. For now you can use ShortTransientAugmenter for some transients.

## Classifier
The classifier code contains BaseClassifier (a simple random forest) and HierarchicalRandomForest (a random forest with internal hierarchy), both with methods for fit and predict.
Expand All @@ -39,7 +39,7 @@ Before to get features, we preprocess the time series with filters and boundary
### Extractors:
The extractors are the portion of code with the logic to extract features from time series. Each extractor do only one task, after that our CustomHierarchicalExtractor merge all extractors for get features to train the model.

##### How can I add extractors to library?
##### How can I add extractors to library?
You can use inheritance from `base extractors` and use it for create your own extractor. For now you can inherit:
- `FeatureExtractor` is a generic extractor only fill methods.
- `FeatureExtractorSingleBand` is a extractor that compute features by band.
Expand Down Expand Up @@ -83,6 +83,20 @@ After that you can see a report of tests:
coverage report
```

# Run a container

This repository comes with a Dockerfile to test the model.

To build the image run
```
docker build -t alerce/lc_classifier
```
Then run the container
```
docker run --rm -p 8888:8888 alerce/lc_classifier
```
The container comes with a jupyter notebook and some examples in `http://localhost:8888`

# Reference

If you use this library, please cite our work:
Expand Down
Loading

0 comments on commit 1ee2107

Please sign in to comment.