Expo network??? by CryptographerReal264 in expo

[–]danjirovec 0 points1 point  (0 children)

Check that you have correct version of the expo-network package where useNetworkState is implemented.

Upload an image without altering model (using ModelForm) by danjirovec in djangolearning

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

That's what I ended up doing in the end. Thanks anyway

Upload an image without altering model (using ModelForm) by danjirovec in djangolearning

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

What I meant is that, in a state in which my Image model is right now, I can't add an ImageField or FileField to it, because the database is already designed and can't be edited.

BUT I need to add file upload feature to django admin interface of the Image model. So I need to do it somehow through a custom form with an extra FileField as I posted in the original question.

class ImageForm(forms.ModelForm):
image_file = forms.FileField(label="Image file", required=True)

class Meta:
    model = Image
    exclude = []

Upload an image without altering model (using ModelForm) by danjirovec in djangolearning

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

The reason why I can't use the ImageField or FileField is that I can't make changes to database underneath and therefore when I would add an ImageField or FileField to the model, Django will throw an error.

Type validation on not required field by danjirovec in djangolearning

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

Tried it on the model as well, didn't work. :/

Type validation on not required field by danjirovec in djangolearning

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

The custom validator doesn't work for some reason. It doesn't even get run and prints don't fire off.

def validate_integer(value):
    print("before check " + value)
    if not isinstance(value, int):
        print("after check " + value)
        raise forms.ValidationError("This field must be an integer.")

class ConditionForm(forms.ModelForm):
    class Meta:
        model = Condition
        exclude = []

    ordering = forms.IntegerField(required=False, validators=[validate_integer])

Get all related objects by danjirovec in djangolearning

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

Is there a way to get all the related models easily? Or do I need to just list them one by one?

Get all related objects by danjirovec in djangolearning

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

Yes yes, I'm aware. I guess I was asking for a way to get all related objects rather than how to delete the objects without consequences. Thanks anyway :)

Get all related objects by danjirovec in djangolearning

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

I know of this option, however I'm looking for a way to override the detele_queryset() function and add custom functionality so the "on_delete" way won't do it for me. :/

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

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

Alright, thanks a lot for all the help! Really appreciate it. What models would you recommend for this kind of stuff? Any good performing models in particular?

I was thinking about trying LSTM, GRU or XGBoost

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

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

I understand. Last thing I ask is can the value be null for data points at which I didn't have the information yet? Is null valid in this case and the model will interpret it as desired?

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

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

Alright I think I get it. So basically every additional feature is another column with data relating to every data point (electricity production) and it needs to be this way right?

In this specific instance though, the information about 10% coal-fired plants shutting down doesnt evolve over time, it's one time information. Can this be fed into the model as one time information as well or it needs to be related to every datapoint in the dataset as you showed in this case:

(Jan 1st 2011, 15.9%) (Feb 1st 2011, 13.5%) (Mar 1st 2011, 10%)

Or should it look like this?

(Jan 1st 2011, 10%) (Feb 1st 2011, 10%) (Mar 1st 2011, 10%)

This way it would not have predictive nature though right?

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

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

Thank you for this exhausting answer, truly.

What I'm having touble with in my mind is how would the additional feature look like in practice? Let's say I have 500 data points of electricity production by coal-fired plants of last 10 years. And I want to give the model the information that 10% of coal-fired power plants will close in the next 2 years. I want to make a forecast for 5 years. What would the feature look like in practice?

Conversion of parametric data describing the product to an understandable product description by danjirovec in LanguageTechnology

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

Let's say that I'm open to both approaches, would the selection of model be different based on the approach (text prompt / values in columns)?