{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data analysis: Velib" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Author: O. Roustant, INSA Toulouse. February 2022.\n", "\n", "\n", "We consider the ‘Vélib’ data set, related to the bike sharing system of Paris. The data are loading profiles of the bike stations over one week, collected every hour, from the period Monday 2nd Sept. - Sunday 7th Sept., 2014. The loading profile of a station, or simply loading, is defined as the ratio of number of available bikes divided by the number of bike docks. A loading of 1 means that the station is fully loaded, i.e. all bikes are available. A loading of 0 means that the station is empty, all bikes have been rent.\n", "\n", "From the viewpoint of data analysis, the individuals are the stations. The variables are the 168 time steps (hours in the week). The aim is to detect clusters in the data, corresponding to common customer usages. This clustering should then be used to predict the loading profile." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Loading required package: MASS\n", "\n", "Loading required package: fda\n", "\n", "Loading required package: splines\n", "\n", "Loading required package: Matrix\n", "\n", "Loading required package: fds\n", "\n", "Loading required package: rainbow\n", "\n", "Loading required package: pcaPP\n", "\n", "Loading required package: RCurl\n", "\n", "\n", "Attaching package: ‘fda’\n", "\n", "\n", "The following object is masked from ‘package:graphics’:\n", "\n", " matplot\n", "\n", "\n", "Loading required package: elasticnet\n", "\n", "Loading required package: lars\n", "\n", "Loaded lars 1.2\n", "\n", "\n" ] } ], "source": [ "rm(list = ls()) # erase everything, start from scratch!\n", "\n", "# load the data from package funFEM\n", "\n", "library(\"funFEM\")\n", "data(velib)\n", "help(\"velib\")\n", "#str(velib)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | ⋯ | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
EURYALE DEHAYNIN | 0.03846154 | 0.03846154 | 0.07692308 | 0.03846154 | 0.03846154 | 0.03846154 | 0.03846154 | 0.03846154 | 0.10714286 | 0.00000000 | ⋯ | 0.29629630 | 0.11111111 | 0.1111111 | 0.14814815 | 0.30769231 | 0.07692308 | 0.11538462 | 0.07692308 | 0.1538462 | 0.1538462 |
LEMERCIER | 0.47826087 | 0.47826087 | 0.47826087 | 0.43478261 | 0.43478261 | 0.43478261 | 0.43478261 | 0.43478261 | 0.26086957 | 0.04347826 | ⋯ | 0.04347826 | 0.00000000 | 0.2173913 | 0.13043478 | 0.04545455 | 0.17391304 | 0.17391304 | 0.17391304 | 0.2608696 | 0.3913043 |
MEZIERES RENNES | 0.21818182 | 0.14545455 | 0.12727273 | 0.10909091 | 0.10909091 | 0.10909091 | 0.09090909 | 0.09090909 | 0.05454545 | 0.10909091 | ⋯ | 0.25925926 | 0.25925926 | 0.2037037 | 0.12962963 | 0.14814815 | 0.29629630 | 0.31481481 | 0.37037037 | 0.3703704 | 0.4074074 |
FARMAN | 0.95238095 | 0.95238095 | 0.95238095 | 0.95238095 | 0.95238095 | 0.95238095 | 0.95238095 | 1.00000000 | 1.00000000 | 1.00000000 | ⋯ | 1.00000000 | 1.00000000 | 0.9047619 | 0.85714286 | 0.85714286 | 0.85714286 | 0.76190476 | 0.76190476 | 0.7619048 | 0.7619048 |
QUAI DE LA RAPEE | 0.92753623 | 0.81159420 | 0.73913043 | 0.72463768 | 0.72463768 | 0.72463768 | 0.72463768 | 0.72463768 | 0.75362319 | 0.97101449 | ⋯ | 0.22727273 | 0.45454545 | 0.5909091 | 0.83333333 | 1.00000000 | 0.81818182 | 0.63636364 | 0.71212121 | 0.6212121 | 0.5757576 |
CHOISY POINT D'IVRY | 0.16666667 | 0.16666667 | 0.16666667 | 0.16666667 | 0.16666667 | 0.16666667 | 0.16666667 | 0.16666667 | 0.08333333 | 0.00000000 | ⋯ | 0.34782609 | 0.08695652 | 0.1153846 | 0.08695652 | 0.13043478 | 0.08695652 | 0.08695652 | 0.43478261 | 0.3913043 | 0.5217391 |