Skip to content

Commit b6b4284

Browse files
committed
Initial commit from merger of Flask Web Project and my original RedLily project.
0 parents commit b6b4284

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+30056
-0
lines changed

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# PyInstaller
11+
# Usually these files are written by a python script from a template
12+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
13+
*.manifest
14+
*.spec
15+
16+
# Installer logs
17+
pip-log.txt
18+
pip-delete-this-directory.txt
19+
20+
# Unit test / coverage reports
21+
htmlcov/
22+
.tox/
23+
.coverage
24+
.coverage.*
25+
.cache
26+
nosetests.xml
27+
coverage.xml
28+
*,cover
29+
.hypothesis/
30+
31+
# Translations
32+
*.mo
33+
*.pot
34+
35+
*.xdt
36+
37+
.vscode/*
38+
bin-audit/*

ClearDataPoints.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/python
2+
3+
from dataProcessor import DataProcessor
4+
5+
DataProcessor( ).ClearDataPoints( )

EstimatePace.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/python
2+
3+
import pickle
4+
import sys
5+
from sklearn.model_selection import train_test_split, KFold
6+
7+
from sklearn.linear_model import LinearRegression
8+
9+
sys.path.append("./tools/")
10+
from feature_format import featureFormat, targetFeatureSplit
11+
12+
file='MyDataFile.pkl'
13+
14+
### read in data dictionary, convert to numpy array
15+
data_dict = pickle.load( open(file, "r") )
16+
17+
#features = ["race_speed", "race_distance", 'workout_count', 'workout_distance', 'workout_duration', 'velocity_*', 'cadence_*' ]
18+
features = ["race_speed", "race_distance", 'workout_count', 'workout_distance', 'workout_duration', 'velocity_*']
19+
data_array = featureFormat( data_dict, features )
20+
target, features = targetFeatureSplit( data_array )
21+
22+
feature_train, feature_test, target_train, target_test = train_test_split(features, target, test_size=0.25, random_state=42)
23+
24+
print 'Feature Train:'
25+
print feature_train
26+
print
27+
print 'Target Train:'
28+
print target_train
29+
30+
import numpy as np
31+
32+
reg = LinearRegression()
33+
reg.fit( feature_train, target_train )
34+
35+
accuracy = reg.score( feature_test, target_test )
36+
37+
print accuracy

FlaskWebProject1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
The flask application package.
3+
"""
4+
5+
from flask import Flask
6+
app = Flask(__name__)
7+
8+
import FlaskWebProject1.views
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from datetime import datetime, date, timedelta
2+
import dateutil.parser
3+
4+
def format_datetime(value, format='date'):
5+
if format == 'date_time':
6+
format="%B %d, %Y at %I:%M %p"
7+
elif format == 'date':
8+
format="%B %d, %Y"
9+
return value.strftime(format)

0 commit comments

Comments
 (0)