Closed amos-peter closed 3 years ago
Hi, I think I manage to code to maximize a set of score objective. Could you please review if I code it in the right way?
comp_scores = np.array(comp_score).reshape(-1,1)
def comp_score_obj(w, score):
return w @ -score
ef = EfficientFrontier(mu, S, weight_bounds=(0, 1))
ef.convex_objective(comp_score_obj, score=comp_scores )
weights = ef.clean_weights()
weights
Looks good!
Hi could you please show me how to maximize a set score in pyportfolio "ef.add_objective(objective_functions.L2_reg, gamma=2)". I have done a manual cvxpy. However, i am not sure how to implement using add_objective funcitions.