{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": true, "editable": true }, "source": [ "# Basic exampe of the RelevantFeatureAugmenter in sklearn pipeline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [], "source": [ "import pandas as pd\n", "from sklearn.pipeline import Pipeline\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.ensemble import RandomForestClassifier\n", "from sklearn.metrics import classification_report\n", "\n", "from tsfresh.examples.robot_execution_failures import download_robot_execution_failures\n", "from tsfresh.examples import load_robot_execution_failures\n", "from tsfresh.transformers import RelevantFeatureAugmenter\n", "from tsfresh.utilities.dataframe_functions import impute" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [], "source": [ "# Download the dataset if you haven't already\n", "download_robot_execution_failures() \n", "# Load data\n", "df_ts, y = load_robot_execution_failures()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true, "deletable": true, "editable": true }, "outputs": [], "source": [ "# We create an empty feature matrix that has the proper index\n", "X = pd.DataFrame(index=y.index)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true, "deletable": true, "editable": true }, "outputs": [], "source": [ "# Split data into train and test set\n", "X_train, X_test, y_train, y_test = train_test_split(X, y)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [], "source": [ "# We have a pipeline that consists of a feature extraction step with a subsequent Random Forest Classifier \n", "ppl = Pipeline([('fresh', RelevantFeatureAugmenter(column_id='id', column_sort='time')),\n", " ('clf', RandomForestClassifier())])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [ { "data": { "text/plain": [ "Pipeline(steps=[('fresh', RelevantFeatureAugmenter(chunksize=None, column_id=None, column_kind=None,\n", " column_sort=None, column_value=None,\n", " default_fc_parameters=None, disable_progressbar=None,\n", " fdr_level=None, filter_only_tsfresh_features=True,\n", " hypotheses_ind...imators=10, n_jobs=1, oob_score=False, random_state=None,\n", " verbose=0, warm_start=False))])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Here comes the tricky part, due to limitations of the sklearn pipeline API, we can not pass the dataframe\n", "# containing the time series dataframe but instead have to use the set_params method\n", "# In this case, df_ts contains the time series of both train and test set, if you have different dataframes for \n", "# train and test set, you have to call set_params two times (see the notebook pipeline_with_two_datasets.ipynb)\n", "ppl.set_params(fresh__timeseries_container=df_ts)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Feature Extraction: 100%|██████████| 6/6 [00:16<00:00, 2.79s/it]\n", "WARNING:tsfresh.utilities.dataframe_functions:The columns ['a__max_langevin_fixed_point__m_3__r_30'\n", " 'a__friedrich_coefficients__m_3__r_30__coeff_3'\n", " 'a__friedrich_coefficients__m_3__r_30__coeff_2'\n", " 'a__friedrich_coefficients__m_3__r_30__coeff_1'\n", " 'a__friedrich_coefficients__m_3__r_30__coeff_0'\n", " 'a__spkt_welch_density__coeff_8' 'c__spkt_welch_density__coeff_8'\n", " 'b__spkt_welch_density__coeff_8' 'e__spkt_welch_density__coeff_8'\n", " 'd__spkt_welch_density__coeff_8' 'f__spkt_welch_density__coeff_8'] did not have any finite values. Filling with zeros.\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.85 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__value_count__value_nan is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__value_count__value_inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.55 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.2__ql_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.2__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.2__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.85 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.2__ql_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__large_number_of_peaks__n_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.25 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__large_standard_deviation__r_0.05 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.8__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.2__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.75 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__value_count__value_-inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.6__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.6__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.15 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__large_number_of_peaks__n_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.6__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.55 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.2__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__length is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.2__ql_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.2__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__value_count__value_inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.25 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.2__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.2__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__fft_coefficient__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__fft_coefficient__coeff_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__fft_coefficient__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__fft_coefficient__coeff_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.4__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__fft_coefficient__coeff_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_standard_deviation__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.75 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__fft_coefficient__coeff_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__fft_coefficient__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__length is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.55 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__max_langevin_fixed_point__m_3__r_30 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.25 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_standard_deviation__r_0.15 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.85 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.2__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.95 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__autocorrelation__lag_7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__autocorrelation__lag_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__autocorrelation__lag_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.4__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.4__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.4__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.6__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.4__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__value_count__value_-inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.8__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__value_count__value_nan is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__value_count__value_nan is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__spkt_welch_density__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__friedrich_coefficients__m_3__r_30__coeff_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__friedrich_coefficients__m_3__r_30__coeff_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__friedrich_coefficients__m_3__r_30__coeff_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.05 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__large_standard_deviation__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__has_duplicate is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.65 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.75 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__length is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.4__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__spkt_welch_density__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_standard_deviation__r_0.05 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__value_count__value_nan is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__value_count__value_-inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.2__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.2__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__length is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.2__ql_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.2__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_standard_deviation__r_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_standard_deviation__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_standard_deviation__r_0.1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.6__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__length is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.4__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_standard_deviation__r_0.15 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.4__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.6__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.65 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__length is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.6__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.85 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.2__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__autocorrelation__lag_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__value_count__value_inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__autocorrelation__lag_6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__autocorrelation__lag_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.6__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.55 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.35 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.4__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.4__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.95 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__friedrich_coefficients__m_3__r_30__coeff_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.8__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.75 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.65 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.4__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.85 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.95 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_standard_deviation__r_0.1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_standard_deviation__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_standard_deviation__r_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.4__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.6__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__augmented_dickey_fuller is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_standard_deviation__r_0.1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_standard_deviation__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__autocorrelation__lag_6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__friedrich_coefficients__m_3__r_30__coeff_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__friedrich_coefficients__m_3__r_30__coeff_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__friedrich_coefficients__m_3__r_30__coeff_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__friedrich_coefficients__m_3__r_30__coeff_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__value_count__value_-inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.35 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__large_number_of_peaks__n_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.8__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__autocorrelation__lag_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_standard_deviation__r_0.05 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_number_of_peaks__n_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_number_of_peaks__n_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_number_of_peaks__n_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__value_count__value_nan is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__large_standard_deviation__r_0.1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.55 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.95 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__mean_abs_change_quantiles__qh_0.8__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__max_langevin_fixed_point__m_3__r_30 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__index_mass_quantile__q_0.3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__autocorrelation__lag_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__max_langevin_fixed_point__m_3__r_30 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__large_standard_deviation__r_0.15 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_number_of_peaks__n_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_standard_deviation__r_0.15 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_number_of_peaks__n_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_number_of_peaks__n_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__max_langevin_fixed_point__m_3__r_30 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.75 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.65 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__value_count__value_inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__spkt_welch_density__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__value_count__value_inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__fft_coefficient__coeff_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__fft_coefficient__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.2__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.2__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.8__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__mean_abs_change_quantiles__qh_0.2__ql_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__value_count__value_-inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.2__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__value_count__value_-inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__friedrich_coefficients__m_3__r_30__coeff_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__friedrich_coefficients__m_3__r_30__coeff_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__symmetry_looking__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__friedrich_coefficients__m_3__r_30__coeff_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__friedrich_coefficients__m_3__r_30__coeff_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.2__ql_0.2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__symmetry_looking__r_0.95 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.2__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.2__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__value_count__value_inf is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__friedrich_coefficients__m_3__r_30__coeff_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__friedrich_coefficients__m_3__r_30__coeff_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__fft_coefficient__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__fft_coefficient__coeff_9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__symmetry_looking__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_number_of_peaks__n_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_number_of_peaks__n_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__value_count__value_nan is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__friedrich_coefficients__m_3__r_30__coeff_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__friedrich_coefficients__m_3__r_30__coeff_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__friedrich_coefficients__m_3__r_30__coeff_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__friedrich_coefficients__m_3__r_30__coeff_2 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__spkt_welch_density__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__autocorrelation__lag_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_standard_deviation__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__spkt_welch_density__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__max_langevin_fixed_point__m_3__r_30 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.6__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__symmetry_looking__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__spkt_welch_density__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.65 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.6__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__autocorrelation__lag_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__autocorrelation__lag_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__autocorrelation__lag_6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__autocorrelation__lag_7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__large_number_of_peaks__n_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__friedrich_coefficients__m_3__r_30__coeff_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__mean_abs_change_quantiles__qh_0.6__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__max_langevin_fixed_point__m_3__r_30 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__large_number_of_peaks__n_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.4__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__friedrich_coefficients__m_3__r_30__coeff_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.4__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__friedrich_coefficients__m_3__r_30__coeff_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature f__fft_coefficient__coeff_8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__mean_abs_change_quantiles__qh_0.4__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__symmetry_looking__r_0.35 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__friedrich_coefficients__m_3__r_30__coeff_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__large_standard_deviation__r_0.45 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__autocorrelation__lag_7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__friedrich_coefficients__m_3__r_30__coeff_0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.9 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__large_standard_deviation__r_0.05 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__friedrich_coefficients__m_3__r_30__coeff_1 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature b__mean_abs_change_quantiles__qh_0.2__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.4__ql_0.8 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature c__large_number_of_peaks__n_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.4__ql_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature a__mean_abs_change_quantiles__qh_0.4__ql_0.4 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.0 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.7 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.6 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature d__symmetry_looking__r_0.5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_number_of_peaks__n_5 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_number_of_peaks__n_3 is constant\n", "WARNING:tsfresh.feature_selection.feature_selector:[test_feature_significance] Feature e__large_number_of_peaks__n_1 is constant\n", "Feature Extraction: 100%|██████████| 6/6 [00:04<00:00, 1.28it/s]\n" ] }, { "data": { "text/plain": [ "Pipeline(steps=[('fresh', RelevantFeatureAugmenter(chunksize=None, column_id=None, column_kind=None,\n", " column_sort=None, column_value=None,\n", " default_fc_parameters=None, disable_progressbar=None,\n", " fdr_level=None, filter_only_tsfresh_features=True,\n", " hypotheses_ind...imators=10, n_jobs=1, oob_score=False, random_state=None,\n", " verbose=0, warm_start=False))])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# We fit the pipeline\n", "ppl.fit(X_train, y_train)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Feature Extraction: 100%|██████████| 6/6 [00:01<00:00, 2.99it/s]\n" ] } ], "source": [ "# Predicting works as well\n", "y_pred = ppl.predict(X_test)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false, "deletable": true, "editable": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " precision recall f1-score support\n", "\n", " 0 1.00 1.00 1.00 5\n", " 1 1.00 1.00 1.00 17\n", "\n", "avg / total 1.00 1.00 1.00 22\n", "\n" ] } ], "source": [ "# So, finally we inspect the performance\n", "print(classification_report(y_test, y_pred))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }