Skip to content

Commit

Permalink
Remove google sheets dependency from notebook example and update setu…
Browse files Browse the repository at this point in the history
…p.py
  • Loading branch information
mbarandas committed Aug 22, 2023
1 parent 8be6465 commit 1c4050a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
15 changes: 6 additions & 9 deletions notebooks/TSFEL_HAR_Example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,7 @@
"source": [
"# Feature Extraction\n",
"\n",
"Through **Feature Extraction** methodologies, the data is translated into a feature vector containing information about the signal properties of each window. These properties can be classified according to their domain as Time, Frequency and Statistical features and allow to characterise the signal compactly, enhancing its characteristics. This features will be used as input to the machine learning classifier, thus, the chosen set of features can strongly influence the classification output.\n",
"\n",
"The features to extract are defined in the [google sheet](https://docs.google.com/spreadsheets/d/13u7L_5IX3XxFuq_SnbOZF1dXQfcBB0wR3PXhvevhPYA/edit?usp=sharing). Save a copy on your local drive and share it with [email protected].\n",
"\n",
"**Change your google sheet file name and the googleSheet_name variable to your name so both have the same name.**"
"Through **Feature Extraction** methodologies, the data is translated into a feature vector containing information about the signal properties of each window. These properties can be classified according to their domain as Time, Frequency and Statistical features and allow to characterise the signal compactly, enhancing its characteristics. This features will be used as input to the machine learning classifier, thus, the chosen set of features can strongly influence the classification output."
]
},
{
Expand Down Expand Up @@ -279,9 +275,10 @@
],
"source": [
"#@title Feature Extraction\n",
"googleSheet_name = \"Features_dev\"\n",
"# Extract excel info\n",
"cfg_file = tsfel.extract_sheet(googleSheet_name)\n",
"cfg_file = tsfel.get_features_by_domain() # All features \n",
"# cfg_file = tsfel.get_features_by_domain('statistical') # Only statistical features\n",
"# cfg_file = tsfel.get_features_by_domain('temporal') # Only temporal features\n",
"# cfg_file = tsfel.get_features_by_domain('spectral') # Only spectral features\n",
"\n",
"# Get features\n",
"X_train = tsfel.time_series_features_extractor(cfg_file, x_train_sig, fs=fs)\n",
Expand Down Expand Up @@ -461,7 +458,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.6.9"
}
},
"nbformat": 4,
Expand Down
32 changes: 21 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import setuptools
from pathlib import Path

ROOT = Path(__file__).parent

with open("README.md", "r") as fh:
long_description = fh.read()

with open('requirements/requirements.txt', 'r') as f:
install_reqs = [
s for s in [
line.strip(' \n') for line in f
] if not s.startswith('#') and s != ''
]

def find_requirements(filename):
with (ROOT / "requirements" / filename).open() as f:
return [
s
for s in [line.strip(" \n") for line in f]
if not s.startswith("#") and s != ""
]


install_reqs = find_requirements("requirements.txt")
docs_require = find_requirements("requirements-docs.txt")

setuptools.setup(
name="tsfel",
Expand All @@ -19,15 +27,17 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/fraunhoferportugal/tsfel/",
packages=setuptools.find_packages("tsfel"),
extras_require={ # Optional
'docs': ['sphinx'],
'tests': ['mypy', 'black'],
package_data={
"tsfel": ["feature_extraction/features.json"]
},
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
install_requires=install_reqs
install_requires=install_reqs,
extras_require={
"docs": docs_require,
},
)

0 comments on commit 1c4050a

Please sign in to comment.