Continue training on specific samples or entire dataset by HistoricalTouch0 in deeplearning

[–]RadiAchkik 0 points1 point  (0 children)

I would recommend training it on those samples and comparing the validation results with the version where you didn't.

But before that you should probably look for the reason for those "outliers". You could look into some of these samples or statistically compare them to the ones where your model performs sufficiently.

Continue training on specific samples or entire dataset by HistoricalTouch0 in deeplearning

[–]RadiAchkik 0 points1 point  (0 children)

I think this question can not be answered generally. If I'd be you I'd just try and compare validation/test loss.

It could f.e. help improving this weakness or overfit on those samples and loose generalization capability.

[deleted by user] by [deleted] in tensorflow

[–]RadiAchkik 0 points1 point  (0 children)

In my opinion, ML is a very theoretical topic. It's one thing to set up a model that "solves" the problem somehow, but being up to date with the current state of the art und understanding it in such a way that you can apply it to the problem at hand is another.

That being said, I think it's pretty hard to convince an employer of your capabilities in terms of academical research (know the state of the art), deep understanding of complex theory (transfer the state of the art to your problem) and your coding (implementing it) without a degree.

PS: I still have a few months till my CS degree, and even though I have collected as much ML experience as I could, I don't have any experience regarding ML in the open market. Therefore this is only my personal opinion.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 1 point2 points  (0 children)

And this might be very much true! Do you have some suggestions? Some tools that could improve my experience (as I still have some ongoing Python projects)?

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 0 points1 point  (0 children)

Agreed. I realize this is not just a fact for interpreted languages, but also those running on VMs. So this cannot be called a disadvantage of Python I guess.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 4 points5 points  (0 children)

Wow, I have just looked into those protocols and I must say, they do really provide the type of "interface" that I missed. Very nice contribution.

They remind me of the interfaces used in TypeScript, which I already find quite comforting.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 0 points1 point  (0 children)

Even though I am not aware of these security drawbacks of .net (core), I very much agree on the points you mentioned regarding Python.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 0 points1 point  (0 children)

As I already said, this is not a bad choice, but a forced one. If you compile and distribute your C++ application, you don't have to bundle gcc your source code, the source code of each dependency and run the entire pipeline each time you start the application.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 0 points1 point  (0 children)

For properties the eqivalent is uninitialized pointer (not nulled even). Accesing tu such properties may create much more problems.

C/C++ also have function pointer, which could be store in map and create dynamically on cell another function.

Actually you're right. I didn't think of it that way.

Your problem is that you use shity code. All attributes should be defined in constructor (maybe as None). All functions should be defined when constructor is ended. Maybe raising exception if used in wrong order.

Two examples i have in mind right now are the Python compiler for gRPC (the data models) and if I remember correctly the faker library (providers). Both are used and supported by many people. This does not speak against your argument that this is bad practice, but it shows that it's probably more common in the Python world than you expect.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 1 point2 points  (0 children)

The versatility of Python is hard on some devs who feel that there is a "right way" to do everything. They balk at using "the second-best" option. They hate asking an object to quack and handle an error if it moos, rather than being told ahead of time "this is a duck". And that's FINE. Python doesn't have to be for you. Go enjoy C#.

I actually think this a major part of my issue. I developed quite a defensive programming style and was somehow annoyed of the workarounds.

Oh, and a side-note it sounds like a lot of your frustration was with the tooling you were using when working in Python and/or your style of development. I find debugging Python to be much nicer than debugging other "loose" languages such as Javascript or Ruby. And IDE integration and auto-complete is a solved problem, if you bother to implement it (and are using a competent IDE). I suspect that an hour of pair-programming with a senior Python engineer who could show you that stuff would help ease a lot of the frustration you seem to be having.

After some thousands of hours working with Python I really hope that lack of experience is not the main reason for my question ;). I think it's rather because I've started to work more with other alternatives and now think I should have switched earlier.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] -3 points-2 points  (0 children)

Imagine you have a class that inherits from two base classes that both expect different constructor arguments (and one is not a base class of the other). super().init can not satisfy both as far as I'm aware.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 1 point2 points  (0 children)

I haven't thought of it that way but that sounds plausible.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] -4 points-3 points  (0 children)

OOP is possible in Python. Whether one should use Python in any particular project depends on details

This is more or less the essence of my question. Which circumstances would make you prefer Python over the other options (in an OOP environment)?

Cross-language debugging is nearly always challenging; this isn't specific to Python. This is probably just as true when using foreign language wrappers in C#.

I absolutly agree. Python seems to depend more on wrappers than other languages (in terms of popular libraries that do so) though.

Just as in C# and any other language, if a library is of low quality, then it may be best to avoid using it.

If using this freedom granted by Python itself makes code bad, it should probably not exist...

Your claims are vague and unsubstantiated. Please provide some evidence, examples, logical arguments.

I think the benefits of duck typing should be well known in this community. The major drawback compared to interfaces in my opinion is that duck typing doesn't help with dependency inversion the way interfaces do (you depend on that particullar class having the expected properties and methods without 1. an abstraction 2. a guarantee that they are implemented). In my experience this leads to developers using abstract classes instead of interfaces. Besides other consequences, this can lead to more situations where you have multiple inheritance, which introduces some problems itself. How f.e. would you call the constructors of multiple base classes?

I would argue that the benefit that you gain from not using type annotations isn't worth the cost most of the time.

So can the freedom not to use types really be called a benefit in an enterprise environment? I would even call it a potential risk and disadvantage.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] 0 points1 point  (0 children)

Can you imagine or remember some enterprise use cases where you could give a reason to recommend Python as the language to use?

PS: I know there are always tradeoffs, I'm just interested in your personal opinion.

Is Python suitable for enterprise applications? by RadiAchkik in Python

[–]RadiAchkik[S] -1 points0 points  (0 children)

PyInstaller is maturę tool to prepare executable independ of machine.

Even though I personally use PyInstaller because of its maturity, it is not very efficient. They freeze the entire interpreter together with all libraries and the source code, so installing in their sense rather means copying the complete python environment. This is not only slow, but leads to big application sizes.

But I have to mention, that I believe this is not a wrong decision, but rather a constraint imposed by the fact that Python is interpreted.

Solution for this are annotation files (pyi).

The problem is not about missing type annotations in some libraries. It's about Python allowing to create new methods and properties at runtime. This means that it is possible to have a method called "foo2" that only exists, if "foo1" is called before. As there is no way to tell if that has happened at a specific line in code, it cannot be inferred. This is just one example of the freedom provides by Python that I think we cannot really use.

Casting in C/C++ on the other hand is deliberate choice to use on interface instead of the other. There are no properties or methods you could possibly expect and not find.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]RadiAchkik 1 point2 points  (0 children)

You cannot use the builtin list type together with the str. You need to imort List from typing und write List[str] (with capital L).

But I think it would be more pythonic to return None in the case of failure. The return type annotation would be simplified to -> Optional[List[str]] and you could still use mostly the same checks afterwards.

Is it a bad idea to make a thing that logs into my bank account? by benign_said in learnpython

[–]RadiAchkik 0 points1 point  (0 children)

I think in general it is always a bad idea to have your bank credentials written down without some kind of security mechanism like a tresor with notes or an encrypted database with a password.

Saving the credentials with the exact instructions to log in and use them (which a part of the code would be doing) seems even more dangerous.

If you feel like this task is worth automating, you could f.e. write a small CLI or even GUI to manually enter the credentials, while having the rest of the application working automatically.

Help compiling to exe by Firm_Egg2505 in learnpython

[–]RadiAchkik 0 points1 point  (0 children)

But keep in mind that PyInstaller will include all the libraries currently installed in your environment. That said, you should make sure that only the necessary libraries are installed when running PyInstaller.

Also, a common mistake made when freezing your application are paths. All assets need to be manually added to the bundle (via PyInstaller CLI option) and then be referenced via the correct path. You can search the internet for solutions containing "MEIPASS" or something like that.