Coder Social home page Coder Social logo

RuntimeError:error in moeaplot: The number of ObjVs columns must not be 1. (使用frontplot绘图函数时,ObjV的列数不能为1。) about geatpy HOT 2 CLOSED

geatpy-dev avatar geatpy-dev commented on July 17, 2024
RuntimeError:error in moeaplot: The number of ObjVs columns must not be 1. (使用frontplot绘图函数时,ObjV的列数不能为1。)

from geatpy.

Comments (2)

1061655504 avatar 1061655504 commented on July 17, 2024

I was trying to solve a small optimization problem using NSGA2.
In MyProblem.py, I defined the aimFuc function as the following:
My input format is:
x1 = Vars[:,[0]]
x2 = Vars[:,[1]]
My output is of the format:
obj =np.array( [[a],[b],[c]] ) #where a,b,c are integers and the len(obj) = len(Vars).
When I was running my main file, I ran across the following error saying my obj shape is wrong:
RuntimeError: error in moeaplot: The number of ObjVs columns must not be 1. (使用frontplot绘图函数时,ObjV的列数不能为1。)
Can anyone help me with this one? Thanks : )

您好!我分析了一下您遇到了两个问题:

  1. Geatpy更新的2.1.0版本没有上述判断代码。您安装的应该是2.0.0公测版。
    2.在2.0.0公测版里面moeaplot()函数只能绘制二维及以上的目标空间图像。您可以
    print(ObjV)看看ObjV是否正常。moeaplot函数要求传入的ObjV是一个目标函数值矩阵,每行对应一个个体,每一列对应一个目标。其API文档可通过help(ea.moeaplot)查看。

from geatpy.

xrzalreadytaken avatar xrzalreadytaken commented on July 17, 2024

明白了。moea是针对多个目标函数使用的,所以objv应该对应最起码2个目标函数,因此至少要2列。我的情况要使用soea。多谢~

from geatpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.