Revise Imports, use np.unique to accomplish sparse case in base fit