Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
D What is the best practice regarding hyperparameter tuning for baseline models?

Hey guys, I've developed a topic model that is a PGM so it doesn't have that many hyperparameters, (think something like LDA) so of course I've tuned them but not extensively, just trying different values to get it to converge, no grid search or anything (it works well for a range of hyperparameters anyways). Also I'm using just one set of hyperparameters for all 5 datasets.

I guess the question is how much hyperparameter tuning do I have to perform for the baseline models for a fair comparison? Right now all the baseline models work well after minor adjustments or even with default values, once again same set of hyperparameters for all 5 datasets, all except for the 'neural' topic models (like ProdLDA). In fact ProdLDA performs poorly on all 5 of the datasets I'm testing on (with the hyperparameters from their code), even though it performs well on the dataset that they use in their paper. So I do have a suspicion that the model may have been tuned specifically for that dataset.

How am I supposed to deal with this? Like I suppose I shouldn't give the neural topic models special treatment, but at the same time, do I have

/r/MachineLearning
https://redd.it/ks8ily
How to use machine learning in your django app?

Hi , I am intermediate in django and I mostly use django rest framework.I just wanted to ask how can I use machine learning in my django backend?I mean something like a recommendation system?

/r/django
https://redd.it/ksbigz
What do I gain with Heroku VS legacy VPS like Linode, AWS ec2 or DO ?

Hi guys,

I'm not by any mean a Linux administrator but I run archlinux as my main OS and know a little bit of bash scripting as well. I've deployed my 2 last projects over Linode and AWS ec2 without too much difficulties.

I've also tested Heroku free tier just to test how it works, it's indeed surprisingly fast to deploy on it using django-heroku but apart from the easy first deployment I wonder what do I really gain by using it ? Maybe I'm not aware of some problems that are hard to manually manage when your have lots of users and really go live.

Thanks in advance !

/r/django
https://redd.it/ksljbg
Friday Daily Thread: Free chat Friday!

Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!

/r/Python
https://redd.it/ksqcxt
Today is my first day learning coding and I am awestruck.

Okay, so I'm a freshman in uni who was just vibing at home during winter break in quarantine with absolutely nothing to do. I'm scrolling on Youtube and I come across this 4 hour long video from freeCodeCamp.org about Python, and on a whim, I decide to just see what the computer science hype is all about. And-

BRO

BRO

I don't know what I expected coding to be, but this is fricking awesome. It just makes me baffled how I can just make stuff on my computer that has never existed in the history of the computer!

Like, I just learned about inputs, and I wrote this whole funny conversation with my computer about how horrible my high school was (btw she was very sassy, and yes, I do have many unrepressed feelings about that place LOL). Anyways, I don't know if this is the right place to showcase my immense exuberance, but I guess I now do understand what all the hype is about.

/r/Python
https://redd.it/ks94qq
Could not import models from the same folder in Django

I cannot import my models in my api/views.py of my products app. Every folders and subfolders are shown in the image here.

​

