SeaWolf-AI commited on
Commit
ca4a7cd
·
verified ·
1 Parent(s): 50e96ee

fix: 참여 가이드 예제 - 축 부문은 JSON 배열로, 그리고 깨져 있던 개행 이스케이프

Browse files

(1) 네 개의 스타터가 모두 스칼라 CSV 를 찍어 축 부문 참가자는 예제대로 따라하면 막혔다. saveBlock() 한 곳으로 모으고 axes 가 있으면 predictions.json 을 쓰게 했다. LLM 프롬프트의 출력 안내도 같이. (2) 템플릿 리터럴 안의 개행 이스케이프가 진짜 줄바꿈이 돼 46개 부문의 예제가 전부 문법 오류였다(문자열이 줄을 넘음). 확인: 수정 전 SyntaxError, 수정 후 ast.parse 통과.

Files changed (1) hide show
  1. index.html +23 -17
index.html CHANGED
@@ -577,6 +577,23 @@ async function paneRank(b){
577
 
578
  /* 부문 값이 채워진 참여 가이드. 일반문으로 두면 참가자가 자기 부문에 맞게 고쳐야 하고,
579
  대부분 그 단계에서 떨어진다. */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
580
  function promptFor(b){
581
  const nf=(b.noise_floor||{}).sd_single;
582
  const mk=metricOf(b);
@@ -591,7 +608,8 @@ function promptFor(b){
591
  ``,
592
  `[과제]`,
593
  ` 입력 ${b.board.toLowerCase()}_test.json — compound_id 와 SMILES 만 들어 있다 (${b.n_test}개)`,
594
- ` 출력 predictions.csv — 두 열: compound_id,prediction`,
 
595
  ` 예측값 ${unit}`,
596
  b.target && b.target!=="—" ? ` 대상 ${b.target} · ${b.type}` : ` 대상 ${b.type}`,
597
  ``,
@@ -686,10 +704,7 @@ b.clip?` if ${b.clip[0]} <= float(np.median(v["p"])) <= ${b.clip[1]}} #
686
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
687
  ` for c in test["compounds"]])`,
688
  `p = model.predict(Xt)`,
689
- `with open("predictions.csv", "w") as f:`,
690
- ` f.write("compound_id,prediction\n")`,
691
- ` for c, v in zip(test["compounds"], p):`,
692
- ` f.write("%s,%.4f\n" % (c["compound_id"], v))`
693
  ].filter(x=>x!==``||true).join("\n");
694
  }
695
 
@@ -736,10 +751,7 @@ function starterMolecule(b){
736
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
737
  ` for c in test["compounds"]])`,
738
  `p = model.predict_proba(Xt)[:, 1]`,
739
- `with open("predictions.csv", "w") as f:`,
740
- ` f.write("compound_id,prediction\n")`,
741
- ` for c, v in zip(test["compounds"], p):`,
742
- ` f.write("%s,%.4f\n" % (c["compound_id"], v))`
743
  ].join("\n");
744
  }
745
 
@@ -794,10 +806,7 @@ function starterDerived(b){
794
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
795
  ` for c in test["compounds"]])`,
796
  `p = m_t.predict(Xt) - m_h.predict(Xt)`,
797
- `with open("predictions.csv", "w") as f:`,
798
- ` f.write("compound_id,prediction\n")`,
799
- ` for c, v in zip(test["compounds"], p):`,
800
- ` f.write("%s,%.4f\n" % (c["compound_id"], v))`
801
  ].join("\n");
802
  }
803
 
@@ -835,10 +844,7 @@ function starterNoChembl(b){
835
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
836
  ` for c in test["compounds"]])`,
837
  `p = model.predict(Xt)`,
838
- `with open("predictions.csv", "w") as f:`,
839
- ` f.write("compound_id,prediction\n")`,
840
- ` for c, v in zip(test["compounds"], p):`,
841
- ` f.write("%s,%.4f\n" % (c["compound_id"], v))`
842
  ].join("\n");
843
  }
844
 
 
577
 
578
  /* 부문 값이 채워진 참여 가이드. 일반문으로 두면 참가자가 자기 부문에 맞게 고쳐야 하고,
579
  대부분 그 단계에서 떨어진다. */
580
+ /* 예측 파일을 쓰는 부분. 부문이 축을 여러 개 요구하면 CSV 한 칸에 담을 수 없다.
581
+ 전에는 네 개의 스타터가 모두 스칼라 CSV 를 찍어서, 축 부문 참가자는 예제를
582
+ 그대로 따라 하면 반드시 막혔다 (2026-09-08 참가자 제보). 한 곳에 모은다. */
583
+ function saveBlock(b){
584
+ if(!b.axes) return [
585
+ `with open("predictions.csv", "w") as f:`,
586
+ ` f.write("compound_id,prediction\\n")`,
587
+ ` for c, v in zip(test["compounds"], p):`,
588
+ ` f.write("%s,%.4f\\n" % (c["compound_id"], v))`];
589
+ return [
590
+ `# 이 부문은 화합물마다 축이 ${b.axes}개다. 모델도 ${b.axes}개를 내야 한다`,
591
+ `# (예: MultiOutputRegressor 로 감싸거나 축마다 따로 학습).`,
592
+ `out = {c["compound_id"]: [round(float(x), 4) for x in v]`,
593
+ ` for c, v in zip(test["compounds"], p)}`,
594
+ `json.dump(out, open("predictions.json", "w"))`];
595
+ }
596
+
597
  function promptFor(b){
598
  const nf=(b.noise_floor||{}).sd_single;
599
  const mk=metricOf(b);
 
608
  ``,
609
  `[과제]`,
610
  ` 입력 ${b.board.toLowerCase()}_test.json — compound_id 와 SMILES 만 들어 있다 (${b.n_test}개)`,
611
+ b.axes ? ` 출력 predictions.json — {compound_id: [숫자 ${b.axes}개]} 형태`
612
+ : ` 출력 predictions.csv — 두 열: compound_id,prediction`,
613
  ` 예측값 ${unit}`,
614
  b.target && b.target!=="—" ? ` 대상 ${b.target} · ${b.type}` : ` 대상 ${b.type}`,
615
  ``,
 
704
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
705
  ` for c in test["compounds"]])`,
706
  `p = model.predict(Xt)`,
707
+ ...saveBlock(b)
 
 
 
708
  ].filter(x=>x!==``||true).join("\n");
709
  }
710
 
 
751
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
752
  ` for c in test["compounds"]])`,
753
  `p = model.predict_proba(Xt)[:, 1]`,
754
+ ...saveBlock(b)
 
 
 
755
  ].join("\n");
756
  }
757
 
 
806
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
807
  ` for c in test["compounds"]])`,
808
  `p = m_t.predict(Xt) - m_h.predict(Xt)`,
809
+ ...saveBlock(b)
 
 
 
810
  ].join("\n");
811
  }
812
 
 
844
  `Xt = np.array([gen.GetFingerprintAsNumPy(Chem.MolFromSmiles(c["smiles"]))`,
845
  ` for c in test["compounds"]])`,
846
  `p = model.predict(Xt)`,
847
+ ...saveBlock(b)
 
 
 
848
  ].join("\n");
849
  }
850