Skip to content

Commit

Permalink
Optimise som imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tnaccarato committed Aug 13, 2024
1 parent 2a25741 commit be7bf51
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions vis_phewas/som/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from django.conf import settings
from django.shortcuts import render, get_object_or_404
from django.http import JsonResponse
import pandas as pd
from collections import defaultdict
from api.models import TemporaryCSVData
Expand All @@ -12,13 +11,12 @@
from minisom import MiniSom
import numpy as np
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
import matplotlib.pyplot as plt
import plotly.express as px
import plotly.graph_objects as go
import plotly.io as pio
from io import StringIO


def cluster_results_to_csv(cluster_results):
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
file_name = f"cluster_results_{timestamp}.csv"
Expand Down Expand Up @@ -362,6 +360,5 @@ def create_allele_features(row, alleles, allele_weight=5):
'csv_path': f"{settings.MEDIA_URL}{file_name}",
}


# Return the rendered HTML
return render(request, 'som/som_view.html', context)
return render(request, 'som/som_view.html', context)

0 comments on commit be7bf51

Please sign in to comment.