[Products app folder](https://preview.redd.it/5xwg6ybst1a61.png?width=390&format=png&auto=webp&s=2dc5b795bfa8f0409725fc25132684331a4edb65)

​



My api\\views.py is

from products.models import *

class CategoryAPIView(ListAPIView):
queryset = Category (cant import Category)

/r/djangolearning
https://redd.it/kswin3
What DRF offers more than DJango itself?

Hello,
I am using Django Rest and now that I came to bottleneck because of lot of data I will have to use normal serializer instead of ModelSerializer.

So I am wondering what DRF offers that Django alone doesn't offer? Is there any reasons I should use DRF instead of simply returning JSON with Django alone?

/r/django
https://redd.it/ksl5lt
My list of resources for building a full to-do list app with Flask

Here are some of my early resources for learning Flask. With theses and the foundation of python, html and css, you should be well on your way to create your own fully functional todo list application. This is no small thing. A todo list, being a database driven application, is the foundation for a lot of popular use cases such as social networking apps, project management apps, blogs, etc.

The Official Flask tutorial. Good but constricting boilerplate:
https://flask.palletsprojects.com/en/1.1.x/tutorial/

A more informal CRUD tutorial but with an easy-to-follow workflow:
https://www.digitalocean.com/community/tutorials/build-a-crud-web-app-with-python-and-flask-part-one
https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-two
https://scotch.io/tutorials/build-a-crud-web-app-with-python-and-flask-part-three

A tutorial for getting a quick Flask App online with python anywhere:
https://blog.pythonanywhere.com/121/https://blog.pythonanywhere.com/158/

The Mega Tutorial. A bit wordy for me but lot's of best practices are there:
https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

/r/flask
https://redd.it/kstdo0
D Confused about doing a PhD during these times

I get that many people have asked whether it's worth it of doing a PhD in ML, but today I'm heavily conflicted in whether I should go for it or not.

Long story short, I've graduated in september with the french equivalent of an MS in mechanical engineering.
After having a few discussions about ML with one the professors of my uni during the past few months, he told me that he might have a PhD subject concerning applied ML for predictive maintenance/reliability engineering coming up. (Yes it's different here than the US, you apply to a PhD offer which usually have the subject properly defined)
And to add to this, it is what we call a CIFRE in France, which is basically a PhD with a partnership between the lab and a company. (The most notable difference is that you typically are considered an employee of the said company, and have more or less the same pay than a regular engineer)

The field of ML applied to the industry is really something I want to work in, but I don't want to do the dumb mistake of rushing for a PhD because the job market sucks and that finding a job

/r/MachineLearning
https://redd.it/ksyn9h
How can I make Admin page be rendered only for one specific user?

Hi there!

I am trying to learn Flask and I am currently stuck on making the Admin page be rendered only if userid == 1. However, it seems like this line: admin = Admin(app) makes my admin be rendered no matter what condition I add. I added :

if 'loggedin' in session and session['id'\] == 1:
return render_template('home.html', username=session['username'\])

However, it seems to ignore the condition. Can anyone help me out a little bit? Thank you so much in advance!

/r/flask
https://redd.it/kt4na5
What's the correct way to route URLs when there are "deep" one-to-many relationships?

Let's say there are three models: organization, project and task. An organization can have many projects, and a project can have many tasks.

Now, as I'm trying to figure out the API, I'd like to stick to the "relational" URLs, for instance `/api/v1/organizations/123/projects/456/tasks/789` to retrieve the details for a task.

How should I set up the routing and views in this one? I already have viewsets for organizations, projects and tasks set up, but the routes and URLs are not yet working.

Thanks in advance!

/r/django
https://redd.it/kt2ubh
Building Flask App - How to seed Postgres DB with data from JSONplaceholder API...

Good day community

I am busy building a Flask App (blog) as beginner. In short what I would like to know is how can I seed my postgres db with the data from JSON Placeholder API (https://jsonplaceholder.typicode.com/posts).. as always I would be using SQLAlchemy as the ORM of choice.

Any tutorials or resources would be welcome. Thanks in advance...yours in reddit..

/r/flask
https://redd.it/kt0zxz
Why Django? Im confused.

Hi! I've recently been watching "Fireship" on youtube. https://www.youtube.com/channel/UCsBjURrPoezykLs9EqgamOA

Thing is, he shows all of these different technologies that are being released. And I can't help but think: why learn all that when you can focus on a single language like python (specially having things such as Django!).

I'm most certainly missing and misunderstanding something here.

Why would you put the extra effort with Javascript and its thousands of frameworks or learn flutter when you can do all those things in django???

/r/django
https://redd.it/kt7ojj
Importing an Mp3 File

Hello everyone,

I am using jupyter notebooks to create a speech to translation program. However, whenever I upload an mp3 file I always get an error. Can anyone please give me some insight on why this is happening.

Thanks

​

https://preview.redd.it/ajt8ctnux4a61.png?width=960&format=png&auto=webp&s=43bd5257c1836a80552acb95c93f442b98da905a

​

https://preview.redd.it/526au2twx4a61.png?width=960&format=png&auto=webp&s=ec50317694570af2ee787a02771820fb875fc7e6

​

​

​

https://preview.redd.it/9adfh5pyx4a61.png?width=960&format=png&auto=webp&s=b550a6bb8e07a2ac57572075b9d534399e7eae2f

/r/JupyterNotebooks
https://redd.it/kt5x3b
Saturday Daily Thread: Share your resources!

Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?

Use this thread to chat about and share Python resources!

/r/Python
https://redd.it/ktfa01
Heroku deployment



Hi guys so i tried to deploy on heroku and it didn't work so I tried again and this time i used the "heroku create [name\] to create another app. And then ran git push heroku master after commiting changes but the error i got was

( ! [remote rejected\] master -> master (pre-receive hook declined)

error: failed to push some refs to 'old appname'.

So I wanted to know why it pushed to the old one and not the new one and how to fix it

Also another different question, do you guys have two settings like "local_settings.py and settings.py" or only one.

/r/django
https://redd.it/ktf7t0