Learning through samples