An artificial intelligence based approach for constraining the redshift of blazars using γ–ray observations