Skip to content

Commit

Permalink
Added API & prod changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gamingflexer committed Jun 28, 2022
1 parent eafc8c5 commit 950e3c3
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 143 deletions.
124 changes: 21 additions & 103 deletions Web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Web/src/firebase.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
// import { getAnalytics } from "firebase/analytics";
// import firebase from "firebase";
import {
getFirestore
Expand All @@ -22,6 +22,6 @@ const firebaseConfig = {
// Initialize Firebase
const app = initializeApp(firebaseConfig);

const db = getFirestore(app)
// const db = getFirestore(app)

export default db;
Binary file modified backend/__pycache__/config.cpython-39.pyc
Binary file not shown.
Binary file modified backend/__pycache__/upload.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _corsify_actual_response(response):
app.config['UPLOAD_FOLDER'] = upload
app.config['SECRET_KEY'] = 'cairocoders-ednalan'

ALLOWED_EXTENSIONS = {'csv'}
ALLOWED_EXTENSIONS = {'csv','xlsv','xls'}

def allowed_file(filename):
return '.' in filename and \
Expand Down
7 changes: 2 additions & 5 deletions backend/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def translator(text):
return translation

def pandas_profiling(file_path):
data1 = pd.read_csv(file_path)
data1 = pd.read_csv(file_path).head(100)

file_name = os.path.splitext(file_path)[0]
print(file_name)
Expand All @@ -30,8 +30,7 @@ def pandas_profiling(file_path):
print(path_of_file)
profile.to_widgets()
profile.to_file(f"{file_name}_anylasis.html")



return ("/home/azureuser/hackManthan/backend/static/"+f"{file_name}_anylasis.html",f"{file_name}_anylasis.html")


Expand Down Expand Up @@ -59,15 +58,13 @@ def kmeans_centers(data): #type of input
print(e)
return None


def predict_violent(file): #type of input - change the input also
data = pd.read_csv(file)
loaded_model = pickle.load(open(model_path, 'rb'))
prediction = loaded_model.predict(data)
return prediction

def predict_crime(address1,DT):

#load
try:
address = translator(address1)
Expand Down
14 changes: 7 additions & 7 deletions backend/static/Reports/html_report_jinja.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<br>
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Data First 5 Rows</h5>
<h5 class="h4" style="padding:0;">Data First 5 Rows</h5>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
Expand Down Expand Up @@ -186,7 +186,7 @@ <h5 class="h4">Data First 5 Rows</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Data Last 5 Rows</h5>
<h5 class="h4" style="padding:0;">Data Last 5 Rows</h5>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
Expand Down Expand Up @@ -290,7 +290,7 @@ <h5 class="h4">Data Last 5 Rows</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Columns in the CSV File</h5>
<h5 class="h4" style="padding:0;">Columns in the CSV File</h5>
Index(['index', 'Unnamed: 0', 'District', 'Event', 'Circle', 'Police Station',
'Caller Source', 'Event Type', 'Event Sub-Type', 'Create Date/Time',
'Latitude', 'Longitude'],
Expand All @@ -303,7 +303,7 @@ <h5 class="h4">Columns in the CSV File</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Min Max of the Data</h5>
<h5 class="h4" style="padding:0;">Min Max of the Data</h5>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
Expand Down Expand Up @@ -337,7 +337,7 @@ <h5 class="h4">Min Max of the Data</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Correlation Table</h5>
<h5 class="h4" style="padding:0;">Correlation Table</h5>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
Expand Down Expand Up @@ -381,7 +381,7 @@ <h5 class="h4">Correlation Table</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Numberical Data</h5>
<h5 class="h4" style="padding:0;">Numberical Data</h5>
Index(['index', 'Unnamed: 0', 'Latitude', 'Longitude'], dtype='object')
<div class="col-12">
</div>
Expand All @@ -390,7 +390,7 @@ <h5 class="h4">Numberical Data</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Categorical Data</h5>
<h5 class="h4" style="padding:0;">Categorical Data</h5>
Index(['District', 'Event', 'Circle', 'Police Station', 'Caller Source',
'Event Type', 'Event Sub-Type', 'Create Date/Time'],
dtype='object')
Expand Down
15 changes: 8 additions & 7 deletions backend/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@
<!-- Main container -->

<head>
<script src="https://cdn.tailwindcss.com"></script>
<title>{{heading}}</title>
<br>
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Data First 5 Rows</h5>
<h5 class="h4" style="padding:0;">Data First 5 Rows</h5>
{{data_head}}
<div class="col-12">
</div>
Expand All @@ -91,7 +92,7 @@ <h5 class="h4">Data First 5 Rows</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Data Last 5 Rows</h5>
<h5 class="h4" style="padding:0;">Data Last 5 Rows</h5>
{{data_tail}}
<div class="col-12">
</div>
Expand All @@ -100,7 +101,7 @@ <h5 class="h4">Data Last 5 Rows</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Columns in the CSV File</h5>
<h5 class="h4" style="padding:0;">Columns in the CSV File</h5>
{{data_columns}}
<div class="col-12">
</div>
Expand All @@ -110,15 +111,15 @@ <h5 class="h4">Columns in the CSV File</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Min Max of the Data</h5>
<h5 class="h4" style="padding:0;">Min Max of the Data</h5>
{{data_minMax}}
<div class="col-12">
</div>
</div>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Correlation Table</h5>
<h5 class="h4" style="padding:0;">Correlation Table</h5>
{{data_correlation}}
<div class="col-12">
</div>
Expand All @@ -127,7 +128,7 @@ <h5 class="h4">Correlation Table</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Numberical Data</h5>
<h5 class="h4" style="padding:0;">Numberical Data</h5>
{{data_numeric}}
<div class="col-12">
</div>
Expand All @@ -136,7 +137,7 @@ <h5 class="h4">Numberical Data</h5>
<hr class="divider-horizontal" />
<div class="container">
<div class="row gx-5 ">
<h5 class="h4">Categorical Data</h5>
<h5 class="h4" style="padding:0;">Categorical Data</h5>
{{data_categorical}}
<div class="col-12">
</div>
Expand Down
Loading

0 comments on commit 950e3c3

Please sign in to comment.