Giter Site home page Giter Site logo

trainconnectionprediction / tcp Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 2.0 103.35 MB

TrAIn_Connection_Prediction - The best Train Delay Prediction System. TCP

Home Page: https://trainconnectionprediction.de/

License: GNU General Public License v3.0

Jupyter Notebook 45.21% Python 43.20% HTML 2.87% Shell 0.07% Dockerfile 0.12% JavaScript 1.23% CSS 0.29% Vue 6.72% SCSS 0.29%
python bahn tcp machine-learning trains deutsche-bahn

tcp's Introduction

The project was moved to GitLab for futher development: https://gitlab.com/bahnvorhersage/bahnvorhersage


TrAIn_Connection_Prediction: TCP https://trainconnectionprediction.de/

                            ╔═══╗
   ╔════════════════════════╩═══╩════════════════════════╗
   ║            ████████    ██████   ██████              ║
   ║               ██      ██        ██   ██             ║
   ║               ██      ██        ██████              ║
   ║               ██      ██        ██                  ║
   ║               ██       ██████   ██                  ║
   ╚════════════════════════╦═══╦════════════════════════╝
                    \''''───║   ╟───''''/
                     )__,--─║   ╟─--,__(
                            ║   ║
      Your friendly         ║   ║
TrAIn_Connection_Prediction ║   ║
          Service           ║   ║
^^^^^^^^^^^^^^^^^^^^^^^^^^^^╜   ╙^^^^^^^^^^^^^^^^^^^^^^^^^^^

Winning project of the German National Artificial Intelligence Competition 2019 called BWKI. Visit this project on our website at https://trainconnectionprediction.de/.

For the youth competition Jugend Forscht (JuFo) in Germany we have written a paper (in german) about our project,
which can be found in our repository under docs/langfassung_tcp.pdf.

We also have some interesting plots from our data under docs/analysis.md.
You can also generate plots on our website.

Running webserver

If you for whatever reason want to run our website on your computer just do as described below.
But you are going to need a connection to our database, to do so contact us...

To run our webserver we strongly recommend to use Docker.

First, the usergroup 420 has to have the rights to write to the cache volume. In order to add the permission, do the following

sudo chown -R :420 /path/to/your/cache/

Then in the project directory run:

# In order to build:
DOCKER_BUILDKIT=1 docker build -f webserver/Dockerfile.webserver . -t webserver
# In order to serve:
docker run -p 5000:5000 -v $(pwd)/config.py:/mnt/config/config.py -v $(pwd)/cache:/usr/src/app/cache webserver

The webserver should now be running on http://localhost:5000/

Frontend development

For the development of the frontend/website, build the vue frontend in development mode:

# Go to the website
cd webserver/website
# Build Website
./node_modules/.bin/vue-cli-service build --mode development

Installing Cartopy

We use cartopy in our backend to generate nice looking geo plots. It can be hard to install cartopy. Modern Cartopy uses proj 8, which is unavailable in many package repositories. Here is how to install in from source:

Install build dependencies

apt update -y
apt install -y --fix-missing --no-install-recommends \
            software-properties-common build-essential ca-certificates \
            make cmake wget unzip libtool automake \
            zlib1g-dev libsqlite3-dev pkg-config sqlite3 libcurl4-gnutls-dev \
            libtiff5-dev git

Clone proj repository from GitHub

git clone https://github.com/OSGeo/PROJ.git
cd PROJ

Build and install

./autogen.sh
./configure
make
make install

After installing Proj, you should now be able to just install cartopy

pip install cartopy

Credits

tcp's People

Contributors

dependabot[bot] avatar mariusdkm avatar mctoel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tcp's Issues

format on mobile

Die Bahnhof boxen sind außerhalb der grauen hintergrund box auf dem handy (bei Firefox und Chrome)

Username

Hey @Underscore,

We are the winning Team of the German National AI bw-ki.de competition.
This is our Project, currently our "Organization"/Team Account is names after the Project.
But our real team name is Underscore.
So we are asking very kindly if you could "give" us your username.

Thanks a lot.
-Team Underscore

Enhance Landingpage

TLDR: man muss sich mit der Landingpage mal nen bisschen auseinandersetzen, vor allem mal mit jemanden der sich damit auskennt

Also ich habe grade mal mit nen paar Leuten darüber geredet, und die meinten,
dass man keinen wichtigen Text über einem Bild hat, bzw. kein wichtiges Bild hinter einem Text.

Ich zwei schnellere Verbesserungen wären:

  • Ein shadow hinter des Input Form setzen, man kann da mal mit shadow Farben vll rumexperimentieren?
  • Den Slogan komplett entfernen

Schau/such mal Parralax scrolling Webseiten an, wie die des machen.

Mein Vorschlag wäre:
Mehr Detail ins Bild, sodass des nen bisschen voller ist,
dann setzt man den sinnvoll! Text auf den Zug, und dieser Scrollt schneller weg, für nen coolen Effekt.
Dann zum Input Form 2 Möglichkeiten:

  • Man lässt den Zug hinter dem Input Form rauskommen, kp wie man des geht, bzw wie gut des aussieht
  • Man hat was hinter dem Input Form, (z.B. nen besseres Hintergrundbild) und dann nen guten Shadow

`rtd_ray.upgrade_rtd()`

When after using rtd_ray.download_rtd() and then rtd_ray.upgrade_rtd() once,
rtd_ray.upgrade_rtd() doesn't work anymore.
I think rtd_ray.upgrade_rtd() does something weird.

Function:  subgraph_callable-81d1293f-236b-4a65-a47d-08df5268
args:      ({'piece': ('/usr/src/app/cache/recent_change_rtd/_new/part.0.parquet', None, None)})
kwargs:    {}
Exception: "ValueError('Categorical categories cannot be null')"

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/src/app/update_butler/__main__.py", line 28, in <module>
    rtd_ray.upgrade_rtd()
  File "/usr/src/app/helpers/RtdRay.py", line 294, in upgrade_rtd
    rtd = self.load_data()
  File "/usr/src/app/helpers/RtdRay.py", line 430, in load_data
    rtd[key] = rtd[key].cat.set_categories(rtd[key].head(1).cat.categories)
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/core.py", line 1098, in head
    return self._head(n=n, npartitions=npartitions, compute=compute, safe=safe)
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/core.py", line 1132, in _head
    result = result.compute()
  File "/opt/venv/lib/python3.9/site-packages/dask/base.py", line 288, in compute
    (result,) = compute(self, traverse=False, **kwargs)
  File "/opt/venv/lib/python3.9/site-packages/dask/base.py", line 570, in compute
    results = schedule(dsk, keys, **kwargs)
  File "/opt/venv/lib/python3.9/site-packages/distributed/client.py", line 2722, in get
    results = self.gather(packed, asynchronous=asynchronous, direct=direct)
  File "/opt/venv/lib/python3.9/site-packages/distributed/client.py", line 1977, in gather
    return self.sync(
  File "/opt/venv/lib/python3.9/site-packages/distributed/client.py", line 865, in sync
    return sync(
  File "/opt/venv/lib/python3.9/site-packages/distributed/utils.py", line 327, in sync
    raise exc.with_traceback(tb)
  File "/opt/venv/lib/python3.9/site-packages/distributed/utils.py", line 310, in f
    result[0] = yield future
  File "/opt/venv/lib/python3.9/site-packages/tornado/gen.py", line 762, in run
    value = future.result()
  File "/opt/venv/lib/python3.9/site-packages/distributed/client.py", line 1842, in _gather
    raise exception.with_traceback(traceback)
  File "/opt/venv/lib/python3.9/site-packages/dask/optimization.py", line 969, in __call__
    return core.get(self.dsk, self.outkey, dict(zip(self.inkeys, args)))
  File "/opt/venv/lib/python3.9/site-packages/dask/core.py", line 149, in get
    result = _execute_task(task, cache)
  File "/opt/venv/lib/python3.9/site-packages/dask/core.py", line 119, in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/io/parquet/core.py", line 87, in __call__
    return read_parquet_part(
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/io/parquet/core.py", line 422, in read_parquet_part
    dfs = [
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/io/parquet/core.py", line 423, in <listcomp>
    func(fs, rg, columns.copy(), index, **toolz.merge(kwargs, kw))
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/io/parquet/arrow.py", line 432, in read_partition
    df = cls._arrow_table_to_pandas(arrow_table, categories, **kwargs)
  File "/opt/venv/lib/python3.9/site-packages/dask/dataframe/io/parquet/arrow.py", line 1574, in _arrow_table_to_pandas
    return arrow_table.to_pandas(categories=categories, **_kwargs)
  File "pyarrow/array.pxi", line 766, in pyarrow.lib._PandasConvertible.to_pandas
  File "pyarrow/table.pxi", line 1815, in pyarrow.lib.Table._to_pandas
  File "/opt/venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 789, in table_to_blockmanager
    blocks = _table_to_blocks(options, table, categories, ext_columns_dtypes)
  File "/opt/venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 1130, in _table_to_blocks
    return [_reconstruct_block(item, columns, extension_columns)
  File "/opt/venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 1130, in <listcomp>
    return [_reconstruct_block(item, columns, extension_columns)
  File "/opt/venv/lib/python3.9/site-packages/pyarrow/pandas_compat.py", line 728, in _reconstruct_block
    cat = _pandas_api.categorical_type.from_codes(
  File "/opt/venv/lib/python3.9/site-packages/pandas/core/arrays/categorical.py", line 672, in from_codes
    dtype = CategoricalDtype._from_values_or_dtype(
  File "/opt/venv/lib/python3.9/site-packages/pandas/core/dtypes/dtypes.py", line 296, in _from_values_or_dtype
    dtype = CategoricalDtype(categories, ordered)
  File "/opt/venv/lib/python3.9/site-packages/pandas/core/dtypes/dtypes.py", line 183, in __init__
    self._finalize(categories, ordered, fastpath=False)
  File "/opt/venv/lib/python3.9/site-packages/pandas/core/dtypes/dtypes.py", line 337, in _finalize
    categories = self.validate_categories(categories, fastpath=fastpath)
  File "/opt/venv/lib/python3.9/site-packages/pandas/core/dtypes/dtypes.py", line 537, in validate_categories
    raise ValueError("Categorical categories cannot be null")
ValueError: Categorical categories cannot be null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.